-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: add intersect modes for registry.Spatial constraint #495
feat: add intersect modes for registry.Spatial constraint #495
Conversation
0c2874f
to
a324432
Compare
For the record, I like this as-is (added value: it's a nice demo of why we want constraint classes rather than simple keywords). Thanks! Let me know when you'd like a review. |
a324432
to
323f13f
Compare
Thanks, I'm ready for the review, but the failing test is not something I changed. Maybe linked to this PR in astropy? If I can give feedback on the constraints, I like that they are classes a lot, however their names are a bit confusing ( |
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.
Looks good to me (and the changelog failure indeed seems unrelated).
Thanks!
Indeed, I haven't yet follow-ed up those astropy changes in pyvo. Opening a separate PR for it. |
fyi: the changelog check was failed as the milestone wasn't yet set. I'll think about a solution of how to make that check more flexible. |
20adc21
to
87f1ff3
Compare
Codecov Report
@@ Coverage Diff @@
## main #495 +/- ##
=======================================
Coverage 80.07% 80.08%
=======================================
Files 52 52
Lines 6059 6071 +12
=======================================
+ Hits 4852 4862 +10
- Misses 1207 1209 +2
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
the three modes are 'covers' that keeps the previous behavior, 'enclosed' for services covering the given region and 'overlaps' for services intersecting with the region
87f1ff3
to
6636d13
Compare
Thank you @ManonMarchand! |
_extra_tables = ["rr.stc_spatial"] | ||
|
||
takes_sequence = True | ||
|
||
def __init__(self, geom_spec, order=6): | ||
def __init__(self, geom_spec, intersect="covers", order=6): |
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.
This added an unnoticed backward incompatible API change. I'll open a PR to remedy this before rolling out v1.5, and ultimately #507 will address any similar future issues.
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.
Oops sorry
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 sorry, this should be something to spot during the review. But again, a prime example of why I'm pushing for #507 as we shouldn't really be catering for the sole usage of positional arguments for everything.
Hello pyvo,
What the PR does
It adds intersect modes for the constraint
registry.Spatial
.In practice, if I give the allsky MOC, it looks like this:
(former behavior, now default. Returns any service that contains allsky)
(new behavior, returns any service overlapping with allsky)
Why this API
I copied the SIA one
pyvo/pyvo/dal/sia.py
Line 74 in ad84a0e