STYLE: Replace ULL with IT as index type in itkPyVectorContainerTest.py - #6807
Conversation
Removed the check for sufficient wrapping from "Modules/Bridge/NumPy/wrapping/test/itkPyVectorContainerTest.py". `itk.VectorContainer` is always sufficiently wrapped for `itk.IT`. Follow-up to pull request InsightSoftwareConsortium#6800 commit 0939d4c "STYLE: Replace UL with IT as index type in itkPyVectorContainerTest.py", (which was about the other "itkPyVectorContainerTest.py" file, in "Filtering/MeshToPolyData/wrapping/test").
|
| @@ -78,7 +66,7 @@ def test_NumPyBridge_VectorContainer(self): | |||
| self.assertNotEqual(v2_cp.GetElement(0), arr_cp[0]) | |||
|
|
|||
| PointType = itk.Point[itk.F, 3] | |||
| v_point = itk.VectorContainer[itk.ULL, PointType].New() | |||
| v_point = itk.VectorContainer[itk.IT, PointType].New() | |||
| v_point.Reserve(2) | |||
| point = PointType() | |||
| point[0] = 1.0 | |||
| @@ -95,7 +83,7 @@ def test_NumPyBridge_VectorContainer(self): | |||
| ) | |||
|
|
|||
| PointType = itk.Point[itk.F, 2] | |||
There was a problem hiding this comment.
Conditional wrappings go unchecked
The test is registered for every Python-wrapping build, but it now unconditionally requests the IT,F vector-container specialization and float Point vector containers in dimensions 2 and 3. Those templates are intentionally absent when ITK_WRAP_float=OFF or when either dimension is omitted from ITK_WRAP_IMAGE_DIMS, so these supported reduced configurations fail template lookup instead of skipping the test. Restore an equivalent availability guard, or only register this test when float plus dimensions 2 and 3 are wrapped.
Context Used: AGENTS.md (source)
Artifacts
Narrow vector-container wrapping reproduction source
- The review-authored Python harness executes the parent and current test sources against the wrapping availability rules, with the takeaway that unavailable specializations are exercised directly.
Parent test run with float disabled and 2D excluded
- The executed parent-source run prints its insufficient-wrapping skip and returns successfully for both reduced configurations, with the takeaway that the prior behavior was to skip.
Current test run with float disabled and 2D excluded
- The executed current-source run reports missing `IT,F` when float is disabled and missing float Point 2D when dimension 2 is excluded, with the takeaway that the claimed regression is reproduced.
Removed the check for sufficient wrapping from "Modules/Bridge/NumPy/wrapping/test/itkPyVectorContainerTest.py".
itk.VectorContaineris always sufficiently wrapped foritk.IT.