fix(data): only rewrite the climate and carbon mirrors when the data … - #61
Merged
Conversation
…changed Both payloads carry a build timestamp, so every scheduled run produced a diff whether or not NASA, the Met Office, or NOAA had published anything. That made the "No change" branch in climate-data.yml and carbon-data.yml dead code and cost the repository a commit a month per mirror. Same guard fetch_seaice.py already uses: load the existing file, compare everything except the timestamp, return without writing if they match. The timestamp sits under "meta" in these two rather than at the top level, so it is the meta block that gets stripped for the comparison. Wrapped in try/except (OSError, ValueError) so an unreadable or non-JSON file is simply overwritten. Verified by running each script twice: the second run reports the file is already current and leaves it byte-identical. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
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.
…changed
Both payloads carry a build timestamp, so every scheduled run produced a diff whether or not NASA, the Met Office, or NOAA had published anything. That made the "No change" branch in climate-data.yml and carbon-data.yml dead code and cost the repository a commit a month per mirror.
Same guard fetch_seaice.py already uses: load the existing file, compare everything except the timestamp, return without writing if they match. The timestamp sits under "meta" in these two rather than at the top level, so it is the meta block that gets stripped for the comparison. Wrapped in try/except (OSError, ValueError) so an unreadable or non-JSON file is simply overwritten.
Verified by running each script twice: the second run reports the file is already current and leaves it byte-identical.
What & why
How to test
Checklist
npm run buildpasses locally.npx vitest runpasses (added or updated tests for new logic where it makes sense).docs/DATA_SOURCES.mdin this same PR..envconfig (a new source needing a key ships with a keyless fallback).lib/geo.ts; the globe mesh is not rotated (coordinate convention is locked).useFrameloops; heavy scenes stay dynamically imported (60fps budget on integrated graphics).The honesty rule
This project's credibility rests on one rule: every number on screen traces to a real data source or a documented calculation, and anything simulated is labeled as simulated. By opening this PR you confirm your change respects it.
Screenshots / recording