Skip to content

Commit 92deda1

Browse files
sidekockmats-knmi
andauthored
Refactor steps in blending code (#453)
* Refactored all names in the steps blending code from old to new * Made some name changes but test still do not pass * Fixed naming changes, now the tests pass * Built the rough scaffolding for the blending class * Refactored untill no rain case * Added code to estimation of ar parameters of radar * Next go, start with forecast loop #7 * Added some uniformity between nowcast and blending steps. Now at # 8.4 for the refactoring * Small changes since prev commit * All code is tranfered. Last part of the main loop needs to be refactored * Everything is refactored, no test ran as of yet * Old forecast function is updated to fit newly refactored code * Removed old code which is no longer used * 6 more tests that fail * All tests pass, still need to fix TODOs * Updated gitignore * Cleanup of params and state dataclasses, next step: better typing * Cleanup of params and state dataclasses, now all tests pass * Added correct typing to all parts of params and state * Ready for pull request * Made changes for Codacy review * Added aditional tests which currently fail in master branch * Update .gitignore Co-authored-by: mats-knmi <145579783+mats-knmi@users.noreply.github.com> * Used the __zero_precip_time in __zero_precipitation_forecast() * Changed typing hints to python 3.10+ version * Added comments back to the State dataclass * Changed the self.__state.velocity_perturbations = [] to self.__params.velocity_perturbations = [] in __initialize_random_generators * Added code changes as suggested by Ruben, comments and documentation to come later * Added frozen functionality to dataclasses, removed reset_state and fixed seed assingments * Added frozen dataclass to nowcast * The needed checks are done for this TODO so it can be removed * Use the seed in all rng in blending code (#449) * Use seed for all rng to make a test run completely deterministic * fix probmatching test and some copy paste oversights * Add test for vel_pert_method * Change the test so that it actually runs the lines that need to be covered * Removed deepcopy of worker_state. The state is now accessable to all workers at the same time * Update to probmatching comments to keep in track with main * Fix for multithreading issue, this produces exactly the same results as the master * Added additional documentation * Bump version * Updates some files that do not pass the new black version * Updated examples to work with new black version --------- Co-authored-by: mats-knmi <145579783+mats-knmi@users.noreply.github.com>
1 parent a7dae54 commit 92deda1

13 files changed

+2908
-1961
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,7 @@ venv.bak/
9191

9292
# Mac OS Stuff
9393
.DS_Store
94+
95+
# Running local tests
96+
/tmp
97+
/pysteps/tests/tmp/

PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.2
22
Name: pysteps
3-
Version: 1.13.0
3+
Version: 1.14.0
44
Summary: Python framework for short-term ensemble prediction systems
55
Home-page: http://pypi.python.org/pypi/pysteps/
66
License: LICENSE

examples/advection_correction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
Advection correction is a temporal interpolation procedure that is often used
99
when estimating rainfall accumulations to correct for the shift of rainfall patterns
10-
between consecutive radar rainfall maps. This shift becomes particularly
10+
between consecutive radar rainfall maps. This shift becomes particularly
1111
significant for long radar scanning cycles and in presence of fast moving
1212
precipitation features.
1313

examples/plot_cascade_decomposition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Cascade decomposition
44
=====================
55
6-
This example script shows how to compute and plot the cascade decompositon of
6+
This example script shows how to compute and plot the cascade decompositon of
77
a single radar precipitation field in pysteps.
88
99
"""

examples/plot_ensemble_verification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Ensemble verification
44
=====================
55
6-
In this tutorial we perform a verification of a probabilistic extrapolation nowcast
6+
In this tutorial we perform a verification of a probabilistic extrapolation nowcast
77
using MeteoSwiss radar data.
88
99
"""

examples/plot_extrapolation_nowcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Extrapolation nowcast
44
=====================
55
6-
This tutorial shows how to compute and plot an extrapolation nowcast using
6+
This tutorial shows how to compute and plot an extrapolation nowcast using
77
Finnish radar data.
88
99
"""

examples/plot_optical_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Optical flow
33
============
44
5-
This tutorial offers a short overview of the optical flow routines available in
6-
pysteps and it will cover how to compute and plot the motion field from a
5+
This tutorial offers a short overview of the optical flow routines available in
6+
pysteps and it will cover how to compute and plot the motion field from a
77
sequence of radar images.
88
"""
99

0 commit comments

Comments
 (0)