Skip to content

Conversation

@gavinevans
Copy link
Contributor

@gavinevans gavinevans commented Dec 18, 2025

Addresses https://github.com/metoppv/mo-blue-team/issues/763
improver_test_data PR: metoppv/improver_test_data#118

Description
This PR adds two pieces of functionality:

  • Extends the existing temporal interpolation to support specifying "google_film" as an option.
  • Adds a ForecastTrajectoryGapFiller plugin and CLI for filling gaps in the forecast trajectory (i.e. validity time or, equivalently forecast period, when considering forecasts from a fixed forecast reference time), or smoothing across transitions between different forecast sources. This is a slightly different set-up to the existing temporal interpolation plugin and CLI, which is expecting a start and end cube only.

File breakdown:

  • envs/environment_a.yml - Add Tensorflow and Tensorflow_hub to environment to be able to use Google Film.
  • envs/latest.yml - Add Tensorflow and Tensorflow_hub to environment to be able to use Google Film.
  • improver/cli/forecast_trajectory_gap_filler.py - A CLI for the ForecastTrajectoryGapFiller plugin. This is a sister CLI to the temporal-interpolate CLI but is intended to take a collection of validity times for a forecast from a fixed forecast reference time and fill gaps, or smooth across transitions between forecast sources.
  • improver/cli/temporal_interpolate.py - Modifications to add "google_film" as an option.
  • improver/utilities/temporal_interpolation.py - Modifications to the existing TemporalInterpolation plugin and addition of the ForecastTrajectoryGapFiller and GoogleFilmInterpolation plugin. The GoogleFilmInterpolation plugin is accessed through either the TemporalInterpolation or ForecastTrajectoryGapFiller plugins.
  • improver_tests/acceptance/SHA256SUMS - Checksum updates.
  • improver_tests/acceptance/test_forecast_trajectory_gap_filler.py - Acceptance tests for new CLI. This uses linear interpolation. The Google Film interpolation is more time-consuming.
  • improver_tests/acceptance/test_temporal_interpolate.py - Add an example acceptance test that uses Google Film. This takes a bit longer than most other acceptance tests and relies upon accessing the Google FILM url.
  • improver_tests/utilities/test_ForecastTrajectoryGapFiller.py - Unit tests for ForecastTrajectoryGapFiller plugin.
  • improver_tests/utilities/test_GoogleFilmInterpolation.py - Unit tests for GoogleFilmInterpolation plugin.
  • improver_tests/utilities/test_TemporalInterpolation.py - Unit tests for TemporalInterpolation plugin.

Testing:

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

…pecific plugin and addition of a Google Film option to the temporal interpolation plugin and CLI.
…he situation where a range of forecast periods are available, but within this range there are gaps to be filled. This class also checks an attribute, which contains information about the forecast source at each forecast period. Forecast periods at which there is a transition from one forecast source to another will be the target for the interpolation.
Copy link
Contributor

@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

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

A nice round 30 comments for you.

* upstream/master:
  BUG: gh actions coverage report (metoppv#2269)
  Bump actions/checkout from 5 to 6 (metoppv#2272)
  Bump actions/github-script from 7 to 8 (metoppv#2271)
  Fix acceptance tests that were relying on a warning being raised (metoppv#2268)
  Merge CLI and application UI improvements (metoppv#2222)
  OrographicEnhancement CLI -> MetaOrographicEnhancement application (metoppv#2221)
… batched approach used for Google Film interpolation.
…parallel backend available using the joblib package.
Copy link
Contributor

@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

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

I believe you will need to modify the improver_production environment in the long term, but for now the improver_tests/acceptance/test_temporal_interpolate.py test fails when running the acceptance tests as the tensorflow_hub module is not found. You need to extend your pytest.skip test to include not only the availability of the google film model but also the tensorflow_hub module.

bayliffe
bayliffe previously approved these changes Jan 21, 2026
Copy link
Contributor

@bayliffe bayliffe left a comment

Choose a reason for hiding this comment

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

Thanks Gavin. Automated tests failing, but ready for second review.

Copy link
Contributor

@maxwhitemet maxwhitemet left a comment

Choose a reason for hiding this comment

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

Thanks @gavinevans. I've added some comments.

@gavinevans
Copy link
Contributor Author

Note that some functions in this PR are deliberately not covered by unit tests e.g. load_model as this mainly involves the importing of TensorFlow, which is slow, and therefore not done in any of the unit tests.

Copy link
Contributor

@maxwhitemet maxwhitemet left a comment

Choose a reason for hiding this comment

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

Thanks @gavinevans. I'm happy with the changes made. Approved 👍

@gavinevans gavinevans merged commit 970a511 into metoppv:master Jan 29, 2026
6 of 7 checks passed
@gavinevans gavinevans deleted the mobt_763_google_film branch January 29, 2026 11:06
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.

3 participants