Read coupled components from output_active to avoid stale-file stitch error#68
Merged
Merged
Conversation
… error `discover_components` built each component's `SimDir` from the component root (e.g. `clima_atmos/`). Because `ClimaAnalysis.SimDir` enumerates files with `walkdir`, a component folder that held both the current run's `output_active`/`output_NNNN` subfolder and stale loose `.nc` files left at the top level from an earlier run picked up each variable twice and tried to stitch their overlapping time axes, failing with "Time dimension is not in non-decreasing order after aggregating datasets". Add `_resolve_sim_path`, which points the `SimDir` at `output_active` (or the highest-numbered `output_NNNN`) when present and otherwise reads the folder itself (land/ocean write loose files with no `output_*` subdir). The component `path` field stays the folder root so the `.climaviz_cache` location is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AlexisRenchon
force-pushed
the
fix/coupler-output-active-stitch
branch
from
June 15, 2026 17:14
71315d3 to
51e6a2f
Compare
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.
Problem
The
/amipcoupled dashboard crashed on load with:discover_componentsbuilt each component'sSimDirfrom the component root (e.g.clima_atmos/). BecauseClimaAnalysis.SimDirenumerates files withwalkdir(recursing the whole tree), a component folder that held both the current run'soutput_active/output_NNNNsubfolder and stale loose.ncfiles left at the top level from an earlier run picked up each variable twice and tried to stitch their overlapping time axes — failing in_get_time_name_from_mfds.In the affected run,
clima_atmos/had 80 leftover top-level.ncfiles (older runs) alongside the current run inoutput_0000/. Components that write loose files with nooutput_*subdir (land/ocean/coupler) were never affected, which is why/land_longrunworked.Fix
Add
_resolve_sim_path, which points each component'sSimDiratoutput_active(or, failing that, the highest-numberedoutput_NNNN) when present, and otherwise reads the folder itself. The componentpathfield stays the folder root, so the.climaviz_cachelocation is unchanged.Tests
_resolve_sim_path: loose-files /output_activesymlink / numbered-dirs casesdiscover_components: asserts stale top-level files are ignored whenoutput_activeexistsAll coupler + summary tests pass locally.
🤖 Generated with Claude Code