Skip to content

Conversation

@dlebauer
Copy link
Contributor

@dlebauer dlebauer commented May 5, 2025

This PR does continues to update and reorganize the downscaling workflow while also generating design points for herbaceous crops.

Apologies that it didn't seem practical to separate these steps into separate PRs at the time.

Key Changes

  • Improvements to reproducibility, logging, and workflow clarity
  • Update documentation, comments, logging throughout the codebase for clarity
  • Renamed and renumbered workflow files to make it easier to split workflows into separate steps (e.g. using 010, 011, 020) nothing is future proof; can be revisited in the future.
  • Centralize configuration in 000-config.R
    • input/ output directories and file paths
    • relative to CCMMF_DIR set in .Renviron
    • configure whether it is a PRODUCTION run, if FALSE, it is faster
      • added associated conditionals for slow steps
  • Combine woody and herbaceous design points into single design_points.csv, added 'pft' field
  • More consistent variable names
  • Add LandIQ data summaries to 009_update_landiq.R
  • Update county-level aggregation and plotting in 040_downscale_and_aggregate.R
  • Add ALE and ICE plot generation in 041_downscale_analysis.R; add plots to reports/downscaling_results.qmd
  • Fix minor bugs and improve code style (e.g., consistent use of pkg::function() syntax)
  • Rename data_raw/anchor_sites.csv --> data_raw/anchor_site_locations.csv and data/anchor_sites_ids.csv --> anchor_sites.csv as recommended in 1b downscaling workflow workflows#2

Review Request

Please review for correctness. Feedback on this reorganization is welcome, where possible I would prefer to address these in subsequent PRs rather than holding this one up.

Compiled report for review: downscaling_results.zip


#' ## Load Site Environmental Data Covariates
#'
#' Environmental data was pre-processed in the previous workflow 00-prepare.qmd.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepare.qmd no longer exists

Copy link
Contributor Author

@dlebauer dlebauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some requested changes, defered most to next iteration - enumerated in ccmmf/organization#145

@dlebauer
Copy link
Contributor Author

dlebauer commented Jun 27, 2025

What's been improved in the calculation since 1b? How have the county maps changed or not?
My first thought is the what's-new would go in workflow_documentation.md and the discussion of what's changed would go in downscaling_results.qmd.

Great points. I will keep workflow documentation (how) and results (what) focused on the current state and then add a CHANGELOG.md + release-notes so we can track what’s new across phases. Phase 2b will compare herbaceous vs woody.

Also, I reconciled design_points.csv in 1cb2f61

@dlebauer dlebauer requested a review from infotroph June 27, 2025 15:17
### Configuration

Workflow settings are configured in `000-config.R`, except that the CCMMF_DIR is set in `.Renviron`.
<!-- TODO: check why CCMMF_DIR is handled separately;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that you necessarily want a third option, but in the workflows repo I've converged on passing all configuration variables as command-line arguments with defaults set via {optparse}. It's verbose but highly discoverable, allows overrides for any one step if needed, and forced me to actually write the help strings for everything.

Copy link
Contributor

@infotroph infotroph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see one missing comment char that'll be an error until fixed, otherwise 👍

Co-authored-by: Chris Black <chris@ckblack.org>
@dlebauer dlebauer merged commit 212815b into main Jun 27, 2025
@dlebauer dlebauer deleted the update_site_selection branch June 27, 2025 20:26
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.

3 participants