Skip to content

Commit ed26ad9

Browse files
committed
typ: Ignore Pointset.__rmatmul__/ndarray.__matmul__ inconsistency
1 parent 7feca77 commit ed26ad9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nibabel/pointset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ def dim(self) -> int:
101101
"""The dimensionality of the space the coordinates are in"""
102102
return self.coordinates.shape[1] - self.homogeneous
103103

104-
def __rmatmul__(self, affine: np.ndarray) -> Self:
104+
# Use __rmatmul__ to prefer to compose affines. Mypy does not like that
105+
# this conflicts with ndarray.__matmul__. We will need some more feedback
106+
# on how this plays out for type-checking or code suggestions before we
107+
# can do better than ignore.
108+
def __rmatmul__(self, affine: np.ndarray) -> Self: # type: ignore[misc]
105109
"""Apply an affine transformation to the pointset
106110
107111
This will return a new pointset with an updated affine matrix only.

0 commit comments

Comments
 (0)