Support multiple time variable formats when extracting valid time#22
Open
mkavulich wants to merge 2 commits into
Open
Support multiple time variable formats when extracting valid time#22mkavulich wants to merge 2 commits into
mkavulich wants to merge 2 commits into
Conversation
Add get_timestrings() helper that tries three methods in order: 1. xtime character array (standard MPAS history files) 2. CF-compliant Time variable with "X since YYYY-MM-DD HH:MM:SS" units 3. Datetime parsed from filename (e.g. diag.2025-06-07_00.00.00.nc) Falls back to a dummy time value if all methods fail. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2049d22 to
049ec5c
Compare
Move time-solving logic into open_ux_subset() so each file's time is extracted before concatenation, when the per-file path is still available. Synthesizes xtime from CF Time variable or filename for files that lack it, ensuring downstream code always finds xtime populated correctly for every time step. Dummy fallback now generates unique timestamps per file to prevent output overwrites. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.
Add get_timestrings() helper that tries three methods for determining the time of MPAS data in order:
Finally, it falls back to a dummy time value if all methods fail (the previous behavior)
This code was generated with the help of Claude Code Sonnet 4.6, with all lines reviewed by me.