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.1.0.tar.gz (16.5 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.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cdo_flow-0.1.0.tar.gz
  • Upload date:
  • Size: 16.5 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.1.0.tar.gz
Algorithm Hash digest
SHA256 60735a2d7613cf4231cd3790dc4b2b18bc80dcddf9bb684f8c33f06edc720ab0
MD5 de946f5e5793a6a4ad222775b957c7c7
BLAKE2b-256 1fe2f9175703c152aee0690f1acca026a5abe6c22094fe40899c05bae4349650

See more details on using hashes here.

Provenance

The following attestation bundles were made for cdo_flow-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: cdo_flow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11ba393e5779a1f86e472fa3d3c032b6e394922e082ade97c18e33f7f3e0e3ca
MD5 ac0d9d5cd5f4da1e42bd36dc350c8603
BLAKE2b-256 1e4f6ab758f80f55d33ac28ba159ff557358a65da9eb8862e24fbc711afb06db

See more details on using hashes here.

Provenance

The following attestation bundles were made for cdo_flow-0.1.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