Skip to content

Commit

Permalink
Merge pull request #223 from sot/better-msid-repr
Browse files Browse the repository at this point in the history
Improve MSID representation
  • Loading branch information
taldcroft authored Oct 22, 2021
2 parents fc7d777 + f15d9fb commit 7d32233
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Ska/engarchive/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def dtype(self):
return self.vals.dtype

def __repr__(self):
attrs = [self.__class__.__name__]
attrs = [self.__class__.__name__, self.MSID]
for name, val in (('start', self.datestart),
('stop', self.datestop),
('len', len(self)),
Expand Down
4 changes: 2 additions & 2 deletions Ska/engarchive/tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_filter_bad_times_overlap():
fetch.msid_bad_times = msid_bad_times_cache

# Test repr, len, and dtype attribute here where we have an MSID object handy
assert repr(dat) == ('<MSID start=2008:290:12:00:00.000 stop=2008:300:12:00:00.000'
assert repr(dat) == ('<MSID AOGBIAS1 start=2008:290:12:00:00.000 stop=2008:300:12:00:00.000'
' len=5 dtype=float32 unit=rad/s stat=daily>')
assert dat.dtype.name == 'float32'
assert len(dat) == 5
Expand All @@ -56,7 +56,7 @@ def test_filter_bad_times_overlap():
def test_filter_bad_times_list():
dat = fetch.MSID('aogyrct1', '2008:291:12:00:00', '2008:298:12:00:00')
# 2nd test of repr here where we have an MSID object handy
assert repr(dat) == ('<MSID start=2008:291:12:00:00.000 '
assert repr(dat) == ('<MSID AOGYRCT1 start=2008:291:12:00:00.000 '
'stop=2008:298:12:00:00.000 len=2360195 dtype=int16>')

dat.filter_bad_times(table=BAD_TIMES)
Expand Down

0 comments on commit 7d32233

Please sign in to comment.