Skip to content

Commit 5210cc2

Browse files
committed
ENH: Make representation match repr(itkVector)
1 parent 152ed00 commit 5210cc2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Wrapping/Generators/Python/PyBase/pyBase.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ str = str
560560
[vnl_mat.get(i, j) for j in range(vnl_mat.cols())]
561561
for i in range(vnl_mat.rows())
562562
]
563-
return repr(type(self)).split("'")[1] + "(" + repr(python_list_mat) + ")"
563+
return type(self).__name__ + " (" + repr(python_list_mat) + ")"
564564
%}
565565
}
566566

Wrapping/Generators/Python/Tests/extras.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def custom_callback(name, progress):
396396
# and make sure that the matrix hasn't changed.
397397
assert m_itk(0, 0) == 1
398398
# Test __repr__
399-
assert repr(m_itk) == "itk.itkMatrixPython.itkMatrixD33([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])"
399+
assert repr(m_itk) == "itkMatrixD33 ([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])"
400400

401401
# test .astype for itk.Image
402402
numpyImage = np.random.randint(0, 256, (8, 12, 5)).astype(np.uint8)

0 commit comments

Comments
 (0)