Fix logic to determine non-desired variables in split-vars#864
Fix logic to determine non-desired variables in split-vars#864
Conversation
The existing logic used both known patterns and a list of variables whose number of dimensions look like metadata. The problem was that the matching logic was applied to the patterns, which was fine, but also the "short var" list, e.g. "a" and "b". This caused any variable with "b" such as "drybc" to be excluded from the output.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
==========================================
+ Coverage 84.14% 84.15% +0.01%
==========================================
Files 71 71
Lines 4975 4981 +6
==========================================
+ Hits 4186 4192 +6
Misses 789 789
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
cwhitlock-NOAA
left a comment
There was a problem hiding this comment.
So to make sure I'm understanding the problem...
Formula terms like "a" and "b" that have a single dimension were previously getting classified as shortvars_to_exclude and then added to the VAR_EXCLUDE_PATTERNS, which lead to all variables with an a or a b in the string to be classed as metadata-like variables. The solution was to say that we wanted different levels of pattern-matching for the VAR_EXCLUDE_PATTERNS and the shortvars_to_exclude - VAR_EXCLUDE_PATTERNS should be a pattern-matching and shortvars_to_exclude is an exact match.
This looks perfectly reasonable given my understanding of what's going on - I might want to add a bit more documentation on the var classification, but that's a separate PR.
and added inline docs (reviewer feedback)
…it_file_xarray where it is used
…ariable output files.
The existing logic used both known patterns and a list of variables whose number of dimensions look like metadata. The problem was that the matching logic was applied to the patterns, which was fine, but also the "short var" list, e.g. "a" and "b". This caused any variable with "b" such as "drybc" to be excluded from the output.
Describe your changes
Issue ticket number and link (if applicable)
Fixes #862 (replace XXX with the issue number and GitHub will autolink the PR to the issue)
Checklist before requesting a review
Note: If you are a code maintainer updating the tag or releasing a new fre-cli version, please use the
release_procedure.mdtemplate. To quickly use this template, open a new pull request, choose your branch, and add?template=release_procedure.mdto the end of the url.