Skip to content

Side by side animations#155

Open
cosunae wants to merge 33 commits into
mainfrom
animation_speed
Open

Side by side animations#155
cosunae wants to merge 33 commits into
mainfrom
animation_speed

Conversation

@cosunae
Copy link
Copy Markdown
Contributor

@cosunae cosunae commented May 18, 2026

Allows to generate side by side animations.

The animations config (based on #144 ) allows to set the animation speed and the two panesl of the comparison (refering by label)

showcase:
  params:
    - T_2M
    - SP_10M
    - TOT_PREC
  meteograms:
    enabled: false
    stations: [JUN]
  animations:
    enabled: true
    domains:
      - europe
      - switzerland
      - globe
    speed: 10  # simulated hours per second
    runs:
      - Varda-Single
    comparisons:
      - left: Varda-Single
        right: KENDA-CH1

This PR implements the following functionality:

  • label all data (nested forecaster of the interpolator didnt have previously a label), experiments, baselines and truth
  • add a plot_zarr_frame to support the plot generation of baselines and truth

This PR implements the following config syntax:

  • include statement in the yaml, to avoid config duplication (having to maintain showcases and dashboards in the same config)
  • runs identify the labels that will be used for animation (single panel) animation
  • comparisons: identify the two labels that will be configured in the side by side comparison
  • speed: animation speed as hourly simulated frames per second

TO BE MERGED AFTER #144

Louis-Frey and others added 30 commits April 22, 2026 09:05
Co-authored-by: Francesco Zanetta <62377868+frazane@users.noreply.github.com>
Co-authored-by: Michele Cattaneo <44707621+MicheleCattaneo@users.noreply.github.com>
Co-authored-by: Hugues de Laroussilhe <hugues.delaroussilhe@meteoswiss.ch>
Co-authored-by: Daniele Nerini <daniele.nerini@meteoswiss.ch>
Co-authored-by: Daniele Nerini <daniele.nerini@meteoswiss.ch>
@cosunae cosunae marked this pull request as draft May 18, 2026 09:51
@cosunae cosunae changed the title Animation speed Side by side animations May 18, 2026
@cosunae cosunae marked this pull request as ready for review May 18, 2026 13:25
Copy link
Copy Markdown
Contributor

@frazane frazane left a comment

Choose a reason for hiding this comment

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

Minor details. Looks very nice! Would you mind documenting somewhere your approach for wildcard constraints?

Comment thread src/data_input/__init__.py Outdated
}
tot_prec_string = "TOT_PREC_6H" if min(np.diff(steps)) == 6 else "TOT_PREC_1H"
_diffs = np.diff(steps)
tot_prec_string = "TOT_PREC_6H" if len(_diffs) > 0 and min(_diffs) == 6 else "TOT_PREC_1H"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we add a comment explaining why we have to do this?

Comment thread src/evalml/cli.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice addition! I would add some tests for this since it can easily run in the GitHub CI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added some tests:
a291c59

I also added a load_yaml test (with the include),
since this is writing a sample file, I am not sure this is what we should be doing in the unit tests, other if you have another idea to test it @frazane ?

https://github.com/MeteoSwiss/evalml/pull/155/changes#diff-217a439192bc495c66132a58a1bf7a92ee70f0eb9702c6b00f60644e726479b5R23

Comment thread src/plotting/compat.py
return state


def load_state_from_zarr(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it make sense to wait for #153 and read from GRIB files directly?

Copy link
Copy Markdown
Contributor Author

@cosunae cosunae May 19, 2026

Choose a reason for hiding this comment

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

Yes, I thought so, but unfortunately the truth seems to stay in zarr, so I am assuming we need it still to be able to plot the truth?

https://github.com/MeteoSwiss/evalml/pull/153/changes#diff-c0f704baca2ade5ded6448745abbb4de19d01d0f2a7213b0c119fef7679c6cb7R44

Comment thread workflow/rules/plot.smk
"""


rule make_zarr_animation:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rule name should start with module name, see https://github.com/MeteoSwiss/evalml#workflow-development-guidelines

Comment thread workflow/rules/plot.smk
return [f"{i:03}" for i in range(start, total + 1, step)]


rule plot_zarr_frame:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Logging is missing.

Comment thread workflow/rules/plot.smk
"""


rule make_comparison_animation:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rule name does not follow guidelines, logging is missing.

Base automatically changed from general_meteogram to main May 22, 2026 07:53
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