Repository navigation
outputDir can be keyed on its last folders: asPath(dir, nParentDirs) - #33
Merged
Merged
Conversation
… = FALSE) A path or core count that differs between machines made the same run a cache miss on another machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
…er's last components; drop cacheKey = FALSE An outputDir that is a shared hindcast climate folder must still miss for another folder, as a hit writes nothing there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
added a commit
that referenced
this pull request
Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
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.
The folder climate data is written to is part of the cache key, so a cache built on one computer does not match on another where the folder has a different prefix. This lets the folder be given so that only its last few components count, and documents how.
Affects: nothing changes unless a run passes the folder this way; then its event cache keys no longer hold the machine-specific prefix (they change once). Results are unchanged.
Technical details
Defect.
outputDir(canClimateData.R:45) is keyed as the character string the run passes, so the absolute path (FireSenseTesting global.R:165, from.basePath) is in the key of everyinit. The module cannot drop it: in a hindcast it is the shared<hindcast>/<ELF>/climatefolder that fireSimulator_validation reads, and an event cache hit for a new folder writes nothing there. A first version of this PR usedcacheKey = FALSE; that is reverted.Fix. No module code changes.
reproducible::asPath(dir, nParentDirs)already makes Cache digest only the lastnParentDirs + 1components of a path, and the module already uses it forclimatePathOut. A parameter given as aPathis digested that way in the event key (checked: the same<hindcast>/<ELF>/climateunder two different prefixes is one key; another hindcast is a different key; a plain absolute path is keyed in full, as before). The parameter description now says so. A run passesoutputDir = reproducible::asPath(<folder>, 2). NEWS.md has a bullet. Event keys change once for runs that switch.Reuses:
reproducible::asPath()(itsnParentDirsdigest); new: nothing (no new function or parameter; a relative-base parameter is not needed becauseasPathalready keys the relative part).Tests.
test-outputDirKey.R:Init()writes under aPathoutputDir; a stand-in module with the same parameter and a cachedinitgives one cache entry for the same relative folder under two prefixes, a second for another hindcast, a third for a plain path. These tests describe the existing mechanism, so they also pass on base code (the change here is the documented use). Full suite (convertToPackage + test_local as the testthat-module workflow; scratch library, SpaDES.core development 3.2.1.9069, climateData modsForFireSense): branch 0 failures, 0 errors, 1 skip (97 passed; the skip is the existing TODO in test-Init-layerNames.R); base 0, 0, 1 skip (92 passed).🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6