Skip to content

Commit

Permalink
typ: Ignore Pointset.__rmatmul__/ndarray.__matmul__ inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Sep 7, 2024
1 parent a1fff40 commit e2fe190
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nibabel/pointset.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ def dim(self) -> int:
"""The dimensionality of the space the coordinates are in"""
return self.coordinates.shape[1] - self.homogeneous

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

0 comments on commit e2fe190

Please sign in to comment.