add ca fertilization harmonization and ncc compost support - #4002
Conversation
|
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
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 |
dlebauer
left a comment
There was a problem hiding this comment.
A few requests on writing style left as comments and as Slack DM.
|
@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
left a comment
There was a problem hiding this comment.
Requested changes have been substantially addressed. Thank you for your work on this and patience with the review!
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.
065d7fc
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_rateca_organic_amendment_propertiesca_organic_amendment_app_rateOpinionated priors, samplers, and the proposed
nccevent-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
Checklist
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
Types of changes
Checklist: