Skip to content

Implement more intuitive output filename labelling#1955

Open
ukmo-huw-lewis wants to merge 6 commits intomainfrom
1954-more-intuitive-output-plot-filenames
Open

Implement more intuitive output filename labelling#1955
ukmo-huw-lewis wants to merge 6 commits intomainfrom
1954-more-intuitive-output-plot-filenames

Conversation

@ukmo-huw-lewis
Copy link
Contributor

@ukmo-huw-lewis ukmo-huw-lewis commented Mar 6, 2026

associated tests

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Ensure rose-suite.conf.example has been updated if new diagnostic added.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@ukmo-huw-lewis ukmo-huw-lewis linked an issue Mar 6, 2026 that may be closed by this pull request
@ukmo-huw-lewis ukmo-huw-lewis changed the title First implementation of more intuitive output filename labelling and Implement more intuitive output filename labelling Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Coverage

@ukmo-huw-lewis ukmo-huw-lewis requested review from Sylviabohnenstengel, daflack and jfrost-mo and removed request for jfrost-mo March 6, 2026 17:30
@ukmo-huw-lewis
Copy link
Contributor Author

Marking as ready for review.

Updated tests illustrative of filename convention change introduced by proposed changes.

Note no updates to histogram or timeseries filename titles (see related Issue) introduced here yet. Can aim to implement as part of same Issue/PR, but flagging initial implementation for review at this stage.

Copy link
Collaborator

@daflack daflack left a comment

Choose a reason for hiding this comment

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

Initial review: happy with these changes and agree makes the file naming convection much more human readable. I'd suggest adding in the histogram and timeseries changes into this issue and PR as all related to filename changes to make more interpretable.

@ukmo-huw-lewis
Copy link
Contributor Author

ukmo-huw-lewis commented Mar 10, 2026

Updated code to add sequence information to all plot filenames and titles, now implemented consistently across histograms and timeseries also. Updates reflected in modified test_plot.py

Summary of changes:

Plot type Previous New
User-defined filename (non sequence-varying) ${user_plotname}.png ${user_plotname}.png
User-defined filename (sequence-varying e.g. by time) ${user_plotname}_${JulianDay}.png ${user_plotname}_${YYYYMMDDHHMMSS}.png
Histogram (all inputs) histogram_${varname}_0.png histogram_${varname}_${startdatetimestamp}_${enddatetimestamp}.png
Timeseries (all inputs) domain_mean_${varname}_time_series.png domain_mean_${varname}_time_series_${startdatetimestamp}_${enddatetimestamp}.png
Spatial plot (non sequence-varying e.g. time-mean) ${modelname}_${varname}_${mid-point_JulianDay}.png ${modelname}_${varname}_${startboundtimestamp}_${endboundtimestamp}.png
Spatial plot (sequence-varying e.g. by time) ${modelname}_${varname}_${JulianDay}.png ${modelname}_${varname}_${YYYYMMDDHHMMSS}.png
Vertical profile (non sequence-varying e.g. time-mean) domain_mean_${varname}_vertical_profile_mean_${mid-point_JulianDay}.png domain_mean_${varname}_vertical_profile_mean_${startdatetimestamp}_${enddatetimestamp}.png
Vertical profile (sequence-varying e.g. by time) domain_mean_${varname}_vertical_profile_mean_${JulianDay}.png domain_mean_${varname}_vertical_profile_mean_${YYYYMMDDHHMMSS}.png

Histogram examples (old | new) - extent of time window added in plot title
imageimage

Timeseries examples (old | new) - extent of time window added in plot title; note also removal of 'units' for time x-axis
imageimage

@ukmo-huw-lewis
Copy link
Contributor Author

Example workflow output with updated plot titles and filenames: https://wwwspice/~huw.lewis/CSET_Singapore_training/

Note Q-Q and scatter plots are currently unchanged.
Question for reviewer: is there a preference here, noting input to scatter and Q-Q I think have collapsed across number of dimensions (i.e. no such thing as a 'sequence') by time of plotting.

@ukmo-huw-lewis
Copy link
Contributor Author

Note for aggregation plots, filenames and plot titles remain a function of aggregation 'sequence' (e.g. hour of day) only.
e.g. lfric_dew_point_temperature_at_screen_level_aggregation_by_hour_of_day_12hours.png
This is no different to the current approach, but we may wish to consider if need for improvement here, without over-complicating code.

For timeseries aggregated by hour of day, a '[0 hours]' now appears in the plot title (was it there previously?), which should be removed.

@ukmo-huw-lewis
Copy link
Contributor Author

@daflack - PR ready for fresh review.

May need further changes to address aggregation options.

Copy link
Collaborator

@daflack daflack left a comment

Choose a reason for hiding this comment

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

Overall looking very good, and really useful. A couple of comments one in relation to your question around Q-Q plots and one in relation to testing.

  1. It would be nice if we could have a countertest to the if statement on L501 of plot.py currently it is always true in the tests. Do we expect this to be the case if so we can remove that line, otherwise it would be helpful to have a test when this isn't true.
  2. In relation to the Q-Q plots, if possible it would make sense to match it to the histogram (all) - so we show the timeframe of the entire forecast. If this is not possible due to the way the code is written for the Q-Q plots please write an issue so that we know we need to alter the coding of the Q-Q plots to allow this to happen. It might be the case that we need to make it similar to the histogram plots coding if that is the case. I believe there is an issue already for aggregation of Q-Q plots (#1714 ) so you could always add it into that issue.

Also I don't remember the [0 hours] being there before and I'm not sure I have any other ideas on the naming convention for the aggregation files than what we currently have.

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.

More intuitive output plot filenames

2 participants