Skip to main content

roocs-woodpecker-cmip6-decadal-plugin

CMIP6-decadal fixes for Woodpecker.

This plugin registers the CMIP6-decadal fix family, including:

  • cmip6_decadal.time_metadata
  • cmip6_decadal.calendar_normalization
  • cmip6_decadal.realization_variable

Install

pip install roocs-woodpecker-cmip6-decadal-plugin

For a development checkout:

pip install -e .

Verify

woodpecker list-fixes --dataset CMIP6-decadal
pytest

Example

See examples/usage.py for a minimal public API example using woodpecker.testing.make_cmip6_decadal().

Add An Adaptation

CMIP6-decadal adaptation modules use:

cmip6d_<sequence>_<short_name>.py

Keep the sequence stable for review/order history, and use a short name that matches the public adaptation id where practical. For example, cmip6d_0002_calendar.py registers cmip6_decadal.calendar_normalization.

An adaptation only needs to declare when a CMIP6-decadal dataset needs a change, how to preview that change, and how to apply it in place.

Use the existing modules as templates:

Module Shows
cmip6d_0001_time_meta.py Simple metadata normalization with a helper predicate and one changed attribute.
cmip6d_0002_calendar.py Prepare-phase calendar normalization for pre-concatenation use.
cmip6d_0014_reftime_coord.py Coordinate creation derived from existing time/start metadata.
cmip6d_0015_leadtime_coord.py Coordinate creation that depends on a previous adaptation step.

Most modules follow the same shape:

  1. A private _needs_* predicate.
  2. Optional private helper functions for the actual mutation.
  3. One @FixFunctionRegistry.register class.
  4. matches() delegates to is_cmip6_decadal_netcdf().
  5. check() returns short user-facing findings.
  6. apply() returns True on dry-run when it would change the dataset, and mutates only when dry_run=False.

Checklist:

  1. Add a module under src/woodpecker_cmip6_decadal_plugin/.
  2. Register one FixFunction subclass with @FixFunctionRegistry.register.
  3. Import the class from woodpecker_cmip6_decadal_plugin.__init__.
  4. Add the step to recipes/cmip6_decadal_full_recipe.json with the intended phase. Omit phase only when the step belongs to the default apply phase.
  5. Add or extend a synthetic dataset test in tests/test_cmip6_decadal_plugin.py.

Use phase: "prepare" for pre-concatenation changes, phase: "apply" for normal C3S/CDS adaptation, and phase: "finalize" for post-processing after the normal adaptation flow.

The notebook docs/notebooks/cmip6_decadal_recipe_example.ipynb shows the public API flow: load c3s.cmip6_decadal, run the prepare phase, then run the normal apply phase.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file roocs_woodpecker_cmip6_decadal_plugin-0.7.1.tar.gz.

File metadata

File hashes

Hashes for roocs_woodpecker_cmip6_decadal_plugin-0.7.1.tar.gz
Algorithm Hash digest
SHA256 0e85ad4fffca6a9a94a4e2be82f4a97880f663d9a6f4fc5698f5114f658ef00f
MD5 c96d7289927fc3bc0b50ebaf3fa109f9
BLAKE2b-256 bda826c3b5c74c237c63528f572c87314b608f367412849480a7bf6650911e2f

See more details on using hashes here.

File details

Details for the file roocs_woodpecker_cmip6_decadal_plugin-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for roocs_woodpecker_cmip6_decadal_plugin-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cc50a9a75cd8a1588f60d46481cc4797d199543d55deaa87f9dd09ffdf70d0f
MD5 c3ed24069a5c24c37801eb2ad79e653d
BLAKE2b-256 8a35e5692a7707bf007a1eaf049b3b5c5013eb7e5b462f45382d01e6919397d9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page