Example diagnostic provider for the Rapid Evaluation Framework
Project description
climate-ref-example
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.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file climate_ref_example-0.14.4.tar.gz.
File metadata
- Download URL: climate_ref_example-0.14.4.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ab63a3aa5aefbf471bff7fc5812de21b80a7850794e4471aa785177316e3a8
|
|
| MD5 |
0fe619e3237a9ae5f0fd2c0e11474cc1
|
|
| BLAKE2b-256 |
eed92c46483cad04d5c62645184bb090f33a4aa199133d9bea530b1c5217af09
|
File details
Details for the file climate_ref_example-0.14.4-py3-none-any.whl.
File metadata
- Download URL: climate_ref_example-0.14.4-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7e911a04e9eebbe179b4d6717cc5ed8ff824db937f98549378edccde010b004
|
|
| MD5 |
e7278cbc12468562a428384112c94379
|
|
| BLAKE2b-256 |
c958a346841f82535a326771ce803c45baed505f990770a59247c90ca63b720f
|