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

Support for a static additional predictor within the EMOS plugins #1564

Merged
merged 24 commits into from
Oct 13, 2021

Conversation

gavinevans
Copy link
Contributor

@gavinevans gavinevans commented Sep 23, 2021

Closes #1537

Dependent on #1563 and #1575.

Description
This PR adds support for the use of a static additional predictor within the EMOS plugins. From a metadata perspective, this PR adds the use of a predictor_index and predictor_name coordinates to the beta coefficient cube.

This PR is a slightly slimmed down version of #1555 after creating a standalone PR to deal with environment changes (#1556), a separate PR to remove optional usage of statsmodels (#1563) and a separate PR to include the changes to the CRPS minimisation plugin only. This PR does not include changes to the CLI to support the use of additional predictors, as this is not actually required in the short-term due to the need for #1538. Note that the number of lines changed will reduce by ~300 when #1563 is merged and ~400 when #1575 is merged.

This PR has not provided support for the use of a static additional predictor with the realizations option. This can be revisited, if there is a requirement for this functionality.

Further information is in this comment.

Testing:

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

@gavinevans gavinevans added this to the 1.0.0 milestone Sep 23, 2021
@gavinevans gavinevans self-assigned this Sep 23, 2021
@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #1564 (c663df5) into master (0950906) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1564      +/-   ##
==========================================
+ Coverage   97.98%   98.00%   +0.02%     
==========================================
  Files         107      107              
  Lines        9619     9669      +50     
==========================================
+ Hits         9425     9476      +51     
+ Misses        194      193       -1     
Impacted Files Coverage Δ
improver/calibration/ensemble_calibration.py 100.00% <100.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0950906...c663df5. Read the comment docs.

Copy link
Contributor

@fionaRust fionaRust left a comment

Choose a reason for hiding this comment

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

Thanks for these changes Gavin. My comments are all pretty minor, the main functionality of this code is really good. Two things I've noted:

  • I guess there will be another PR at some point to do the CLI changes.
  • I think this code will support multiple additional predictors, but all the tests only use one additional predictor. Maybe we should talk through whether we should add a test for multiple additional predictors anywhere in the code.

@fionaRust fionaRust assigned gavinevans and unassigned fionaRust Oct 7, 2021
…_plugins2

* upstream/master:
  Support for a static additional predictor within the CRPS minimisation plugin (metoppv#1575)
  MOBT-86: Spot extracting from data with 2-dimensional time coordinates (metoppv#1573)
@gavinevans gavinevans marked this pull request as ready for review October 8, 2021 09:09
@fionaRust fionaRust removed their assignment Oct 11, 2021
@fionaRust fionaRust requested a review from MoseleyS October 11, 2021 15:14
…_plugins2

* upstream/master:
  Retain ensemble realization numbers from the raw forecast after reordering (metoppv#1580)
@MoseleyS MoseleyS assigned gavinevans and unassigned MoseleyS Oct 12, 2021
@gavinevans gavinevans force-pushed the improver1537_emos_plugins2 branch 2 times, most recently from dce97d1 to 1215468 Compare October 13, 2021 10:26
@gavinevans gavinevans force-pushed the improver1537_emos_plugins2 branch from 1215468 to c663df5 Compare October 13, 2021 10:32
@gavinevans gavinevans assigned MoseleyS and unassigned gavinevans Oct 13, 2021
Copy link
Contributor

@MoseleyS MoseleyS left a comment

Choose a reason for hiding this comment

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

Just one more thing...

improver_tests/acceptance/SHA256SUMS Show resolved Hide resolved
improver_tests/acceptance/SHA256SUMS Show resolved Hide resolved
@MoseleyS MoseleyS assigned gavinevans and unassigned MoseleyS Oct 13, 2021
@gavinevans gavinevans assigned MoseleyS and unassigned gavinevans Oct 13, 2021
@MoseleyS MoseleyS merged commit dda65b6 into metoppv:master Oct 13, 2021
@MoseleyS MoseleyS assigned gavinevans and unassigned MoseleyS Oct 13, 2021
gavinevans added a commit to gavinevans/improver that referenced this pull request Oct 19, 2021
…toppv#1564)

* Only the changes required to the ContinuousRankedProbabilityScoreMinimisers plugin required to support the use of additional predictors.

* Simplified array reshaping functionality.

* Update docstrings.

* Edits following review comments.

* Correct test name.

* Modifications to remove optional use of statsmodels. statsmodels is now a required module.

* Run isort and black.

* Changes to estimation of EMOS coefficients to support the use of a static additional predictor.

* Changes to application of EMOS coefficients to support the use of a static additional predictor.

* Update checksums.

* Tidy-ups following rebasing.

* Modifications following review comments.

* Further review amendments.

* Minor tidy-ups.

* Update checksums.

* Edits to revert changes to flatten_ignoring_masked_data and modify additional predictor handling in relation to the initial guess.

* Unit test corrections.

* Minor corrections.

* Update checksums.

* Update checksums.

* Updates following review comments

Co-authored-by: fionaRust <fiona.rust@metoffice.gov.uk>
gavinevans added a commit to gavinevans/improver that referenced this pull request Oct 19, 2021
…lar_ingestion_functions

* upstream/master:
  Generate calibrated forecasts from EMOS with an alternative percentile set (metoppv#1587)
  MOBT-77: Weather symbols to represent an extended period (metoppv#1552)
  Workaround for slow scipy truncnorm by using the version from 1.3.3 (metoppv#1576)
  Support for a static additional predictor within the EMOS plugins (metoppv#1564)
  Fix negative grid spacing (metoppv#1583)
  Increase leniency of EMOS application (metoppv#1577)
gavinevans added a commit to gavinevans/improver that referenced this pull request Oct 19, 2021
…lar_ingestion_cli2

* upstream/master:
  Generate calibrated forecasts from EMOS with an alternative percentile set (metoppv#1587)
  MOBT-77: Weather symbols to represent an extended period (metoppv#1552)
  Workaround for slow scipy truncnorm by using the version from 1.3.3 (metoppv#1576)
  Support for a static additional predictor within the EMOS plugins (metoppv#1564)
  Fix negative grid spacing (metoppv#1583)
  Increase leniency of EMOS application (metoppv#1577)
MoseleyS pushed a commit to MoseleyS/improver that referenced this pull request Aug 22, 2024
…toppv#1564)

* Only the changes required to the ContinuousRankedProbabilityScoreMinimisers plugin required to support the use of additional predictors.

* Simplified array reshaping functionality.

* Update docstrings.

* Edits following review comments.

* Correct test name.

* Modifications to remove optional use of statsmodels. statsmodels is now a required module.

* Run isort and black.

* Changes to estimation of EMOS coefficients to support the use of a static additional predictor.

* Changes to application of EMOS coefficients to support the use of a static additional predictor.

* Update checksums.

* Tidy-ups following rebasing.

* Modifications following review comments.

* Further review amendments.

* Minor tidy-ups.

* Update checksums.

* Edits to revert changes to flatten_ignoring_masked_data and modify additional predictor handling in relation to the initial guess.

* Unit test corrections.

* Minor corrections.

* Update checksums.

* Update checksums.

* Updates following review comments

Co-authored-by: fionaRust <fiona.rust@metoffice.gov.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update EMOS configuration with preferred site temperature calibration approach
3 participants