Skip to content

feat: CLI commands for stub manifest generation and inspection #258

@pgierz

Description

@pgierz

Context

The tutorial/test infrastructure (#253) includes stub_generator.py which creates NetCDF files from YAML manifests. Currently, manifests must be hand-written.

Proposed CLI Commands

pycmor tutorial inspect

Reads real NetCDF files and generates a stub_manifest.yaml:

pycmor tutorial inspect /path/to/real/output/*.nc -o stub_manifest.yaml

pycmor tutorial generate-stubs

Reads a manifest and writes stub NetCDF files:

pycmor tutorial generate-stubs stub_manifest.yaml -o ./stub_data/

Scope

  • ~50-80 lines for the inspect command (read dims/coords/attrs, dump YAML)
  • CLI wiring via click/typer
  • Tests for roundtrip: real files -> manifest -> stub files -> verify structure matches

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions