-
Notifications
You must be signed in to change notification settings - Fork 10
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
increase test coverage #39
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #39 +/- ##
==========================================
+ Coverage 85.65% 92.95% +7.30%
==========================================
Files 24 24
Lines 1122 1093 -29
==========================================
+ Hits 961 1016 +55
+ Misses 161 77 -84
☔ View full report in Codecov by Sentry. |
601eaaf
to
0d2cd06
Compare
# detect the type light curve in a FITS file: | ||
with fits.open(file_obj) as hdulist: | ||
filetype = detect_filetype(hdulist) | ||
|
||
# get the constructor for this type of light curve: | ||
filetype_to_cls = { | ||
'KeplerLightCurve': KeplerLightCurve, | ||
'TessLightCurve': TessLightCurve | ||
} | ||
cls = filetype_to_cls[filetype] | ||
# read the light curve: | ||
light_curve = cls.read(file_obj) | ||
light_curve = lightkurve.read(file_obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmorris3 - any reason why we can't rely on lightkurve functionality here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this was a workaround in #10 until lightkurve/lightkurve#1299 was merged (see #10 (comment)). If this is simplification is working correctly now, then we're all good!
@@ -31,7 +31,7 @@ def _get_range_subset_bounds(self, subset_state, *args, **kwargs): | |||
# TODO: use display units once implemented in Glue for ScatterViewer | |||
# units = u.Unit(viewer.state.x_display_unit) | |||
units = u.Unit(viewer.time_unit) | |||
else: | |||
else: # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's one way to improve coverage 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's my favorite way! (I just figured we didn't need coverage on simple input-errors, so might as well have that officially noted)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tests pass, nothing objectionable in the code. Nice to simplify the parser.
This PR increases overall test coverage from 85.65% to 92.95% (and simplifies some logic in the light curve parser).
NOTE: uncovered lines in
events.py
andtemplate_mixin.py
are scheduled to be moved upstream by #35 and #36, respectively, which should then increase percent coverage even further.