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
add .cmap and .norm property to plot_settings #3624
Conversation
Thanks for the pull request @sashank27! Everything looks great! |
Hello @sashank27! 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 2020-02-12 18:08:38 UTC |
568f640
to
319a781
Compare
@dstansby @Cadair @nabobalis please review this |
I'll review it later this week but it seems you have broken some of the tests with the init changes:
The other test fails seem to be fixed in master, so you might want to merge in master. |
e98316f
to
9621967
Compare
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.
Thanks for working on this @sashank27! I've left quite a few comments, but many of them are duplicates and quick changes. The biggest change is the logic around plot_settings
in __init__
.
The composite map and mapsequence code also have some plot_settings
logic that needs to be addressed. The former is what is causing the doc build failure.
1104c2a
to
9e1ac81
Compare
9e1ac81
to
2c67f1e
Compare
642fb8a
to
bd20c4a
Compare
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.
After thinking about it a bit more, I think the property-setter approach for plot_settings
is not the right way to proceed. It just overcomplicates things. I've added several notes where appropriate. I know this goes back on what I said before and I'm sorry for the confusion. Thanks for your patience! 😁
Also, I noticed that you removed all your changes to the examples? I think the examples should reflect the preferred way of setting the norm
and cmap
which is now through the respective properties rather than plot_settings
. If you'd rather not include those changes here, we can always offload that to a separate issue/PR.
@wtbarnes I was thinking to update all the examples on a separate PR, as this already has a lot of changes |
2b4ffee
to
c40e9f6
Compare
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.
A few very minor changes
That's completely fine, but it looks like (at least) one of the examples is causing the docs build to fail. Could you try to build the examples locally and fix up the ones that fail? Others can be left to separate PR. |
Well, previously this was the issue. I had to update all the examples to make the build pass. |
1a5e83c
to
dd4cfdc
Compare
Ok so the docs build is failing because one of the examples is constructing the color map name incorrectly. The reason is because the observatory name (SDO in this case) is being excluded when creating the new header. If you pass the additional keyword argument
I think this should fix the problem. Previously, this was not raising an exception because we were not validating the colormap when creating the Map and it was later being overridden by the old |
dd4cfdc
to
9a9effd
Compare
2c5cb11
to
16c415e
Compare
Everything looks good to me, but something weird is happening with one of the examples and is causing the docs build to fail. For some reason, it is trying to smash together "stereo a" and "aia 171" as the color map name and then failing because that is not a valid color map name (obviously 😆 ) |
Thanks @sashank27. One more approval and we'll be good to go. I'm a bit concerned by why that change in the ordering of the maps was needed...Have the filenames changed that caused the ordering to be swapped? Or perhaps there's something strange going on in the factory? Either way, it is unrelated to this PR. |
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.
Thanks so much for all your work on this @sashank27
I am sorry to have a few more things to change, but this is a pretty major change to one of the older bits of the code.
5843c18
to
ccfd6e3
Compare
I worry that there are additional use cases for However, during the dev meeting, we didn't see any plot settings would conceivably be used in this way by a user, aside from maybe interpolation. |
hey @sashank27 Thank you so much for working on this. We chatted about it today at the community meeting, and generally we all struggled to remember why we wanted to make this change in the first place, and we wanted to stop and think about it in terms of the future changes to Map (i.e. integration with ndcube). Therefore we are going to put this on the agenda for the SunPy Coordination meeting at the end of March, and talk about it with all the other things relating to Map. Sorry that we don't feel like we can just accept this as it is, the code is great and thank you very much for all your effort on it. |
With the decision in #3415 (comment) I will be closing this PR as I believe the new change probably needs to be done from scratch (especially with all the file conflicts). I want to thank you @sashank27 for the effort you put into this PR and I am sorry it was never merged due to us being undecided on the new formal API for this change. |
Description
Replaces up
plot_settings
insunpy.map.mapbase
, and adds up.cmap
and.norm
so as to provide for a cleaner and usable API.Fixes #3415
Fixes #3713