Skip to content

Add the demeter command line interface; write tabular output without NetCDF - #68

Open
crvernon wants to merge 1 commit into
v3/netcdf-reader-memoryfrom
v3/cli
Open

crvernon wants to merge 1 commit into
v3/netcdf-reader-memoryfrom
v3/cli

Conversation

@crvernon

Copy link
Copy Markdown
Member

Stacked PR — part of the Demeter v3.0.0 upgrade. Base: v3/netcdf-reader-memory. Review and merge in order, bottom of the stack first.

Plan items: 6.1

Benchmark: IDENTICAL. Adds demeter run, demeter validate-config, demeter get-data. Also fixes tabular CSV only being written when NetCDF output was enabled.

Commits

Add the demeter command line interface; write tabular output without NetCDF

New demeter console script (plan 6.1):

  • demeter run --config-file X.ini, with named options and repeatable
    --set PARAM=VALUE overrides that take precedence over the file.
  • demeter validate-config resolves the configuration, checks every
    input file exists, and prints the effective resolution and
    tolerances.
  • demeter get-data DIR downloads the example data supplement.
  • The Docker entrypoint is now demeter.

Fix: ProcessStep.outputs built the land cover frame, and wrote the
tabular CSV, only when save_netcdf_yr was 1. With save_netcdf_yr=0,
save_tabular wrote nothing and process_step() returned None. The frame
is now built for every target year, and the CSV and NetCDF outputs are
controlled independently.

New tests/test_cli.py drives the CLI through an INI file with
GCAM-format projected CSV input, covering the file-based projected
path. The run reproduces the baseline region x basin x land class
totals within the 6-significant-digit precision of the tabular output.

Benchmark: global_0p5deg is IDENTICAL to v3.0.0-b4. 33 tests pass.

🤖 Generated with Claude Code

…NetCDF

New `demeter` console script (plan 6.1):
- `demeter run --config-file X.ini`, with named options and repeatable
  --set PARAM=VALUE overrides that take precedence over the file.
- `demeter validate-config` resolves the configuration, checks every
  input file exists, and prints the effective resolution and
  tolerances.
- `demeter get-data DIR` downloads the example data supplement.
- The Docker entrypoint is now `demeter`.

Fix: ProcessStep.outputs built the land cover frame, and wrote the
tabular CSV, only when save_netcdf_yr was 1. With save_netcdf_yr=0,
save_tabular wrote nothing and process_step() returned None. The frame
is now built for every target year, and the CSV and NetCDF outputs are
controlled independently.

New tests/test_cli.py drives the CLI through an INI file with
GCAM-format projected CSV input, covering the file-based projected
path. The run reproduces the baseline region x basin x land class
totals within the 6-significant-digit precision of the tabular output.

Benchmark: global_0p5deg is IDENTICAL to v3.0.0-b4. 33 tests pass.

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant