Skip to content

Croparea update - #206

Draft
FelicitasBeier wants to merge 34 commits into
pik-piam:masterfrom
FelicitasBeier:cropareaUpdate
Draft

Croparea update#206
FelicitasBeier wants to merge 34 commits into
pik-piam:masterfrom
FelicitasBeier:cropareaUpdate

Conversation

@FelicitasBeier

Copy link
Copy Markdown
Contributor

replace croparea with LandInG croparea and LUH3 with LanduseInitialisation

bodirsky and others added 23 commits March 4, 2026 15:56
…ropareaUpdate

# Conflicts:
#	.buildlibrary
#	CITATION.cff
#	DESCRIPTION
#	README.md
…ropareaUpdate

# Conflicts:
#	.buildlibrary
#	CITATION.cff
#	DESCRIPTION
#	README.md
…ropareaUpdate

# Conflicts:
#	.buildlibrary
#	CITATION.cff
#	DESCRIPTION
#	README.md
Merge branch 'master' into cropareaUpdate

# Conflicts:
#	.buildlibrary
#	CITATION.cff
#	DESCRIPTION
#	README.md
Merge branch 'master' into cropareaUpdate

# Conflicts:
#	.gitignore
Merge branch 'master' into cropareaUpdate

# Conflicts:
#	.gitignore
Merge branch 'master' into cropareaUpdate

# Conflicts:
#	DESCRIPTION
@bodirsky

This comment was marked as resolved.

bodirsky and others added 7 commits August 7, 2026 12:10
The roxygen line read "LandIng Toolbox of FAOLUH", naming a value
("Toolbox") that calcCroparea does not accept and misspelling LandInG.
areaSource is passed straight to calcCroparea(datasource = ), which takes
only "LandInG" and "FAOLUH".

Document both accepted values and note that the former default "FAO" is no
longer accepted. Documentation only; no code change.

man/calcFAOYield.Rd is generated and stays stale until the next
lucode2::buildLibrary() run.

Addresses review finding m6.
Lines 25 and 26 were blank lines containing four spaces each, which lintr
flags (trailing_whitespace_linter). Whitespace removed on those two lines
only; the file is otherwise untouched and no other file was reformatted.

Addresses review finding m10.
… (m2)

The aggregated branch built its kcr -> all mapping with a hardcoded
rep("all", 19). The croparea weight now passes fallow = TRUE, and the
IPCC source SCF_sub2019_2 (ch5_F_LU_2019_2.csv) carries 20 crop columns
including fallow, so the literal was stale: data.frame() would have
errored on 20 names against 19 rows.

Use length(getNames(socLossShare)) so the mapping follows the actual crop
set rather than a number that has to be maintained by hand.

Latent, not a live failure: no current caller passes
subsystems = "aggregated" (calcSOM uses TRUE, the mrmagpie callers use
the default FALSE), so the branch is unreachable today.

Addresses review finding m2.
Merge branch 'master' into cropareaUpdate

# Conflicts:
#	.buildlibrary
#	CITATION.cff
#	DESCRIPTION
#	R/readWCDE.R
#	README.md
@FelicitasBeier

Copy link
Copy Markdown
Contributor Author

All issues raised by AI reviewer have been addressed. I will mark the comment as "resolved" to not confuse human reviewers.

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.

4 participants