Repository navigation
Key the climate cache on the shared outputDir when it is set - #32
Open
eliotmcintire wants to merge 1 commit into
Open
eliotmcintire wants to merge 1 commit into
eliotmcintire wants to merge 1 commit into
Conversation
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.
A shared climate folder set for hindcasts was never used: every year job restored its own 3.2 GB copy of the climate rasters instead. This makes the cached result depend on that folder when one is set, so the files land in it.
Affects: runs that set
outputDirnow write and reuse the climate rasters there; runs that leave it unset behave as before.Technical details
Defect:
canClimateData.RInit(), theprepClimateLayers() |> Cache(omitArgs = c("srcdir", "dstdir"))call (line ~279).dstdirwas always omitted from the key, so an entry made with the per-run folder (outputPath(sim)/climate) was hit whenoutputDirpointed at a shared folder. reproducible then restores file-backed rasters relative to the run'soutputPath, so the shared folder was created but stayed empty. reproducible behaves as designed.Fix:
sharedOutis computed once (the existing is.null/is.na test onP(sim)$outputDir), used forclimatePathOutand foromitArgs = c("srcdir", if (!sharedOut) "dstdir"). UnsetoutputDirkeeps the relocatable default. NEWS entry added; no version bump.With
outputDirset the key holds that absolute path, so a cache entry is per machine and moving the folder recomputes once; concurrent jobs wait on the per-key Cache lock, so one computes.Reuses: the existing
outputDiris.null/is.na test (nowsharedOut) and the existingcacheCallsOfhelper intest-cacheOmitArgs.R; new: nothing (no new function).Tests:
test-cacheOmitArgs.Revaluates the call'somitArgswithsharedOutFALSE (both folders omitted, all formals) and TRUE (dstdirkeyed,srcdiromitted). Full module suite viatestthat::test_dir, with the module folder named canClimateData: base 30 tests, 1 failure (the new test); branch 30 tests, 0 failures, 1 skip.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6