Skip to content

Commit 03439e9

Browse files
committed
Change ArrayData.__repr__() to match XyzComponents.__repr__()
1 parent 6e7f8fa commit 03439e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sfs/array.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ class ArrayData(namedtuple('ArrayData', 'x n a')):
3636

3737
__slots__ = ()
3838

39+
def __repr__(self):
40+
return 'ArrayData(\n' + ',\n'.join(
41+
' {0}={1}'.format(name, repr(data).replace('\n', '\n '))
42+
for name, data in zip('xna', self)) + ')'
43+
3944
def take(self, indices):
4045
"""Return a sub-array given by `indices`."""
4146
return ArrayData(self.x[indices], self.n[indices], self.a[indices])

0 commit comments

Comments
 (0)