-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Adding minor tests to test_regtap #427
Conversation
bdbe4b2
to
bdbe74a
Compare
bdbe74a
to
94a0524
Compare
I'd say this should now be ready (and sufficient to close #425); what's uncovered is tedious to cover when weighed against how much it'll actually be used. |
94a0524
to
cb425f5
Compare
Codecov Report
@@ Coverage Diff @@
## main #427 +/- ##
==========================================
+ Coverage 79.94% 80.07% +0.13%
==========================================
Files 52 52
Lines 6018 6023 +5
==========================================
+ Hits 4811 4823 +12
+ Misses 1207 1200 -7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Thank you for looking into this!
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.
Actually, there is one point where a more pythonic testing could be used, but I'm not fully aware of what actual input values we expect.
pyvo/registry/regtap.py
Outdated
return float(self.get("region_of_regard", 0)) | ||
# we get NULLs as NaNs here | ||
val = self["region_of_regard"] | ||
if val != val: |
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 not sure this is the best way to test for np.nan
s, or what other values would you expect here?
(e.g. np.isnan(val)
or np.isfinite(val)
is a cleaner check for NaNs)
(in an attempt to tackle astropy#425). This actually uncovered a bug in interpreting region_of_regard; since it now comes out of VOTables, NULL and NaN are the same thing (since nobody looks at region_of_regard, that certainly does not warrant a changelog entry) What is still uncovered is the deprecated ivoid2service, the obscure region_of_regard, and some tedious piece of I/O.
cb425f5
to
352ac15
Compare
On Wed, Apr 26, 2023 at 11:13:45AM -0700, Brigitta Sipőcz wrote:
@bsipocz requested changes on this pull request.
I'm not sure this is the best way to test for `np.nan`s, or what
other values would you expect here?
Yeah, it's (possibly) NaNs (the universal null value for floats in
VOTables, whether or not we like that). I had wanted to avoid
another import, and x!=x is a rather safe test for "you don't want to
confront normal user code with this" -- but yes, the intent is
clearer with numpy.isnan, so I've force-pushed a change to that
effect.
|
numpy is practically imported at that point with astropy |
(in an attempt to tackle #425).
closes #425