Skip to content

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

Open
eliotmcintire wants to merge 1 commit into
developmentfrom
climateSplit
Open

eliotmcintire wants to merge 1 commit into
developmentfrom
climateSplit

Conversation

@eliotmcintire

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 on the branch: 0 failures, 0 errors, 0 skips, 398 passed. On base (origin/development with the new test copied in): 1 failure (the new test), 0 errors, 0 skips, 397 passed.

No version bump. The reqdPkgs floor on fireSenseUtils is set after #244 merges and its version is bumped.

🤖 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

This branch has not been deployed

No deployments
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