From 26d610abfba8e74ae6a359b4cc4e23648decfe46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20K=C3=B8nigslieb?= Date: Wed, 6 May 2026 13:45:01 +0000 Subject: [PATCH 1/8] set ens members to one, this is about 3x faster for a single forecast --- sunflow/forecast.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sunflow/forecast.py b/sunflow/forecast.py index 27eadf3..33827bd 100644 --- a/sunflow/forecast.py +++ b/sunflow/forecast.py @@ -90,6 +90,7 @@ def simple_advection_forecast( alpha=0.0, # No Gaussian noise on motion field norm beta=0.0, # No von Mises noise on motion field angle return_motion_field=False, + ens_members=1, # Single deterministic forecast (no ensemble) ) # Run probabilistic advection using the correct method name forecast = pa.maps_forecast(n_steps, ratio_data, motion_field) From d60e21c5aeb8950ff2411ccb6e5d1cabfc10e001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20K=C3=B8nigslieb?= Date: Wed, 6 May 2026 14:07:50 +0000 Subject: [PATCH 2/8] use ens member configurations --- sunflow/forecast.py | 3 ++- sunflow/main.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sunflow/forecast.py b/sunflow/forecast.py index 33827bd..62cf79c 100644 --- a/sunflow/forecast.py +++ b/sunflow/forecast.py @@ -65,6 +65,7 @@ def simple_advection_forecast( ratio_data: np.ndarray, motion_field: np.ndarray, n_steps: int, + ens_members: int ) -> np.ndarray: """Run a deterministic advection forecast on solar irradiance ratios. @@ -90,7 +91,7 @@ def simple_advection_forecast( alpha=0.0, # No Gaussian noise on motion field norm beta=0.0, # No von Mises noise on motion field angle return_motion_field=False, - ens_members=1, # Single deterministic forecast (no ensemble) + ens_members=ens_members, # Single deterministic forecast (no ensemble) ) # Run probabilistic advection using the correct method name forecast = pa.maps_forecast(n_steps, ratio_data, motion_field) diff --git a/sunflow/main.py b/sunflow/main.py index e7402b2..1f1651c 100644 --- a/sunflow/main.py +++ b/sunflow/main.py @@ -273,7 +273,7 @@ def run_nowcast( # Simple forecast (ratio forecast) ratio_forecast = simple_advection_forecast( - ratio_data, motion_field, nowcast_config.future_steps + ratio_data, motion_field, nowcast_config.future_steps, ens_members=nowcast_config.ens_members ) # Generate previous day time steps for clearsky lookup From 27639589a094e158b7eb2823dab700a22ef222dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20K=C3=B8nigslieb?= Date: Wed, 6 May 2026 14:09:17 +0000 Subject: [PATCH 3/8] remove non relevant comment --- sunflow/forecast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sunflow/forecast.py b/sunflow/forecast.py index 62cf79c..11787a2 100644 --- a/sunflow/forecast.py +++ b/sunflow/forecast.py @@ -91,7 +91,7 @@ def simple_advection_forecast( alpha=0.0, # No Gaussian noise on motion field norm beta=0.0, # No von Mises noise on motion field angle return_motion_field=False, - ens_members=ens_members, # Single deterministic forecast (no ensemble) + ens_members=ens_members, ) # Run probabilistic advection using the correct method name forecast = pa.maps_forecast(n_steps, ratio_data, motion_field) From 77d9530e60f7fd5ebdb0bb60f1ee1f39dea48fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20K=C3=B8nigslieb?= Date: Thu, 7 May 2026 09:14:19 +0000 Subject: [PATCH 4/8] lint --- sunflow/forecast.py | 5 +---- sunflow/main.py | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sunflow/forecast.py b/sunflow/forecast.py index 11787a2..3abe325 100644 --- a/sunflow/forecast.py +++ b/sunflow/forecast.py @@ -62,10 +62,7 @@ def preprocess_data( def simple_advection_forecast( - ratio_data: np.ndarray, - motion_field: np.ndarray, - n_steps: int, - ens_members: int + ratio_data: np.ndarray, motion_field: np.ndarray, n_steps: int, ens_members: int ) -> np.ndarray: """Run a deterministic advection forecast on solar irradiance ratios. diff --git a/sunflow/main.py b/sunflow/main.py index 1f1651c..5ac6f63 100644 --- a/sunflow/main.py +++ b/sunflow/main.py @@ -273,7 +273,10 @@ def run_nowcast( # Simple forecast (ratio forecast) ratio_forecast = simple_advection_forecast( - ratio_data, motion_field, nowcast_config.future_steps, ens_members=nowcast_config.ens_members + ratio_data, + motion_field, + nowcast_config.future_steps, + ens_members=nowcast_config.ens_members, ) # Generate previous day time steps for clearsky lookup From 744abd62dbc1c0d32e8de3d7feb233b3b4ca7b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20K=C3=B8nigslieb?= Date: Thu, 7 May 2026 12:41:13 +0000 Subject: [PATCH 5/8] add a changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1174b3f..a0ca24b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case. ## [v1.1.0] From 3ade75d2ee768f689c870535e8064775872fe921 Mon Sep 17 00:00:00 2001 From: KristianHMoller <150110122+KristianHMoller@users.noreply.github.com> Date: Thu, 7 May 2026 15:30:20 +0200 Subject: [PATCH 6/8] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ca24b..6294c6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +### Changed + - Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case. ## [v1.1.0] From c2c3a4783995a41da14c00288310486b2e557190 Mon Sep 17 00:00:00 2001 From: KristianHMoller <150110122+KristianHMoller@users.noreply.github.com> Date: Thu, 7 May 2026 15:30:30 +0200 Subject: [PATCH 7/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6294c6b..58153dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case. +- Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case [!12](https://github.com/dmidk/sunflow/pull/12), @JoachimKoenigslieb ## [v1.1.0] From 98ecc80618be2222bf59454b63f373cd3a5ed771 Mon Sep 17 00:00:00 2001 From: KristianHMoller <150110122+KristianHMoller@users.noreply.github.com> Date: Thu, 7 May 2026 15:34:45 +0200 Subject: [PATCH 8/8] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58153dc..f33a333 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case [!12](https://github.com/dmidk/sunflow/pull/12), @JoachimKoenigslieb +- Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case [!12](https://github.com/dmidk/sunflow/pull/12), @JoachimKoenigslieb ## [v1.1.0]