Skip to main content

climate-ref-example

PyPI version Documentation Status License Python Version

This package provides an example implementation of a diagnostic provider for the Climate REF (Rapid Evaluation Framework). It serves as a template and reference for developers who want to create their own diagnostic providers.

Installation

pip install climate-ref-example

Features

  • Example implementation of a diagnostic provider
  • Global mean timeseries diagnostic demonstration
  • Complete implementation of all required interfaces
  • Test data specification for reproducible testing

Usage

Enable the provider in your ref.toml configuration:

[[diagnostic_providers]]
provider = "climate_ref_example:provider"

Then run diagnostics:

ref solve --provider example

Example Diagnostic

The package implements a GlobalMeanTimeseries diagnostic that calculates the annual mean global mean timeseries for CMIP6 datasets:

from climate_ref_core.providers import DiagnosticProvider
from climate_ref_core.diagnostics import Diagnostic, DataRequirement, ExecutionDefinition, ExecutionResult
from climate_ref_core.datasets import FacetFilter, SourceDatasetType

class GlobalMeanTimeseries(Diagnostic):
    """Calculate the annual mean global mean timeseries for a dataset."""

    name = "Global Mean Timeseries"
    slug = "global-mean-timeseries"

    data_requirements = (
        DataRequirement(
            source_type=SourceDatasetType.CMIP6,
            filters=(FacetFilter(facets={"variable_id": ("tas", "rsut")}),),
            group_by=("source_id", "variable_id", "experiment_id", "variant_label"),
        ),
    )
    facets = ("source_id", "variable_id", "experiment_id", "variant_label", "region", "metric", "statistic")

    def execute(self, definition: ExecutionDefinition) -> None:
        # Perform the diagnostic calculation
        ...

    def build_execution_result(self, definition: ExecutionDefinition) -> ExecutionResult:
        # Build and return the execution result
        ...

# Register diagnostics with a provider
provider = DiagnosticProvider("Example", __version__)
provider.register(GlobalMeanTimeseries())

Creating Your Own Provider

Use this package as a template:

cp -r packages/climate-ref-example packages/climate-ref-myprovider

See the Adding Custom Diagnostics guide for detailed instructions.

Documentation

For detailed documentation, please visit https://climate-ref.readthedocs.io/

Contributing

Contributions are welcome! Please see the main project's Contributing Guide for more information.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Metadata

Release files for climate-ref-example 0.20.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for climate-ref-example 0.20.4
File Size Uploaded Provenance Actions
climate_ref_example-0.20.4.tar.gz 24.0 kB Without provenance Details for climate_ref_example-0.20.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for climate-ref-example 0.20.4
File Interpreter ABI Platform Actions
climate_ref_example-0.20.4-py3-none-any.whl Python 3 none any Details for climate_ref_example-0.20.4-py3-none-any.whl

Total release size: 40.0 kB

Release files / climate_ref_example-0.20.4.tar.gz

Download URL climate_ref_example-0.20.4.tar.gz
Size 24.0 kB
Tags Source
SHA-256 checksum
How to use checksums
455df07b1b8968d14e2fc8947327a0e411005306bed50dd6b336a9d89f6bb9ec
BLAKE2b-256 checksum
How to use checksums
17d2a5c25c674f1262421f4217ad5fb292ea6a5d66bd13d581e72cb4e8da7112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / climate_ref_example-0.20.4-py3-none-any.whl

Download URL climate_ref_example-0.20.4-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a66b22ac6e8c9ac0b2532f239b8df046c0bdb92b2f0a53f16cdf484b5c19c04
BLAKE2b-256 checksum
How to use checksums
b3d01109613a36bedd5c3ebe7970213d9f227b2f3a0f7641dd283d65928c18f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for climate-ref-example 0.20.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page