-
Notifications
You must be signed in to change notification settings - Fork 169
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 for custom colormap in precipfield.py
and plot_custom_precipitation_range.py
example
#433
Support for custom colormap in precipfield.py
and plot_custom_precipitation_range.py
example
#433
Conversation
…d.py` This update allows user-defined ranges and colors for plots. It supports intensity (tested) and depth (untested), but not probability. [ADD] Add `plot_custom_precipitation_range.py` example demonstrating how to create a custom config and use it for plotting.
Hi there, thanks for the reminder. I'll try to have a close look today, I don't expect any major issue. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #433 +/- ##
==========================================
- Coverage 84.00% 83.89% -0.11%
==========================================
Files 160 160
Lines 12882 12900 +18
==========================================
+ Hits 10821 10822 +1
- Misses 2061 2078 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
@rutkovskii thanks for your contribution! I very much appreciated the clean implementation and the effort in adding a clear example of this new feature, way to go!
Please just remove the final line from the example when you save the figure, and then we'll be ready to merge!
|
||
|
||
############################################################################### | ||
# Download the data if it is not available |
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.
We usually do not include the code for downloading the example data in the other examples, since the data are downloaded before running the example codes, but I'm OK with leaving this snippet ;-)
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.
Sounds good, I'll keep it as is. My thought process was that the data erequires a manual download, so providing a way for users to quickly see how the plotting works in case they do not have it loaded.
Is the data included in the installation of the library via pip?
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.
no, the data are not part of the actual package, but we provides some tools to get them (as the functions you used), see https://pysteps.readthedocs.io/en/stable/user_guide/example_data.html
@dnerini I made the change. You can merge as you are the authorized user. |
[MODIFY] Add support for custom colormap configuration in
precipfield.py
This update allows user-defined ranges and colors for plots. It supports
intensity (tested) and depth (untested), but not probability. A private
function was added to validate the colormap provided by the user.
[ADD] Add
plot_custom_precipitation_range.py
example demonstrating how tocreate a custom config and use it for plotting.
Note: As mentioned, it should work with depth, but I have not verified it.
#430