-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Fixes the bug associated with axes_coordinates #189
Conversation
Thanks for the pull request @yashrsharma44! I am a bot that checks pull requests for milestones and changelog entries. If you have any questions about what I am saying, please ask!
If there are any issues with this message, please report them here. |
Hello @yashrsharma44! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-08-07 20:03:30 UTC |
62293ed
to
6e318ab
Compare
1. Make sure the axes_coordinates for >2D plot contains no external values if axes_coordinate=0 along plot_axis_indices. This makes sure that axes_coordinates is a list of None. 2. Edited `_derive_axes_coordinates` to calculate the values for independent and dependent axes. If dependent axes, then the values are downscaled to the data_shape along the axis. 3. Added the support for getting `edges` in `_derive_axes_coordinates` .
6e318ab
to
81f8c04
Compare
ndcube/mixins/plotting.py
Outdated
axis_label_text = self.world_axis_physical_types[i] | ||
|
||
index = utils.wcs.get_dependent_data_axes(self.wcs, i, self.missing_axes) | ||
reduce_axis = np.where(index == np.array(i))[0] |
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 don't think it's necessary to wrap i
into a numpy array...?
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.
Sure, it was more of a defensive approach, would change it!
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.
Yeah, now I remember, since index
is a numpy array, so for comparing the same objects, I have to convert i
into a numpy array.
Work to be done -
Also Ping @DanRyanIrish for the changes. |
…ame dimension as of self.data
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.
…d added the support for axis labels in 3D plotting
Regarding the docstrings, I was thinking of adding a line explaining the type of |
No need to say |
Currently, we don't support getting |
Don't we? Isn't that the role of |
Okay, I guess I didn't understand that. Yeah, for |
That's fine. Since the API is only for the user to enter the name of the |
So add the fact that users can supply a string in |
I was thinking of adding this as a docstring for
|
I guess the |
How about:
Does that make sense? |
Yes, only the sunpy_dev test has to pass. |
And yes, once the |
Thanks @DanRyanIrish |
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 noticed that this PR does not seem to handle extra_coord str entries to axes_coordinates correctly. Instead of holding up this PR, can you create an issue saying extra_coord axes_coordinates support must be extended to NDCubeSequence?
ndcube/mixins/sequence_plotting.py
Outdated
@@ -691,6 +697,8 @@ class ImageAnimatorNDCubeSequence(ImageAnimatorWCS): | |||
for that axis. | |||
The physical coordinates expected by axis_ranges should be an array of | |||
pixel_edges. | |||
A str entry in axis_ranges signifies that an extra_coord will be used for the axis's coordinates. | |||
The str must be a valid name of an extra_coord that corresponds to the same axis to which it is applied in the plot. |
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 str API is not valid for animator objects. Only for the NDCube
and NDCubeSequence
objects.
ndcube/mixins/sequence_plotting.py
Outdated
@@ -788,6 +796,8 @@ class ImageAnimatorCubeLikeNDCubeSequence(ImageAnimatorWCS): | |||
for that axis. | |||
The physical coordinates expected by axis_ranges should be an array of | |||
pixel_edges. | |||
A str entry in axis_ranges signifies that an extra_coord will be used for the axis's coordinates. | |||
The str must be a valid name of an extra_coord that corresponds to the same axis to which it is applied in the plot. |
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.
Same as above. The str API is not valid for animator objects. The extra coord edges must be derived before entering them into the animator objects.
ndcube/mixins/sequence_plotting.py
Outdated
@@ -907,6 +917,8 @@ class LineAnimatorNDCubeSequence(LineAnimator): | |||
for that axis. | |||
The physical coordinates expected by axis_ranges should be an array of | |||
pixel_edges. | |||
A str entry in axis_ranges signifies that an extra_coord will be used for the axis's coordinates. | |||
The str must be a valid name of an extra_coord that corresponds to the same axis to which it is applied in the plot. |
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.
Same as above.
ndcube/mixins/sequence_plotting.py
Outdated
@@ -1143,6 +1155,8 @@ class LineAnimatorCubeLikeNDCubeSequence(LineAnimator): | |||
for that axis. | |||
The physical coordinates expected by axis_ranges should be an array of | |||
pixel_edges. | |||
A str entry in axis_ranges signifies that an extra_coord will be used for the axis's coordinates. | |||
The str must be a valid name of an extra_coord that corresponds to the same axis to which it is applied in the plot. |
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.
Same as above
I guess I am not clear with the comment above. Are you saying that |
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 think my comment may have just muddied the waters. I will withdraw it and if we as users discover any future issues with sequence plotting, they can be handled in a new PR. I think it shouldn't hold up this PR.
This PR addresses the bug associated with
axes_coordinates
.This PR addresses the following problems -
axes_coordinate=None
along plot_axis_indices. This makes sure thataxes_coordinates
is a list of None._derive_axes_coordinates
to calculate the values for independent and dependent axes. If dependent axes, then the values are downscaled to the data_shape along the axis by taking mean along non-plotting axes.edges
in_derive_axes_coordinates
.Partially fixes #187
Ping @DanRyanIrish
Note that this PR should be merged after #176 is merged.