Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve MSID representation #223

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
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
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