Skip to content

Commit

Permalink
keep it simple
Browse files Browse the repository at this point in the history
  • Loading branch information
Bchass committed Jun 27, 2024
1 parent 183ca80 commit 665a4d7
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions tinynumpy/tinynumpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,6 @@ def _repr_r(self, s, axis, offset):
s += ('\n ' + ' ' * axis) * axisindent
if axis == self.ndim - 1: # Last axis
offset_ = offset + k_index * self._strides[axis] // self._itemsize
if offset_ >= len(self._data):
raise IndexError("invalid index")
elem_repr = repr(self._data[offset_])
if self._dtype.startswith('float'):
if elem_repr.endswith('.0'):
Expand All @@ -777,14 +775,6 @@ def _repr_r(self, s, axis, offset):
if k_index < self._shape[axis] - 1:
s += ', '
s += ']'
else:
if offset >= len(self._data):
raise IndexError("invalid index")
elem_repr = repr(self._data[offset])
if self._dtype.startswith('float'):
if elem_repr.endswith('.0'):
elem_repr = elem_repr[:-2] # Remove trailing '.0'
s += elem_repr
return s

def __repr__(self):
Expand Down

0 comments on commit 665a4d7

Please sign in to comment.