Skip to content

Conversation

@dnerini
Copy link
Member

@dnerini dnerini commented Oct 3, 2025

I initially set out to try marimo for some interactive work on the plotting PR. But while working on it, I realized that the script was doing quite a lot: plotting maps for all parameters, lead times, and regions, then stitching everything into an animation. On top of that, it included plenty of boilerplate (creating folders, running subprocesses, …) which are essentially tasks that Snakemake is designed to handle for us.

So instead of just adding interactivity, I refactored the code to lean on Snakemake’s strengths. The result is hopefully a cleaner workflow that showcases how Snakemake can simplify orchestration, remove boilerplate, and make the pipeline easier to maintain and extend.

cosunae and others added 3 commits September 17, 2025 14:41
@dnerini dnerini marked this pull request as draft October 6, 2025 19:17
state["fields"]["10u"] ** 2 + state["fields"]["10v"] ** 2
)
elif param == "2t":
field = state["fields"][param] - 273.15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could add 2d too I guess if the objective is to have temperature in degrees C

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this comment to the main PR #50

)
subplot = fig.add_map(row=0, column=0)

if param == "uv":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if param is uv we return the wind speed? maybe we could use sp10 or wind_speed or something more intuitive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this comment to the main PR #50

@dnerini dnerini marked this pull request as ready for review October 8, 2025 20:41
@dnerini dnerini merged commit a6fcea6 into plotting Oct 8, 2025
@dnerini dnerini deleted the adopt-marimo branch October 8, 2025 20:46
frazane added a commit that referenced this pull request Nov 7, 2025
* lock

* add cartopy

* generate raw

* add plot rule

* fix init_time

* adding plotting files

* adding plotting files

* generate colormaps from NCL color table files

* split colormap configs for variables and colormap loader

* add tests for colormap_loader.py and colormap_defaults.py

* revert change commited accidentally

* fix typo

* fix imports for code and tests to fit the project's structure

* adapt plotting to earthkit-plots

* improve tests

* Refactor plot rule and adopt marimo (#54)

* Adopt more atomic approach

Also use marimo for interactive editing

* Move notebook to dedicated folder

* Remove original script

* Add example config

* Revert some wrong changes

* Fix paths

* Revert using separate folder for notebooks

* Specify individual showcases dates

* Switch to GRIB and fix projection issues (#60)

* Adopt more atomic approach

Also use marimo for interactive editing

* Move notebook to dedicated folder

* add plot rule

* Revert some wrong changes

* Solve bugs adopt grib

* Replace by plot_forecast_frame.py

* Rename

* Fix number of points cosmo 1e

* Remove globe because it doesn't seem right

* Add possibility to set region to none for global plots

* Review

* Update workflow/scripts/src/plotting.py

* Simplify code

* Set path to eccodes defintions

* Add Switzerland region to outputs

* Batch plot jobs in larger submissions

* Fix pre-commits

* Revert change in co1e config

* Parse steps

* Do not hardcode leadtimes

* Plot wind speed

I'm assuming the default colormap is in knots

* Showcase M-2 model

* Fix pre-commit

* Add global outputs to interpolator showcase

* Fix wrong inference config...

* Plot only candidate runs

* Add units to comment

* Revert changes to inference config

* Unify projections and regions in one object

* Remove debugging code...

* Add europe region to outputs

* Use modified colormap for wind

* Reduce figure size and quality

* Fix inputs to plot rule

* Debugging

* Add previous commit hash to interpolators

* Fix artefacts in plots

* Precommit

* Remove unwanted change

* Add lam boundaries

* add stratification to satisfy pydantic

* Update config/showcase.yaml

Co-authored-by: Jonas Bhend <jonasbhend@users.noreply.github.com>

* Fix creation of header

* Add plots for tp

* Fix tests

* Use ifs name 'si' for wind speed instead of 'sp'

* Dynamic delay for gif animations

* Update workflow/rules/plot.smk

Co-authored-by: Daniele Nerini <daniele.nerini@meteoswiss.ch>

* run pre-commit

* Adopt ICON names after fix in dea87ce

* Switch to main branch of anemoi-inference

* Pre-commit

---------

Co-authored-by: clairemerker <34312518+clairemerker@users.noreply.github.com>
Co-authored-by: Daniele Nerini <daniele.nerini@meteoswiss.ch>
Co-authored-by: Daniele Nerini <daniele.nerini@gmail.com>
Co-authored-by: Ophélia Miralles <opheliamiralles@gmail.com>
Co-authored-by: omiralles <ophelia.miralles@meteoswiss.ch>
Co-authored-by: Jonas Bhend <jonas.bhend@meteoswiss.ch>
Co-authored-by: Jonas Bhend <jonasbhend@users.noreply.github.com>
Co-authored-by: Francesco Zanetta <francesco.zanetta@meteoswiss.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants