NCAR / CUPiD

CUPiD is a “one stop shop” that enables and integrates timeseries file generation, data standardization, diagnostics, and metrics from all CESM components.
https://ncar.github.io/CUPiD/
Apache License 2.0
24 stars 22 forks source link

Use click to allow command line arguments #79

Closed mnlevy1981 closed 6 months ago

mnlevy1981 commented 6 months ago

Sorry about the misleading branch name, but click seems better suited to this task than argparse since pyproject.toml wants to call run() from cupid/run.py rather than running run.py as a command line script.

Fixes #72

mnlevy1981 commented 6 months ago
(cupid-dev) $ cupid-run -h
Usage: cupid-run [OPTIONS] CONFIG_PATH

  Main engine to set up running all the notebooks.

Options:
  -s, --serial        Do not use LocalCluster objects
  -ts, --time-series  Run time series generation scripts prior to diagnostics
  -h, --help          Show this message and exit.

A few notes:

  1. cupid-run config.yml will create a LocalCluster in the ocean and sea ice notebooks
  2. cupid-run --serial config.yml will not create the LocalCluster
  3. cupid-run --time-series config.yml is not supported:
    (cupid-dev) $ cupid-run --time-series config.yml
    NotImplementedError: --time-series option not implemented yet
    (cupid-dev) $
TeaganKing commented 6 months ago

Should we also include the flag options in the README, or at least mention that descriptions are available with -h?

mnlevy1981 commented 6 months ago

Should we also include the flag options in the README, or at least mention that descriptions are available with -h?

Yes! I'll update the README now.

TeaganKing commented 6 months ago

I made a note in #73 about documentation, so will merge and close this.