Fix 3D variable exclusion for global time series to prevent partial string matches#779
Draft
Copilot wants to merge 5 commits into
Draft
Fix 3D variable exclusion for global time series to prevent partial string matches#779Copilot wants to merge 5 commits into
Copilot wants to merge 5 commits into
Conversation
Replace simple string substitution with sed pattern matching to correctly exclude 3D variables (U, U10, V) without matching partial variable names like OMEGA500. This fixes the bug where OMEGA500,U,U10 was incorrectly becoming OMEGA50010. Co-authored-by: chengzhuzhang <13056557+chengzhuzhang@users.noreply.github.com>
Added comprehensive tests to verify that the sed-based variable exclusion correctly handles edge cases like OMEGA500,U,U10 without creating invalid variable names. Co-authored-by: chengzhuzhang <13056557+chengzhuzhang@users.noreply.github.com>
- Remove unused tempfile import - Remove unused vars_with_sed variable - Add assertion to verify non-glb behavior Co-authored-by: chengzhuzhang <13056557+chengzhuzhang@users.noreply.github.com>
- Remove duplicate mapping_file parameter - Keep test focused on non-glb behavior without area_nm param Co-authored-by: chengzhuzhang <13056557+chengzhuzhang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error caused by excluding U for glb atmosphere variable
Fix 3D variable exclusion for global time series to prevent partial string matches
Feb 10, 2026
7 tasks
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.
Summary
Objectives:
OMEGA500,U,U10→OMEGA50010Select one: This pull request is...
Small Change
Problem
When
mapping_file = "glb", the template excluded 3D variables (U, U10, V) using${vars//,U}, which removed all occurrences of the substring,U. With inputT,OMEGA500,U,U10,V, this producedT,OMEGA50010,Vinstead ofT,OMEGA500.Solution
zppy/templates/ts.bash: Replace string substitution with sed pattern matching:
Pattern
\(^\|,\)VAR\(,\|$\)matches complete tokens, not substrings.tests/test_ts_template.py: Added unit tests covering:
Original prompt
Uforglbatmsphere variable #756✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.