Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# fireSense_dataPrepFit (development version)
# fireSense_dataPrepFit 1.3.0.9010 (development version)

- R CMD check of the module's package form has no notes: `NEWS.md` had two "(development version)" headings and none with a version, so it could not be parsed (one heading now, with the version), undefined names are declared (`R/globals.R`), and `methods`, `stats` and `utils` are in `reqdPkgs` for `is()`, `setNames()`, `var()`, `getFromNamespace()` and `modifyList()`. No change to results. One check warning remains: `SpaDES.core::convertToPackage()` writes `import()` for every `reqdPkgs` entry, so the whole-package imports clash ("replacing previous import").

- Fixed: `.inputObjects` (1-2 h of data preparation per ELF) was redone whenever the SpreadFit ledger changed, e.g. when any ELF's fit landed, because `spreadFitPreRun` was declared as an input and `fireSense_ELFs` puts the whole ledger in the simList before `.inputObjects` runs. It is now an output only. `.inputObjects` never reads it; `Init()` always assigns it (this study area's rows from `CacheGeo`, or `NULL`), and `dataPrepBuild`, `prepIgnitionFitData`, `prepEscapeFitData` and `prepSpreadFitData` key on it through `.useCacheArgs`, so a new fit of this study area still re-runs them and a cached event cannot restore an old row. Results are unchanged; the `.inputObjects` key changes once.

Expand Down Expand Up @@ -54,8 +56,6 @@ Several errors are fixed that could quietly feed a fit the wrong data: neighbour
`fireSense_ignitionPredict` stopped with "column not found: [nf]".
- `youngAge` is resolved for each fire year, as it was before February 2026, instead of once per data year. `prepare_SpreadFit()` builds the fuels with `fireSenseCovariatesCreate(youngAge = FALSE)` (no `youngAge`, nothing zeroed at the data year) and puts `youngAge` in each fire year's annual table from `fireSenseUtils::youngAgeAtYear()`: the data year's time since disturbance aged to that year, reset by every fire since (all of `firePolysForAge`, not only the fitted buffers); `NA` time since disturbance is not young. `prepare_IgnitionFit()` does the same for the ignition (and escape) covariates with `fireSenseUtils::prepare_FuelCovsCoarseByYear()`, aggregating the per-year values to the `igAggFactor` grid. `nonForestCanBeYoungAge = FALSE` now stops in both. Needs the `fireSenseUtils` change in PredictiveEcology/fireSenseUtils#119 (floor to be set once it has a version). Spread and ignition fits made with the data-year `youngAge`, and cached `prepSpreadFitData` and ignition covariates, are invalid.

# fireSense_dataPrepFit (development version)

- The pooled `other_agb` spread covariate is gone and `fuelCovariates = "domSecOther"` is renamed `"domSecWetland"` (now the default): spread fuels are `dom_agb_<class>`, `sec_agb_<class>` and `treedWetland_agb`. Needs the `fireSenseUtils` change that renames the value (PredictiveEcology/fireSenseUtils#116). Spread fits made with `other_agb` need refitting, and cached `prepSpreadFitData` results change.

- New parameter `heldOutFold` (`NA`, `1` or `2`; the same parameter as in `fireSense_spreadFit`). With `1` or `2`, `Init()` does not read the SpreadFit ledger: `sim$spreadFitPreRun` stays NULL and `mod$haveSpreadFit` is FALSE, so the fold derives its own species, fuel and climate objects. `paramCheckOtherMods()` stops if `fireSense_spreadFit` has a different value; set all three modules with `.globals = list(heldOutFold = ...)`.
Expand Down
6 changes: 6 additions & 0 deletions R/globals.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Names that R CMD check cannot see: `Par` is defined in the module's environment by SpaDES.core, the
## rest are data.table columns used in `[` calls, or objects `list2env()` puts in the function environment.
## (Called without `utils::` because tests that read module code take the head of every top-level call as a name.)
globalVariables(c(".", "B", "FuelClass", "Par", "age", "assignedFuelClass", "auc", "burned", "cell",
"chosen", "i.FuelClass", "lcc", "mod", "newLCC", "nonForestedLCCGroups", "pixelID",
"pixelIndex", "rho", "species", "speciesCode", "sppEquiv", "totalBiomass", "var"))
2 changes: 1 addition & 1 deletion fireSense_dataPrepFit.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defineModule(sim, list(
"PredictiveEcology/climateData@development (>= 2.2.3.9006)",
"PredictiveEcology/fireSenseUtils@development (>= 0.2.3.9100)", # dataYearBefore(), dataYearElement(before =); defaultFireYears() from 1986
"FOR-CAST/fireregimetools@main (>= 0.1.0.9008)",
"ggplot2", "parallel", "purrr", "raster", "sf", "sp",
"ggplot2", "methods", "parallel", "purrr", "raster", "sf", "sp", "stats", "utils",
"PredictiveEcology/LandR@development (>= 1.2.0.9015)",
"PredictiveEcology/SpaDES.core@development (>= 3.2.1.9037)",
"PredictiveEcology/SpaDES.project@development",
Expand Down
Loading