You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #619 (edu/polycell-spatial-support) reports its spatialize movement as
"zero — enforcement only", and that is accurate about the engine: commit de9867a6 turns .normalize_country_grid()'s missing-share default into an
abort, removes landfrac from the alias list, and makes .compartment_join_cols() refuse to degrade to a (lon, lat) join.
What it does not do is change which table the engines are fed. On that
branch, R/run_spatialize.R is a 3-line docs-only diff, and .load_landuse_inputs() / .load_livestock_inputs() still read the spatialize-country-grid pin — a 58,795-row centroid grid with lon, lat, area_code and no share column. That is exactly the input the same PR
teaches the engine to abort on, so once #619 lands, run_spatialize() against the deployed pin aborts at .normalize_country_grid().
Two things have to meet for that not to happen:
A grid with a share column has to be reachable from the loaders.Feed crop/livestock spatialize the fractional cell-coverage grid, not the centroid grid #461
added the seam: .load_country_grid(input_dir, source) in R/run_spatialize.R, selected by run_spatialize(overrides = list(country_grid = ...)), today "centroid"
(default) or "fraction". Adding "polycell" is one branch plus a reader — build_polycell_support() / read_polycell_support() on that branch — and
the resolved choice already lands in run_metadata.yaml.
The polycell pin has to exist.inst/extdata/whep_inputs.csv on that
branch carries polycell_support with an empty version, so it is
declared and not uploaded.
Also worth wiring at the same seam: the polycell is keyed on polity_code, not area_code, while both spatialize engines allocate from national tables keyed
on area_code. #619's own body says "consumers convert at their own boundary",
so that conversion belongs in .load_country_grid(), where it is visible at a
join, rather than inside the engine.
Acceptance criteria
run_spatialize(overrides = list(country_grid = "polycell")) runs end to end.
The default path is unchanged, or changed deliberately with the movement
measured per the epic's grid note (per-(country, crop, year) L1 over
normalised cell-share vectors, plus the change in compartments receiving an
allocation — a totals diff proves nothing, because R/spatialize.R rescales
back to the national target).
PR #619 (
edu/polycell-spatial-support) reports its spatialize movement as"zero — enforcement only", and that is accurate about the engine: commit
de9867a6turns.normalize_country_grid()'s missing-share default into anabort, removes
landfracfrom the alias list, and makes.compartment_join_cols()refuse to degrade to a(lon, lat)join.What it does not do is change which table the engines are fed. On that
branch,
R/run_spatialize.Ris a 3-line docs-only diff, and.load_landuse_inputs()/.load_livestock_inputs()still read thespatialize-country-gridpin — a 58,795-row centroid grid withlon,lat,area_codeand no share column. That is exactly the input the same PRteaches the engine to abort on, so once #619 lands,
run_spatialize()against the deployed pin aborts at.normalize_country_grid().Two things have to meet for that not to happen:
added the seam:
.load_country_grid(input_dir, source)inR/run_spatialize.R, selected byrun_spatialize(overrides = list(country_grid = ...)), today"centroid"(default) or
"fraction". Adding"polycell"is one branch plus a reader —build_polycell_support()/read_polycell_support()on that branch — andthe resolved choice already lands in
run_metadata.yaml.inst/extdata/whep_inputs.csvon thatbranch carries
polycell_supportwith an empty version, so it isdeclared and not uploaded.
Also worth wiring at the same seam: the polycell is keyed on
polity_code, notarea_code, while both spatialize engines allocate from national tables keyedon
area_code. #619's own body says "consumers convert at their own boundary",so that conversion belongs in
.load_country_grid(), where it is visible at ajoin, rather than inside the engine.
Acceptance criteria
run_spatialize(overrides = list(country_grid = "polycell"))runs end to end.measured per the epic's grid note (per-
(country, crop, year)L1 overnormalised cell-share vectors, plus the change in compartments receiving an
allocation — a totals diff proves nothing, because
R/spatialize.Rrescalesback to the national target).
.warn_grid_missing_reporters()(Feed crop/livestock spatialize the fractional cell-coverage grid, not the centroid grid #461) reports no new deleted reporting areaunder the polycell than under the centroid grid.
Depends on: #619 landing, and the
polycell_supportpin being uploaded.Moves published values: only if the default is changed.
Part of the polity migration epic #458.