-
-
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
Support Astropy Quantity as radius arg for Registry SkyCoord Spatial constraint #594
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #594 +/- ##
==========================================
+ Coverage 81.46% 81.47% +0.01%
==========================================
Files 68 68
Lines 7034 7039 +5
==========================================
+ Hits 5730 5735 +5
Misses 1304 1304 ☔ View full report in Codecov by Sentry. |
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.
Please update the error message as e.g. degree works there just as well as radians.
@@ -719,9 +719,16 @@ def tomoc(s): | |||
|
|||
elif len(geom_spec) == 2: | |||
if isinstance(geom_spec[0], SkyCoord): | |||
# If radius given is astropy quantity, then convert to degrees |
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.
Please add this case to the docstring, and possibly an example to the narrative docs
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.
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.
Re narrative docs: There is value to list the expected outputs, so I'll add those to your example, as well as will remove the IGNORE_OUTPUT, as we use that only for cases where results are expected to chang often or are unpredictable.
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.
(ahh, never mind, I see that we already have that in the previous example)
I'll look into the (unrelated) CI failure separately. In the meantime, would you mind squashing the commits a bit to remove the incremental convergence done in the last ~4? (you can also run test locally either using the same tox commands the CI does, or by running |
Ahh does PyVO not usually squash PR commits at merge time? I'm admittedly reckless when it comes to my commits due to the assumption they'll get squashed anyways when it gets accepted. I'll clean up the commit history now! |
b69fd3a
to
d70d9bc
Compare
No, we assume nice logical chunks for commits 😅. It takes some time to get used to, but comes second nature soon enough. (and given that we have large PRs, I find it useful to have them merged in in a manageable sequence into So TL;DR: no need to squash down to 1 commit, but limit the one-liner CI wrangler ones once a PR is ready for review/merge. |
0da3232
to
13e4abe
Compare
Thank you @duytnguyendtn! |
Having a look at this, we can interpret this PR as a bugfix, as quantities should have been supported already. So I'll remilestone, which will also help the jdaviz folks. |
Support Astropy Quantity as radius arg for Registry SkyCoord Spatial constraint
Hi PyVO maintainers!
This PR adds a small quality of life improvement to the Spatial registry constraint, to allow an astropy quantity to be provided for the radius argument. Was implementing this downstream in Jdaviz, but figured it would be broadly useful here as well?
I've added a simple test to verify the unit conversion back to degrees, as well as testing for invalid units.
I'll add a changelog entry once a PR number is assigned.
Thanks!
Duy