Repository navigation
climateYear: per-year .vrt instead of .tif copy; record climate used (climateYearsUsed); fix single-year samplingRange - #3
Closed
eliotmcintire wants to merge 6 commits into
Closed
eliotmcintire wants to merge 6 commits into
eliotmcintire wants to merge 6 commits into
Conversation
…r year Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
… year's file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
…if copy; record source md5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
…rsUsed.csv every year Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
The per-repo copy pinned actions@v0.2 and ran install-Rmd-pkgs (which calls Require::) before install-Require, so the job failed with 'there is no package called Require' (also on the previous PR). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
achubaty
pushed a commit
to FOR-CAST/climateYear
that referenced
this pull request
Oct 5, 2026
…rFireSense climateYear: per-year .vrt instead of .tif copy; record climate used (climateYearsUsed); fix single-year samplingRange Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
achubaty
added a commit
to FOR-CAST/climateYear
that referenced
this pull request
Oct 5, 2026
…ctiveEcology#3 (reqdPkgs; per-year file leak, sampleYear)
Contributor
Author
|
Closing: this change is carried on |
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.
Each simulated year used to make a large copy of its climate data and kept no record of which historical year was used. It now writes a tiny pointer file instead and keeps a table of which climate year was used for each simulated year, so runs can be traced and checked later. It also fixes a bug where asking for one specific climate year gave a random different year.
Affects: much less disk use per run, a new record of the climate years used, and correct results when a single climate year is requested.
Technical details
The
getClimateevent (climateYear.R:98-102on development) wrote each year'scurrentClimateRastersto a ~72 MB.tifcopy next to the shared source stacks and kept no record of which source layer it came from. It now writes a ~1 KBclimate_simYear<sim year>_climYear<climate year>.vrtper simulation year tooutputPath(sim)/climate/(one band per variable, absolute source paths, so a reused climate year still gets its own file), readscurrentClimateRastersfrom it, and records one row per simulation year and variable (climate year, historical or projected, source file, source md5 computed once per file per run, layer,.vrtpath) in a new outputclimateYearsUsed. That table is rewritten toclimateYearsUsed.csvinoutputPath(sim)every year, to a temporary file then renamed, so a killed run keeps every finished year and a restart does not duplicate rows (appending could do both); sources that are not single files on disk still fall back to a.tif. It also fixessampleYear()(climateYear.R:156):sample(Range, size = 1)draws from1:Rangefor a single-yearsamplingRange, so2003returned e.g. 1974; it now usesRange[sample.int(length(Range), 1L)]. New tests (fail on development) check the expected.vrtper simulation year, CSV rows equal to the table, values/names/extent/crs equal to a copy at tolerance 0, a freshcallrprocess recovering each year's climate from the CSV and.vrtalone, md5s,.robustDigest()differing by year and matching for a rebuilt VRT, and a single-year range.The Rmd render job was red on this and the previous PR because the repo's own copy of the workflow (pinned to actions@v0.2) called
Require::before installing Require; it now calls the org's sharedrender-module-rmd.yaml@main, like the fireSense modules.🤖 Generated with Claude Code
https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv