Closed tbirdso closed 2 years ago
I missed the open PR, thanks @dzenanz and @PranjalSahu !
@PranjalSahu You may have already seen this, it looks like just MeshSerializationTest
is failing now with a new error:
Traceback (most recent call last):
File "D:/a/1/s/Modules/Core/Mesh/wrapping/test/itkMeshSerializationTest.py", line 66, in <module>
mesh.SetCellsArray(cells_vector, itk.CommonEnums.CellGeometry_TRIANGLE_CELL)
TypeError: in method 'itkMeshD3_SetCellsArray', argument 2 of type 'itkVectorContainerULLULL *'
Additional information:
Wrong number or type of arguments for overloaded function 'itkMeshD3_SetCellsArray'.
Possible C/C++ prototypes are:
itkMeshD3::SetCellsArray(itkVectorContainerULLULL *)
itkMeshD3::SetCellsArray(itkVectorContainerULLULL *,int)
itkTestDriver: Process exited with return value: 1
There seems to be a difference for enums in windows and linux. I will check it.
Thanks @PranjalSahu.
Probably unrelated to enums, but as a note on the previous resolution for posterity, a few ITK Python constructors have slightly different wrappings on Windows vs Linux due to different IdentifierType
specifiers for unsigned long
vs unsigned long long
system architecture. IdentityType
manglings are described in the ITK Software Guide on page 223 under the wrapping table. A good way to approach this is what @PranjalSahu did in #3309 with an inline platform check during the test.
I'm not sure that itk.UL
vs itk.ULL
will account for differences in enum behavior, though.
Yes, that was my first impression due to the message related to 2nd argument in the SetCellsArray.
I looked closely at the code and it probably originates due to this line
cells_array = np.zeros([NumberOfCells, Dimension], np.uint)
I will run the code end-to-end on the windows platform this time.
@PranjalSahu Agreed. I would recommend taking a look at _get_itk_pixelid in extras.py
as well to verify that the numpy <-> ITK type conversion is happening as expected, possibly tracing through with pdb.set_trace()
.
Will raise a PR soon. We need to add a conditional entry for np.uint64 in _get_itk_pixelid. Also in my test, I have to use np.uint64.
ctest tip is great! It will help me in testing code faster in the future.
Description
CDash results show failures in Mesh and Point Set serialization Python tests.
Steps to Reproduce
ctest -C Release -R MeshSerialization
Expected behavior
Test passes
Actual behavior
Reproducibility
100%
Versions
main branch
Environment
Windows 10, Python 3.8.5
Additional Information
Issue stems from inconsistent
IdentifierType
wrappings across platforms whereITKM_IT
may be replaced withitk.UL
oritk.ULL
depending on architecture. This leads to difficulty in designing tests for objects such asVectorContainer
that require anIdentifierType
key in their template.