-
-
Notifications
You must be signed in to change notification settings - Fork 49
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 plotting to use pixel_edges instead of pixel_values #176
Conversation
Thanks for the pull request @yashrsharma44! Everything looks great! |
Note that this PR will pass all the tests for SunPy >= 1.0, so some tests have been modified to be run in SunPy >= 1.0. |
Codecov Report
@@ Coverage Diff @@
## master #176 +/- ##
==========================================
- Coverage 94.65% 94.63% -0.02%
==========================================
Files 19 19
Lines 2264 2275 +11
==========================================
+ Hits 2143 2153 +10
- Misses 121 122 +1
Continue to review full report at Codecov.
|
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-07-31 15:41:29 UTC |
Tasks left if all the tests pass -
|
Hi @yashrsharma44. What's the status of this PR? |
The idea of working of plotting in |
OK, what are the issues in |
0760c42
to
8f0da6e
Compare
@@ -195,3 +196,59 @@ def _get_dimension_for_pixel(axis_length, edges): | |||
False stands for pixel_value, while True stands for pixel_edge | |||
""" | |||
return axis_length+1 if edges else axis_length | |||
|
|||
def _get_extra_coord_edges(value, axis=-1): |
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.
Maybe the name of the function can be changed to some appropriate one :P
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.
If you are looking for suggested name change how about _infer_linear_extra_coord_edges
?
Tasks to follow -
|
1. Now if the `axes_coordinates` is None, or a `str`, it converts the `pixel_values` generated into `pixel_edges`. 2. User defined `axes_coordinates` are not touched, as now we need to document somewhere that input should be `pixel_edges` not `pixel_values`.
…aaray`. 1. Now the `pixel_edges` can be calculated for a given `ndarray` along a given axis.
…nges of plotting for SunPy.
d6a39fd
to
3639eb0
Compare
So currently, plotting with argument |
That's great progress @yashrsharma44. When you say |
When the |
OK. Let's make dealing with So what is left to do in this PR? |
Documentation about the plotting, everything else should be working fine after #PR 3283 is merged. |
ndcube/tests/test_plotting.py
Outdated
@@ -1,102 +1,107 @@ | |||
# -*- coding: utf-8 -*- | |||
# -*- coding: utf-8 -*-# -*- coding: utf-8 -*- |
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.
What does this do?
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.
My bad, it got uncommented twice.
There are a lot of tests commented out. Should they not be uncommented before merging and fixed if necessary. If this is not desired can you explain why? |
b61aac8
to
21eb3ea
Compare
Hey @DanRyanIrish , the tests that you observed |
ndcube/utils/cube.py
Outdated
|
||
# Checks for corner cases | ||
if value is None: | ||
return value |
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 comment still isn't address. Just delete the above two lines for code.
@@ -195,3 +196,59 @@ def _get_dimension_for_pixel(axis_length, edges): | |||
False stands for pixel_value, while True stands for pixel_edge | |||
""" | |||
return axis_length+1 if edges else axis_length | |||
|
|||
def _get_extra_coord_edges(value, axis=-1): |
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.
If you are looking for suggested name change how about _infer_linear_extra_coord_edges
?
Apart from the above reminder to delete a couple lines, I am happy with this so long as it passes the sunpy dev tests. It's up to you whether you want to actually change the name of Although passing the dev tests will require sunpy PR #3283 to be merged, right? |
I guess the change of name of |
Yeah, it depends on PR #3283, so this is blocked on that. |
OK. Let's get that merged then. I think it will be ready once you address those few outstanding comments. |
Approved! Pending sunpy dev tests passing after the merging of sunpy PR sunpy/sunpy#3283 |
Well done @yashrsharma44!! |
This PR addresses the fix of using pixel_edges instead of pixel_values.
Partial fix #172
TODO:
Ping @DanRyanIrish