-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor plot rule and add interactivity #54
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
Conversation
Also use marimo for interactive editing
| state["fields"]["10u"] ** 2 + state["fields"]["10v"] ** 2 | ||
| ) | ||
| elif param == "2t": | ||
| field = state["fields"][param] - 273.15 |
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.
could add 2d too I guess if the objective is to have temperature in degrees C
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.
let's move this comment to the main PR #50
| ) | ||
| subplot = fig.add_map(row=0, column=0) | ||
|
|
||
| if param == "uv": |
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.
if param is uv we return the wind speed? maybe we could use sp10 or wind_speed or something more intuitive
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.
let's move this comment to the main PR #50
* 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>
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.