Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions src/vector/backends/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,7 @@ def _getitem(
return array.ObjectClass(out[name]) # type: ignore[call-arg]


def _array_repr(
array: VectorNumpy2D | VectorNumpy3D | VectorNumpy4D,
is_momentum: bool,
) -> str:
def _array_repr(array: VectorNumpy2D | VectorNumpy3D | VectorNumpy4D) -> str:
"""
Constructs the value for ``__repr__`` function of the provided VectorNumpy
class.
Expand Down Expand Up @@ -1248,7 +1245,7 @@ def __str__(self) -> str:
return str(self.view(numpy.ndarray))

def __repr__(self) -> str:
return _array_repr(self, False)
return _array_repr(self)

@property
def azimuthal(self) -> AzimuthalNumpy:
Expand Down Expand Up @@ -1402,7 +1399,7 @@ class MomentumNumpy2D(PlanarMomentum, VectorNumpy2D): # type: ignore[misc]
dtype: numpy.dtype[typing.Any]

def __repr__(self) -> str:
return _array_repr(self, True)
return _array_repr(self)

def __setitem__(self, where: typing.Any, what: typing.Any) -> None:
return _setitem(self, where, what, True)
Expand Down Expand Up @@ -1451,7 +1448,7 @@ def __str__(self) -> str:
return str(self.view(numpy.ndarray))

def __repr__(self) -> str:
return _array_repr(self, False)
return _array_repr(self)

@property
def azimuthal(self) -> AzimuthalNumpy:
Expand Down Expand Up @@ -1658,7 +1655,7 @@ class MomentumNumpy3D(SpatialMomentum, VectorNumpy3D): # type: ignore[misc]
dtype: numpy.dtype[typing.Any]

def __repr__(self) -> str:
return _array_repr(self, True)
return _array_repr(self)

def __setitem__(self, where: typing.Any, what: typing.Any) -> None:
return _setitem(self, where, what, True)
Expand Down Expand Up @@ -1710,7 +1707,7 @@ def __str__(self) -> str:
return str(self.view(numpy.ndarray))

def __repr__(self) -> str:
return _array_repr(self, False)
return _array_repr(self)

@property
def azimuthal(self) -> AzimuthalNumpy:
Expand Down Expand Up @@ -1978,7 +1975,7 @@ class MomentumNumpy4D(LorentzMomentum, VectorNumpy4D): # type: ignore[misc]
dtype: numpy.dtype[typing.Any]

def __repr__(self) -> str:
return _array_repr(self, True)
return _array_repr(self)

def __setitem__(self, where: typing.Any, what: typing.Any) -> None:
return _setitem(self, where, what, True)
Expand Down