-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Implement compound regions #26
Conversation
This also changes the API as discussed in #25 |
I would merge this and add further functionality in future PRs. Comments? |
@@ -29,16 +29,21 @@ class CompoundSkyRegion(SkyRegion): | |||
Represents the logical combination of two regions in sky coordinates. | |||
""" | |||
|
|||
def __init__(self, region1, operator, region2): | |||
def __init__(self, region1, region2, operator): |
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.
The reason I had operator in the center is because it makes it clearer how to deal with non-symmetric cases (e.g. region 1 without region 2)
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 bug (e.g. https://github.com/astropy/regions/blob/master/regions/core/core.py#L67) . It was just easier to change this line instead of all the others .. Do you need the operator in the middle?
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.
Ah I see - I personally think it would make it more readable, but up to you :)
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 more the RPN guy, you know 😉
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.
😆
@joleroi - that sounds fine. I have just one comment above at the moment. I think we will need some additional operators (for example the equivalent of |
Indeed, |
contains
I don't know how to deal with
area
,make_patch
etc.