Commit f360dc3
Add cli to downscaling (#18)
* first pass pre-test
* Add magic-downscaling CLI: prepare/cluster/extract/downscale/analyze
verbs - tested on pecan env ver 1.10
* re-org of verbs, split of demo data obtain, and correction so that
prepare can be run ahead of other verbs.
* update to run_script and check_r_libraries to correctly determine exit
status to identify step failure/success.
* fixes to sourcing of helper functions, previously covered by sourcing
config, now covered by sourcing specific files.
* - actually added intended code to wire CLI together
- correctly reads steps from workflow manifest via get_steps_array
- handles input scalar parameters and path parameters via resolve_param
and resolve_path respectively
-- inputs and outputs are paths
-- params are scalars
- dynamically builds command arguments from specified inputs,outputs,
and params
- command-line parameter names are the keys (e.g., raw_data_dir -->
'--raw_data_dir')
- the values in the manifest are passed as values to the specified key
(raw_data_dir: 'data_raw')
- demo workflow completes as normal
- CI basics for demo workflow in place: needs repo config to actually
work.
* Fix PR review issues: config keys, r_libraries, CI, manifest validation
- Move aws_profile from downscaling: to global: in
example_user_config.yaml
and .github/ci/downscaling_ci_config.yaml; fix magic-downscaling's
stale
help text to match the code, which already read global.aws_profile
- Correct r_libraries across all 11 manifest steps (cluster/extract/
downscale/analyze) against actual script imports, including sourced R/
helpers: add missing hard deps (here, knitr, magick, units, withr,
ClusterR, PEcAn.utils, future, lubridate, arrow, janitor, jsonlite,
randomForest, iml, vroom, patchwork, scales, PEcAn.data.land), drop
confirmed-unused ones (caladaptr from prepare_anchor_sites; sf, furrr
from cluster_sites; sf from subsample_design_points)
- Drop unused AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_DEFAULT_REGION
env exports from the CI workflow; --profile magic already resolves
credentials on the runner, so those secrets were dead weight
- Fix check_r_libraries capturing stderr into the same variable as the
package-availability check's stdout, which could misreport stray
stderr
(e.g. locale warnings) as a missing package; capture stderr separately
so it's only surfaced on a genuine Rscript failure
- Delete unused .Renviron.bak / .Rprofile.bak (nothing in the repo reads
either file; leftover from the pre-conda renv setup)
- Remove the dangling docs/manifest-driven-cli-design.md reference from
downscaling_manifest.yaml (that doc is intentionally not tracked)
- Drop the "placeholder name" parenthetical from the cluster verb's help
text now that the name is settled
- Make get_steps_array validate that every manifest step has both
`script`
and `name`, failing fast with the offending step's index/script
instead
of silently misaligning STEPS/STEP_NAMES (dispatch elsewhere is
name-keyed via `select(.name == ...)`, so a missing name breaks that
lookup silently otherwise)
- Sweep scripts/*.R: replace the copy-pasted stop() calls for --run_dir/
--mode validation with PEcAn.logger::logger.severe(), matching house
logging style
- Fix get-demo-data help text to say demo-data/ lands relative to the
invocation directory, not "the repo root" (matching actual
INVOCATION_CWD-based behavior)
* Resolve PR #18 review feedback: disconnect cluster verb, trim manifest
cruft
- Fixed: cluster verb removed from CLI, scripts left as non-CLI tools
- Fixed: 031 (mixed-system aggregation) excluded from extract step
- Fixed: dead placeholder path keys removed (prepare_dir, extract_dir,
downscaled_csv, county_totals_csv, analyze_dir, aggregated_output_csv)
- included data resources for github ci
* add readme update
* wired in the n_cores parameter is 030 and 040. used config to set
n_cores, but falls back to environment variables from slurm as needed.
* Apply suggestion from @dlebauer
---------
Co-authored-by: David LeBauer <dlebauer@gmail.com>1 parent 1d9a799 commit f360dc3
23 files changed
Lines changed: 12296 additions & 152 deletions
File tree
- .github
- ci
- data
- workflows
- scripts
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments