Skip to content

Conversation

BernardClaxton
Copy link
Contributor

@BernardClaxton BernardClaxton commented Apr 2, 2025

Fixes #1173

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.
  • 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.

@BernardClaxton
Copy link
Contributor Author

BernardClaxton commented Apr 2, 2025

Fixes #1173 to allow users to select the method for computing histograms of surface fields. Possible methods are - frequency, normalised frequency, density.

@BernardClaxton BernardClaxton changed the title Corrected typos in comments #1173 Added radio buttons to select histogram method for surface fields #1173 Apr 2, 2025
Copy link
Contributor

github-actions bot commented Apr 2, 2025

Coverage

Copy link
Member

@jfrost-mo jfrost-mo left a comment

Choose a reason for hiding this comment

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

The overall design looks very sensible and it should provide a welcome improvement in our histogram plots.

I've left a few comments throughout, but the two big things are adding tests for the histogram function, and considering whether we are right in making this user configurable outside of the recipes. See this comment.

@jfrost-mo
Copy link
Member

Sorry for being slow to review this. I'll go ahead and update the branch myself to fix the conflicting changes.

@BernardClaxton
Copy link
Contributor Author

I've also been a bit busy James. I've tried to implement your suggested edits, but I've yet to write a test for the new histogram plotting function. I can also follow up on your suggestion to move the histogram method to the Setup.

Copy link
Member

@jfrost-mo jfrost-mo left a comment

Choose a reason for hiding this comment

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

Its looking good with the changes you have done. I've just brought the branch up-to-date with the trunk, so once we have a few more tests we will be ready to merge.

@jfrost-mo jfrost-mo self-requested a review June 9, 2025 15:44
@daflack daflack mentioned this pull request Jul 28, 2025
9 tasks
@jfrost-mo jfrost-mo changed the title Added radio buttons to select histogram method for surface fields #1173 Added radio buttons to select histogram method for surface fields Aug 5, 2025
@daflack
Copy link
Contributor

daflack commented Aug 5, 2025

I'll rebase ahead of full review.

@daflack daflack force-pushed the 1173_histogram_plot_options branch from 34eec02 to 9a610ac Compare August 5, 2025 09:58
Copy link
Contributor

@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.

Looks good and works well. A really valuable change to CSET.

One very minor comment worth thinking about (also partly not sure if it was something I changed in the re-base that has altered it).

I was wondering if it was worth putting a little bit of information in the help text to indicate that the method selection appears in General Setup Options or seeing if there is a way it can be moved to appear in the location where the histograms are selected.

Also worth noting there should probably be a separate pull result to allow pressure levels and model level histograms to be selected in the same way as it currently does not trigger for those).

@BernardClaxton
Copy link
Contributor Author

Originally the histogram method was selected where the histogram options appear. So yes, it might be worth popping this function back there.

This enhancement was designed to allow someone to select a single method for producing histograms. It might be worth considering allowing multiple methods to be selected, similar to how "MEAN", "MIN" and "MAX" can be selected for producing aggregated plots.

@jfrost-mo
Copy link
Member

I'm tempted to suggest that we should add this as an argument to the histogram operator, and then use a recipe variable to set it instead of a command line option.

This will allow:

  • Running multiple types in the same CSET workflow.
  • Reproducing the same plot from a recipe.
  • Allow configuring this from next to where the histogram options are.
  • Allow hardcoding when a specific type is appropriate for a certain recipe.

@jfrost-mo jfrost-mo force-pushed the 1173_histogram_plot_options branch from fbdcee6 to 6b3c38e Compare August 19, 2025 09:57
daflack and others added 5 commits August 19, 2025 13:57
This is a squash commit that was everything on the branch
Instead we will set it through a recipe variable.
It is passed through to the internal plotting functions, but not all of
them use it yet.
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.

Histograms may not be integrating to one, and are probably better as PDFs
3 participants