Repository navigation
Fixes from the review of 1109f11 - #6
Conversation
- prepInputsFireYear(): a fire year stored as text is read as the year (as.factor() gave codes 1..k, so the map was all NA); coercion moved into .readFirePolys() so the latestYear filter compares numbers - tests: text years, fire polygons in another CRS, RasterLayer rasterToMatch - example skipped without withr; firePerimeters docs; mirror docs - Suggests: + googledrive, raster (tests); - httr2 (unused) - drop unused SCANFI v3 code - inputs.csv: SCANFI age rows access = restricted - NEWS: polygon= partial match, one-time cache recompute Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3
achubaty
left a comment
There was a problem hiding this comment.
Checked against development at fdbe774. The fireField fix is right, and coercing in .readFirePolys() puts it ahead of the latestYear filter for both prepInputsFireYear() and prepInputsDisturbanceYear(). The new tests cover the text-year, other-CRS and RasterLayer paths that had none, and CI passes on all 8 legs.
One small point, not blocking: scanfiUrlRemap() builds its remap from arbutus_manifest_SCANFI_v2.csv, not from the mirror column of inputsTable(); the column is a copy that test-inputs.R checks against the manifest. Suggested wording: "mirror (a public copy of url; the SCANFI readers reach the same copy through [scanfiUrlRemap()], which reads the mirror's manifest)". That roxygen line is also 112 characters and could wrap with its neighbours.
This fixes the problems Alex found reviewing forestInputs. One is a real bug: a fire map whose years are stored as text came out entirely empty. The rest are documentation, dependency and test gaps.
Affects: fire maps built from a polygon file with text years now have their fires; nothing else changes results.
Technical details
prepInputsFireYear()coerced a non-numericfireFieldwithas.numeric(as.factor(yr)), which gives codes 1..k; theearliestYearfilter then set every cell to NA. Nowas.numeric(as.character()), done in.readFirePolys()so thelatestYearfilter also compares numbers.test-prepInputsFireYear-grid.R: text years (fails before the fix), fire polygons in another CRS, a RasterLayerrasterToMatch.prepInputsFireYear()example is skipped when withr is missing.replaceAgeInFires(firePerimeters)andinputsTable()'smirrordocs corrected.inputs.csv: SCANFI age rows haveaccess = restricted;inputsTable()documents the values.polygon =no longer partially matching, and cached calls recomputing once after the move. Version 0.0.1.9002.With #3, this closes #4, except the SCANFI mirror split, which goes in PredictiveEcology/LandR#302.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXfVqAugcusGHygZGJ3