Skip to main content

cemc-plots-kit

cemc-plots-kit is a command-line orchestration tool for producing graphics from CEMC numerical weather prediction (NWP) data. It owns task configuration, data-source selection, scheduling, and output management. Rendering is provided by cedar-graph, using either packaged YAML recipes or Python plot modules.

plot_type maps directly to a cedar-graph recipe or module; no per-plot wrapper code is required.

Requirements and installation

Python 3.11 or later is required. Install the package from PyPI:

uv tool install cemc-plots-kit

For development, install the repository and its test dependencies:

uv sync --extra test

Quick start: draw one plot

The following command renders a 2 m temperature plot from CMA-GFS data on CMA-HPC:

cemc-plots draw \
  --system-name cma_gfs \
  --plot-type cn.t2m \
  --start-time 2024111300 \
  --forecast-time 24h \
  --work-dir .

It creates cn_t2m_2024111300_024.png in the working directory.

--plot-type accepts:

  • A packaged cedar-graph recipe, such as cn.t2m, cn.h_500_psl, or cn.rain_24h.
  • A cedar-graph Python plot module for more complex diagnostic products, such as cn.shr.default or cn.t_dew_t.default.
  • A path to an external .yaml or .yml recipe.

Packaged recipes

The following recipes use the cn. namespace:

plot_type Product
cn.t2m 2 m temperature
cn.rh2m 2 m relative humidity
cn.h_500_psl 500 hPa geopotential height and mean sea-level pressure
cn.h_500_wind_850 500 hPa geopotential height and 850 hPa wind
cn.kidx_wind K index and wind; requires wind_level
cn.bli_wind, cn.cape_wind, cn.cin_wind Convective index and wind; require wind_level
cn.cdbz Composite reflectivity
cn.wind_10m 10 m wind
cn.rain_24h 24-hour accumulated precipitation
cn.rain_wind_10m Interval precipitation and 10 m wind; requires interval
cn.prep_24h 24-hour precipitation type (rain, sleet, and snow)

Run a task

A task file defines a time range, data source, plots, and runtime behavior. Create task.yaml:

runtime:
  base_work_dir: .

# Use catalog defaults. CMA-GFS resolves to its canonical local dataset.
source: {}

system_name: CMA-GFS

time:
  start_time: 2024111300
  forecast_time: 48h
  forecast_interval: 6h

plots:
  cn.h_500_psl: on
  cn.rain_24h: on

Run it with:

cemc-plots task --task-file ./task.yaml

This example produces height-and-pressure plots for forecast hours 0 through 48, and precipitation plots for forecast hours 24 through 48. The default availability check excludes cn.rain_24h at forecast hour 0 because a 24-hour accumulation is not available then.

Plot configuration

Each key in plots is a plot type or an external recipe path. Its value can be one of the following forms:

plots:
  # Enable a plot without parameters.
  cn.t2m: on

  # Pass one parameter mapping to a recipe.
  cn.rain_wind_10m:
    interval: 3h

  # Render the same plot with several parameter mappings.
  cn.rain_wind_10m:
    - { interval: 1h }
    - { interval: 3h }

Parameterized output names include a parameter suffix, for example cn_rain_wind_10m_interval_3h_2024111300_024.png.

Data-source selection

For current tasks, use source.dataset to select a local mounted CMADaaS catalog entry. A v2 task keeps only stable parameter IDs, FieldQuery values, and time semantics in its Recipe or PlotPlan. It never stores service endpoints or credentials.

The deployment template is examples/task-v2-cmadaas-mount.yaml. Its storage_base is task-local, while the packaged catalog contains no machine-specific mount paths:

cemc-plots validate examples/task-v2-cmadaas-mount.yaml
cemc-plots plan examples/task-v2-cmadaas-mount.yaml
cemc-plots explain examples/task-v2-cmadaas-mount.yaml \
  --plot cn.t2m --forecast-time 24h
cemc-plots run examples/task-v2-cmadaas-mount.yaml

validate, plan, and explain are offline operations: they do not create a reader, decode data, make a CMADaaS request, render a figure, or write output. run writes figures and task-manifest.json atomically to the configured output directory. The manifest records task-plan identity, each job result, source identity, and task-local sharing counters; it intentionally excludes credentials and complete environment-variable values.

Legacy v1 task bindings remain supported. system_name or an explicit source selects the dataset at the task layer. Explicit legacy directories and file-name templates take precedence over catalog defaults:

source:
  data_dir: /g3/COMMONDATA/OPER/CEMC/GFS_GMF/Prod-grib/{start_time_label}/ORIG
  data_file_name_template: gmf.gra.{start_time_label}{forecast_hour_label}.grb2

A relative data_dir is resolved from the directory containing the task file. At runtime, these v1 fields are converted to a constrained file-pattern source. Existing system_name values continue to determine titles and output file names.

Runtime behavior

runtime.workers: 1 is the deterministic reference executor. With runtime.shared_reads: true, it keeps a task-local shared provider. Values greater than one use isolated processes, so each worker recreates its provider and file handles. Manifest entries remain in TaskPlan order even when work completes in a different order. Set shared_reads: false to compare against independent per-job reads.

External recipes

Use a .yaml or .yml path as a plots key to load an external recipe. This lets you add a product without waiting for a cedar-graph release. Relative paths are resolved from the task-file directory, and the output filename uses the recipe filename stem:

plots:
  cn.t2m: on
  recipes/t2m_custom.yaml: on        # Relative to the task-file directory.
  /data/opr/recipes/my_plot.yaml: on # Absolute path.

draw --plot-type also accepts a recipe path:

cemc-plots draw \
  --system-name cma_gfs \
  --plot-type ./recipes/t2m_custom.yaml \
  --start-time 2024111300 \
  --forecast-time 24h \
  --work-dir .

Refer to the cedar-graph recipe authoring documentation and its packaged cedar_graph/recipes/cn/ recipes for syntax and examples. More complete task examples are available in examples/.

License

Copyright © 2024-2026, developers at cemc-oper.

cemc-plots-kit is licensed under the Apache License 2.0.

Metadata

Release files for cemc-plots-kit 2026.9.1

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

Source distribution (sdist)

Source distribution for cemc-plots-kit 2026.9.1
File Size Uploaded Provenance Actions
cemc_plots_kit-2026.9.1.tar.gz 46.4 kB With provenance Details for cemc_plots_kit-2026.9.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cemc-plots-kit 2026.9.1
File Interpreter ABI Platform Actions
cemc_plots_kit-2026.9.1-py3-none-any.whl Python 3 none any Details for cemc_plots_kit-2026.9.1-py3-none-any.whl

Total release size: 79.3 kB

Release files / cemc_plots_kit-2026.9.1.tar.gz

Download URL cemc_plots_kit-2026.9.1.tar.gz
Size 46.4 kB
Tags Source
SHA-256 checksum
How to use checksums
37af0077ad80edbc3702f5f703a89c4397e1c40a281ca9502f6b7261ad7bea39
BLAKE2b-256 checksum
How to use checksums
c107d14b1d9ed3846776a9010282e58569960a64cb303c9ee92f1990db498e1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / cemc_plots_kit-2026.9.1-py3-none-any.whl

Download URL cemc_plots_kit-2026.9.1-py3-none-any.whl
Size 32.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af9a69fe526a30635fa1264fe96eca0e7f768c887b26b7b276c9b5626fc7a006
BLAKE2b-256 checksum
How to use checksums
6e2d9b5a4259093eb41996236c383a11a7a875257e6ce8a4b74d4af65736f384
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for cemc-plots-kit 2026.9.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cemc_plots_kit-2026.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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