Skip to main content

Workflow orchestration layer for CDO-based climate analysis

Project description

cdo-flow

Workflow orchestration layer for CDO-based climate analysis, built on top of python-cdo-wrapper.

Install

pip install cdo-flow

Requires CDO to be installed for steps that execute CDO operators.

Quick start

from cdo_flow import Workflow, python_step, cdo_step
from python_cdo_wrapper.query import CDOQueryTemplate

# Pure Python step
@python_step
def write_data(ctx):
    ctx.output("result.txt").write_text("hello")

# CDO step via decorator
@cdo_step
def regrid(ctx, cdo):
    cdo.query(ctx.inputs["data"]).remap_bil("r360x180").to_file(ctx.output("regridded.nc"))

# Inline CDO chain
wf = Workflow(name="demo", run_dir="./runs")
wf.add_step("write", write_data)
wf.add_step(
    "select_tas",
    chain=CDOQueryTemplate().select_var("tas").year_mean(),
    inputs={"data": "/path/to/input.nc"},
    output=["tas_annual.nc"],
)
result = wf.run()

YAML workflows

name: my_workflow
steps:
  - id: select
    type: cdo
    inputs:
      data: /path/to/input.nc
    operator_chain:
      - op: selname
        args: [tas]
      - op: yearmean
    output: tas_annual.nc
cdo-flow validate my_workflow.yml
cdo-flow run my_workflow.yml --dry-run
cdo-flow run my_workflow.yml

License

MIT

Project details


Download files

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

Source Distribution

cdo_flow-0.2.0.tar.gz (212.3 kB view details)

Uploaded Source

Built Distribution

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

cdo_flow-0.2.0-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file cdo_flow-0.2.0.tar.gz.

File metadata

  • Download URL: cdo_flow-0.2.0.tar.gz
  • Upload date:
  • Size: 212.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cdo_flow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f1c11e1ebf709f5da2397ff18377bd559c0639c5fcf08a80e1983dc4ead90522
MD5 9a104b41b5055a04e9d8a74d1fcb4fee
BLAKE2b-256 3a891d4495a158120ba9cda52593f8ee75ff0369417e0f14f940f063171df586

See more details on using hashes here.

Provenance

The following attestation bundles were made for cdo_flow-0.2.0.tar.gz:

Publisher: publish.yml on NarenKarthikBM/cdo-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cdo_flow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cdo_flow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cdo_flow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ddf32967cb0284037e4a8cca34b249f330eeace5034b7c34a61456c37b7a370
MD5 af94e07bd576d4a878040d5bf8115ae0
BLAKE2b-256 17efe290b400565524043a5c2e688f84570c86ebb277f6d1680cacfe30944c0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cdo_flow-0.2.0-py3-none-any.whl:

Publisher: publish.yml on NarenKarthikBM/cdo-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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