Skip to content

add ca fertilization harmonization and ncc compost support - #4002

Merged
dlebauer merged 117 commits into
PecanProject:developfrom
divine7022:ncc-compost
Jul 29, 2026
Merged

add ca fertilization harmonization and ncc compost support#4002
dlebauer merged 117 commits into
PecanProject:developfrom
divine7022:ncc-compost

Conversation

@divine7022

@divine7022 divine7022 commented May 18, 2026

Copy link
Copy Markdown
Member

Updated description (following review + major revisions)

Description

Adds reproducible California nitrogen-fertilization and organic-amendment reference datasets to PEcAn.data.land.

The PR includes curated source TSVs, harmonization scripts, packaged datasets, lookup functions, documentation, and data-validation checks. It adds:

  • ca_n_application_rate
  • ca_organic_amendment_properties
  • ca_organic_amendment_app_rate

Opinionated priors, samplers, and the proposed ncc event-schema changes were removed; workflow-specific sampling remains downstream in #4003.

Motivation

Moves the previously external harmonization workflow into the repository so the datasets can be reviewed and rebuilt from a clean checkout.

Type of change

  • New feature

Checklist

  • Documentation updated
  • Data provenance and update procedure documented
  • Validation checks added
  • Dependency metadata regenerated

Original description

Description

folds standalone N fertilization harmonization (was living at /projectnb/dietzelab/ccmmf/management/fertilization/harmonization.R) into data.land data-raw pipeline, then layers ncc (compost) sampling support on top and extends the events schema with an ncc event type

events_schema_v0.1.2.json picks up ncc as an allowed event_type with material, ncc_subtype, fert_subtype, and pft properties

separate workflow PR will consume these samplers from workflows/fertilization-statewide and workflows/ncc-statewide to emit ensemble events

cc @sarahkanee @mdietze @infotroph @dlebauer

Motivation and Context

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@divine7022

divine7022 commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

quick context first, since this turned into a structural change. where we started, the build scripts here were reading the curated fertilization data straight from Mike's team's spreedsheet, and doing the harmonization in place mapping the source URLs to citations, the unit conversions, the property vs rate columns, the material classes. So the .rda we shipped was harmonized version, but all that harmonization logic was baked into package build

per discussion, now I flipped it. harmonization moved out to a standalone harmonize_fertilization_data.R on SCC. It reads original TSVs and writes already harmonized CSVs, those CSVs land in data-raw/, and create_*.R scripts just read them and call use_data(). No curation left in the package, it's purely packaging clean data now. That's the "no manual curation step, provenance is the R script" case you pointed at

regarding docs, rewrote the roxygen for all three datasets, and added a data-raw/README.md covering where the raw sheet comes from, the curation decisions, and how to update

Make sure naming is consistent, e.g. create_n_rate_data.R reads a file n_fertilizaton.tsv and generates a dataset ca_n_application_rate. This can get confusing.

consider renaming compost.tsv to organic_ammendments.tsv to bettr reflect the diversity of materials represented in the dataset.

corrected, and went past the rename. now names lines up: ca_n_application_rate.csv, create_ca_n_application_rate.R, ca_n_application_rate, same for amendments. I have dropped compost.tsv, instead of just renaming it I split it into ca_organic_amendment_properties and ca_organic_amendment_app_rate (more in ^^ thread) and dropped "compost" name since the table's mostly manure, straw, wood chips, paper, blood meal

Comment thread modules/data.land/data-raw/README.md Outdated

@dlebauer dlebauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few requests on writing style left as comments and as Slack DM.

@mdietze

mdietze commented Jul 24, 2026

Copy link
Copy Markdown
Member

@dlebauer @infotroph would be great to get this through review so we can get 4003 (which depends on this) and 4050 (which depends on 4003) reviewed as well

@dlebauer dlebauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Requested changes have been substantially addressed. Thank you for your work on this and patience with the review!

@dlebauer
dlebauer dismissed infotroph’s stale review July 29, 2026 22:33

Requested changes have been implemented in subsequent commits, including removal of the opinionated priors and samplers and separation of amendment properties from application rates. Dismissing this review as outdated.

@dlebauer
dlebauer added this pull request to the merge queue Jul 29, 2026
Merged via the queue into PecanProject:develop with commit 065d7fc Jul 29, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants