-
-
Notifications
You must be signed in to change notification settings - Fork 54
Properties giving order of types in inputs to NDCube.crop and crop_by_values 2 #868
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
base: main
Are you sure you want to change the base?
Conversation
Returns types and order of high-level coordinate objects that must be input to .crop() | ||
Each point given to .crop() must be a tuple of scalar high-level coordinate objects | ||
of these types, in this order. Note, however, that any of these can be replaced | ||
with None if cropping along the axis/axes of that world type in not desired. |
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.
First line of the docstring should be <80 char. Then a blank line, then a paragraph. (Same below)
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.
Also put code snippets in double backticks.
@property | ||
def crop_by_values_input_units_order(self): | ||
""" | ||
Returns units of inputs to .crop_by_values() and their required order. |
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.
Properties don't return they are.
Returns units of inputs to .crop_by_values() and their required order. | |
Units of inputs to ``.crop_by_values()`` and their required order. |
return tuple(v[0] for v in self.wcs.world_axis_object_classes.values()) | ||
|
||
@property | ||
def crop_by_values_input_units_order(self): |
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 much less convinced by the need for this property as we can just say "look at cube.wcs.world_axis_units" in the docstring of crop_by_values
we don't need this proxy.
@@ -1458,6 +1458,25 @@ def fill_masked(self, fill_value, uncertainty_fill_value=None, unmask=False, fil | |||
self.mask = False | |||
return None | |||
|
|||
@property | |||
def crop_input_types_order(self): |
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 really feels like it belongs on the WCS API (as world_classes_order
) or something.
I have opened a PR to astropy suggesting this property in the WCS API: astropy/astropy#18408 |
Inspired by discussions in #866
Re-creation of PR #867 due to messing up git history.