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

Adding minor tests to test_regtap #427

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

msdemlei
Copy link
Contributor

@msdemlei msdemlei commented Feb 22, 2023

(in an attempt to tackle #425).

closes #425

@msdemlei msdemlei force-pushed the improve-regtap-test-coverage branch from bdbe4b2 to bdbe74a Compare April 26, 2023 12:09
@msdemlei msdemlei changed the title [DRAFT] Adding minor tests to test_regtap. Adding minor tests to test_regtap Apr 26, 2023
@msdemlei msdemlei force-pushed the improve-regtap-test-coverage branch from bdbe74a to 94a0524 Compare April 26, 2023 12:15
@msdemlei
Copy link
Contributor Author

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.

@msdemlei msdemlei force-pushed the improve-regtap-test-coverage branch from 94a0524 to cb425f5 Compare April 26, 2023 13:03
@codecov
Copy link

codecov bot commented Apr 26, 2023

Codecov Report

Merging #427 (352ac15) into main (a897483) will increase coverage by 0.13%.
The diff coverage is 87.50%.

@@            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     
Impacted Files Coverage Δ
pyvo/registry/regtap.py 82.82% <87.50%> (+3.05%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bsipocz bsipocz added this to the v1.5 milestone Apr 26, 2023
Copy link
Member

@bsipocz bsipocz left a 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!

Copy link
Member

@bsipocz bsipocz left a 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.

return float(self.get("region_of_regard", 0))
# we get NULLs as NaNs here
val = self["region_of_regard"]
if val != val:
Copy link
Member

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.nans, 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.
@msdemlei msdemlei force-pushed the improve-regtap-test-coverage branch from cb425f5 to 352ac15 Compare April 27, 2023 06:19
@msdemlei
Copy link
Contributor Author

msdemlei commented Apr 27, 2023 via email

@bsipocz
Copy link
Member

bsipocz commented Apr 27, 2023

I had wanted to avoid another import

numpy is practically imported at that point with astropy

@bsipocz bsipocz merged commit b3f3525 into astropy:main Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAINT: improve test coverage of regtap
2 participants