Skip to content
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

MOBT-494: Cube title setting in weather symbol code #1912

Merged
merged 3 commits into from
Jun 21, 2023

Conversation

bayliffe
Copy link
Contributor

Adds the option to manually set the title attribute for weather symbols output. This enables the attribute to be set as desired, including in situations where the input cubes do not share a common title, resulting in no title being set otherwise.

This change is needed for the site-specific phase change work. In the new chains that produce weather symbols from spot forecasts, the rain / sleet / snow inputs have been spot-extracted prior to realization collapse and cycle blending. The weighted blending plugin inherits the PostProcessingPlugin class, meaning all titles are prefixed "Post processed". As a result:

  • usual spot extracted outputs used as inputs to the wx have the title "MOGREPS-G Spot Values"
  • the phase diagnostics have used as inputs to the wx have the title "Post-Processed MOGREPS-G Spot Values"
  • the generate_mandatory_attributes code returns a default unset title attribute as the title is no longer common between all inputs.

This change will be accompanied by an app config change in the suite to manually set the weather symbols output title for the spot-forecast generated weather symbols.

Acceptance test data: metoppv/improver_test_data#15

Testing:

  • Ran tests and they passed OK
  • Added new tests for the new feature(s)

…ls output. This enables the attribute to be set as desired, including in situations where the inputs cubes do not share a common title, resulting in no title being set otherwise.
@bayliffe bayliffe requested review from MoseleyS and gavinevans June 15, 2023 14:49
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #1912 (2666be5) into master (cbb9370) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1912   +/-   ##
=======================================
  Coverage   98.33%   98.33%           
=======================================
  Files         120      120           
  Lines       11390    11413   +23     
=======================================
+ Hits        11200    11223   +23     
  Misses        190      190           
Impacted Files Coverage Δ
improver/wxcode/weather_symbols.py 98.50% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

@bayliffe
Copy link
Contributor Author

@MoseleyS KGO title updated to be metadata compliant.

Copy link
Contributor

@gavinevans gavinevans left a comment

Choose a reason for hiding this comment

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

Thanks @bayliffe 👍

I've just added a minor query related to the checksum.

@@ -845,6 +845,7 @@ ea67ae7a7f5363ae3692b29c93fb9989449d96e49dc613a1297d98ddb12c578a ./wxcode-modal
803b2a645f8a33db4601a45dc16325f8a90f13fdea430b98ea94f032ee032180 ./wxcode/bad_wx_decision_tree.json
c2fdb1144abdf6188bb2d9de0104c6dfbcb3a8ba07cbe4e7ac2b9c3782f55484 ./wxcode/basic/kgo.nc
9c543a6e2068ad51c6664903bf06b5ecbf018ad914f972762ef0577469fec1b3 ./wxcode/basic/kgo_no_lightning.nc
a51691b4b7b6f8661804554eecf47440ec8353c80d9a779d06ea4b0effbd5b42 ./wxcode/basic/kgo_titled.nc
Copy link
Contributor

Choose a reason for hiding this comment

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

This checksum seems to differ from the checksum that I get when I run the acceptance tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, no idea what happened there. Checksums recreated and pushed.

@gavinevans gavinevans assigned bayliffe and unassigned MoseleyS Jun 19, 2023
@bayliffe bayliffe assigned gavinevans and unassigned bayliffe Jun 20, 2023
@gavinevans gavinevans removed their assignment Jun 21, 2023
@gavinevans gavinevans removed the request for review from MoseleyS June 21, 2023 06:59
@brhooper brhooper self-assigned this Jun 21, 2023
Copy link
Contributor

@brhooper brhooper left a comment

Choose a reason for hiding this comment

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

This all looks fine, tests pass.

@brhooper brhooper merged commit ba0808b into metoppv:master Jun 21, 2023
@brhooper brhooper assigned bayliffe and unassigned brhooper Jun 21, 2023
@bayliffe bayliffe deleted the mobt494_wx_titles branch June 21, 2023 07:59
bayliffe added a commit to bayliffe/improver that referenced this pull request Jul 28, 2023
* upstream/master:
  Fix to the wind vertical displacement adjustment implementation (metoppv#1927)
  Add function which normalises input cubes according to a reference (metoppv#1919)
  Skip ECC bounds usage when converting probabilities to percentiles (metoppv#1926)
  Add CLIs to support rescaling of the forecast based on altitude difference (metoppv#1917)
  Changes to the modal code to increase the percentage to 30% and change the groupings to provide a more representative daily summary symbol. (metoppv#1925)
  Add plugins to support rescaling of the forecast based on altitude difference (metoppv#1916)
  Support conversion from percentiles to probabilities (metoppv#1924)
  Correct handling of reference time in weather_code plugin (metoppv#1920)
  Add CLI for clipping cubes (metoppv#1918)
  Update cbh ecc name (metoppv#1922)
  Updates Broadcast and expand_bounds in Combine Plugin (metoppv#1914)
  Mobt515 cloud base height spot extraction (metoppv#1911)
  MOBT-494: Cube title setting in weather symbol code (metoppv#1912)
  MOBT512-masking percentiles for cloud base height (metoppv#1908)
  Mobt 496 enforce forecast between references (metoppv#1907)
MoseleyS pushed a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
* Adds the option to manually set the title attribute for weather symbols output. This enables the attribute to be set as desired, including in situations where the inputs cubes do not share a common title, resulting in no title being set otherwise.

* Modify test file title to be metadata compliant.

* Recreate checksums.
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