Skip to content

Fixes from the review of 1109f11 - #6

Merged
eliotmcintire merged 1 commit into
developmentfrom
fix/review-defects
Dec 4, 2026
Merged

eliotmcintire merged 1 commit into
developmentfrom
fix/review-defects

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

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-numeric fireField with as.numeric(as.factor(yr)), which gives codes 1..k; the earliestYear filter then set every cell to NA. Now as.numeric(as.character()), done in .readFirePolys() so the latestYear filter also compares numbers.
  • New tests in test-prepInputsFireYear-grid.R: text years (fails before the fix), fire polygons in another CRS, a RasterLayer rasterToMatch.
  • The prepInputsFireYear() example is skipped when withr is missing. replaceAgeInFires(firePerimeters) and inputsTable()'s mirror docs corrected.
  • Suggests: adds googledrive and raster (used by tests), drops httr2 (unused). Unused SCANFI v3 code removed.
  • inputs.csv: SCANFI age rows have access = restricted; inputsTable() documents the values.
  • NEWS lines for polygon = no longer partially matching, and cached calls recomputing once after the move. Version 0.0.1.9002.
  • Tests: 182 pass, 1 skipped (interactive only).

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

- 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
@eliotmcintire eliotmcintire added the bug Something isn't working label Dec 3, 2026

@achubaty achubaty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@eliotmcintire
eliotmcintire merged commit 1c066f6 into development Dec 4, 2026
10 checks passed
@eliotmcintire
eliotmcintire deleted the fix/review-defects branch December 4, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Defects found reviewing development (1109f11)

2 participants