Skip to content

ELFlabels() uses the shared cell-label lookup of fireSenseUtils - #48

Merged
eliotmcintire merged 3 commits into
developmentfrom
climateSplit
Nov 21, 2026
Merged

eliotmcintire merged 3 commits into
developmentfrom
climateSplit

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Two modules each had their own copy of the code that reads which region each map cell belongs to. This makes them use one shared copy.

Affects: no change to results, except that the list of regions a map labels now holds only regions that have at least one cell (before, an unused category in the map's table was included).

Depends-on: PredictiveEcology/fireSenseUtils#244

Technical details

Part of the split-climate change (PredictiveEcology/fireSenseUtils#244, PredictiveEcology/fireSense_dataPrepFit#108, PredictiveEcology/fireSense_spreadFit#132, PredictiveEcology/fireSense_spreadPredict#44). ELFlabels() (fireSense_dataPrepPredict.R) and ELFblendWeights() in fireSense_spreadPredict each looked up the ELF of a cell from rasterToMatchLargeELF (category labels, else the values). The lookup now lives once in fireSenseUtils::elfCellLabels(), and ELFlabels() is unique() of it without NA. The one behaviour change: a category with no cell used to be returned by ELFlabels() (it read the levels table) and no longer is; placeableELFs is only used with %in%.

Reuses: fireSenseUtils::elfCellLabels(); new: nothing.

Test: test-ELFlabels.R (NULL, plain values, categorical labels, no NA). Full suite (convertToPackage() copy, fireSenseUtils with the branch installed in a scratch library): base (development 1.1.0.9014) 0 failures, 0 errors, 0 skips, 419 passed; branch 0 failures, 0 errors, 0 skips, 422 passed. On base the new test fails (elfCellLabels() does not exist).

No version bump. The reqdPkgs floor on fireSenseUtils is 0.2.3.9186, the version fireSenseUtils#244 will have once it merges (development is at 9184; if another fireSenseUtils PR merges first, the floor is raised to match). Until then CI installs 9184, so the Depends-on line is what holds this PR back.

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

@eliotmcintire eliotmcintire added enhancement New feature or request backwards compatible Existing code and results keep working unchanged labels Nov 17, 2026
@eliotmcintire eliotmcintire reopened this Nov 21, 2026
@eliotmcintire
eliotmcintire merged commit e2216b6 into development Nov 21, 2026
18 of 20 checks passed
@eliotmcintire
eliotmcintire deleted the climateSplit branch November 21, 2026 14:25
eliotmcintire added a commit that referenced this pull request Nov 21, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant