Repository navigation
Year climate term: same yearly mean as the fit, input checks - #48
Merged
Merged
Conversation
… beta, norm, NA handling, more tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…out coreFraction Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…reFraction, level helper, warnings Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…nd after na.omit Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
that referenced
this pull request
Nov 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follow-up makes the prediction use exactly the same "how dry was the year" number as the fit, and checks its inputs. Before, the two could differ and shift every year's predicted ignitions by the same factor.
Affects: predicted ignitions for fits with a year climate term; fits without one are unchanged.
Depends-on: PredictiveEcology/fireSenseUtils#254
Depends-on: PredictiveEcology/fireSense_dataPrepPredict#51
Technical details
yearClimateMultiplierOf()(fireSense_ignitionPredict.R) now callsfireSenseUtils::yearClimateMeans(covariates, variable), the fit's own definition (unweighted mean over rows where the variable is not NA andcoreFractionis above 0). The predict covariates now carrycoreFractionfrom fireSense_dataPrepPredict (its PR; without it the mean would include the buffer). The mean is taken from the covariates beforena.omit(), for the pixels of the fit's ELF (the ELF assignment is made once, on the table beforena.omit(), and each fit keeps its rows both before and after it, so the raster post-process runs once per prediction), so a pixel with an NA in an unrelated column still counts, as in the fit. It stops if the fit has the term and the covariates have nocoreFraction; it stops if the covariates hold more than one year or lack the stored variable, and gives 1 with a warning if the year has no usable row. The storednormis applied byyearClimateMultiplier(). FloorfireSenseUtils >= 0.2.3.9183.Reuses:
fireSenseUtils::yearClimateMeans(),yearClimateMultiplier(); new: nothing.Tests: full suite branch 139 pass, 0 fail; base (development) 120 pass, 0 fail. New: the post-process runs once; NA in an unrelated column (single and multi ELF); stops without
coreFraction; real boosters predict covariates with the extra column andscaleAsFit()leaves it; definition matches the fit (core and NA rows), several ELF fits each with their own term or none, missing variable, two years, no year column, empty year,rescaleVars = FALSE,norm.Known limitation: with several ELFs, predict assigns each coarse pixel to an ELF by its centre, while the fit's table includes pixels that are only partly core, so the two yearly means can differ slightly at the ELF edges. A small constant offset of that kind is left in multi-ELF predictions.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh