pySTEPS / pysteps

Python framework for short-term ensemble prediction systems.
https://pysteps.github.io/
BSD 3-Clause "New" or "Revised" License
471 stars 168 forks source link

Support for custom colormap in `precipfield.py` and `plot_custom_precipitation_range.py` example #433

Closed rutkovskii closed 2 months ago

rutkovskii commented 2 months ago

[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 to create a custom config and use it for plotting.

Note: As mentioned, it should work with depth, but I have not verified it.

430

dnerini commented 2 months ago

Hi there, thanks for the reminder. I'll try to have a close look today, I don't expect any major issue.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 21.73913% with 18 lines in your changes missing coverage. Please review.

Project coverage is 83.89%. Comparing base (ee60fa6) to head (a12df02). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pysteps/visualization/precipfields.py 21.73% 18 Missing :warning:
Additional details and impacted files ```diff @@ 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 ``` | [Flag](https://app.codecov.io/gh/pySTEPS/pysteps/pull/433/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pySTEPS) | Coverage Δ | | |---|---|---| | [unit_tests](https://app.codecov.io/gh/pySTEPS/pysteps/pull/433/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pySTEPS) | `83.89% <21.73%> (-0.11%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pySTEPS#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rutkovskii commented 2 months ago

@dnerini I made the change. You can merge as you are the authorized user.