Skip to content

Conversation

mathomp4
Copy link
Member

As found by @michellefrazer, she had plots with names like:

GCMv12rc12_GCMv12rc12_stats2_hght_rmscmp_AMPLITUDE_EUR_z_JUL-AUG-SEP-OCT

But when movestat ran, on polar things were in folders like OCT.

The issue is that the script assumed things would always be in three-letter "seasons". This PR makes a change so that the "season" is everything after the last underscore. So instead of OCT it is JUL-AUG-SEP-OCT.

NOTE: This has been tested by @michellefrazer, but it should probably be tested in experiments with a single-month "season".

@mathomp4 mathomp4 added 0 diff The changes in this pull request have verified to be zero-diff with the target branch. bugfix labels Mar 17, 2025
@mathomp4 mathomp4 self-assigned this Mar 17, 2025
@mathomp4 mathomp4 requested review from a team as code owners March 17, 2025 15:52
@sdrabenh sdrabenh merged commit f73ed40 into main Apr 15, 2025
4 checks passed
@sdrabenh sdrabenh deleted the bugfix/movestat-fix branch April 15, 2025 17:41
@michellefrazer
Copy link

@mathomp4 I'm having a new related issue where movestat is interpreting seasons wrong again.

With names like GenCast-FP-1.0deg-e1_GenCast-FP-1.0deg-e1_stats_uwnd_corcmp_GLO_z_MAY.gif, the season is interpreted as P-1.
With names like GenCast_FP_1.0deg_e1_GenCast_FP_1.0deg_e1_stats_uwnd_corcmp_GLO_z_MAY.gif, the season is interpreted as P_1.

This PR was supposed to make the "season" everything after the last underscore, but it appears that somehow it is actually looking for a 3-character string before the first period.

I can of course avoid periods in my experiment names in future, but I'm wondering if the code should be changed to focus on the underscore instead of the period? Or look for the last period instead of the first one?

Thanks!

@mathomp4
Copy link
Member Author

mathomp4 commented Jun 3, 2025

@michellefrazer After yelling at ChatGPT for a while, I might have something that works:

❯ echo "GenCast-FP-1.0deg-e1_GenCast-FP-1.0deg-e1_stats_uwnd_corcmp_GLO_z_MAY.gif" | sed 's/.*_\([^_][^_]*\)\.[^.][^.]*$/\1/'
MAY
❯ echo "GenCast_FP_1.0deg_e1_GenCast_FP_1.0deg_e1_stats_uwnd_corcmp_GLO_z_MAY.gif" | sed 's/.*_\([^_][^_]*\)\.[^.][^.]*$/\1/'
MAY
❯ echo "GCMv12rc12_GCMv12rc12_stats2_hght_rmscmp_AMPLITUDE_EUR_z_JUL-AUG-SEP-OCT.gif" | sed 's/.*_\([^_][^_]*\)\.[^.][^.]*$/\1/'
JUL-AUG-SEP-OCT

Can you look at #141 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch. bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants