Open
Conversation
…e error messages, add guards
- cmor_mixer.py: Replace split('_') brand extraction with startswith + prefix
stripping to handle target vars containing underscores; guard empty brand
suffix; bare ValueError → informative message with target var, dim count,
available branded entries
- cmor_helpers.py: Add empty-brands-list guard at filter_brands() entry;
include has_time_bnds, input_vert_dim, candidate brands in error messages
- test_cmor_helpers.py: Update match strings for new error messages; add tests
for empty brands list, message properties in all-eliminated and
multiple-remain error paths
Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/bf9614df-0bbd-4e9b-a033-67e69d65550b
Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ilaflott/fremorizer/sessions/bf9614df-0bbd-4e9b-a033-67e69d65550b Co-authored-by: ilaflott <6273252+ilaflott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance handling of branded variable name disambiguation
Harden branded-variable disambiguations
Apr 17, 2026
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #86 +/- ##
==========================================
- Coverage 95.19% 95.14% -0.05%
==========================================
Files 10 10
Lines 1310 1318 +8
==========================================
+ Hits 1247 1254 +7
- Misses 63 64 +1
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
Describe your changes
Port of noaa-gfdl/fre-cli#832. Brand extraction used
split('_')indexing, which breaks whentarget_varcontains underscores and raisesIndexErroron non-branded MIP entries. Error messages on disambiguation failure were either empty (bareValueError) or lacked diagnostic context.Brand extraction (
cmor_mixer.py):mip_var.split('_')[0]/[1]withstartswith(target_var + '_')+ prefix stripping_)ValueError→ message with target var, dim count, available branded entriesDisambiguation errors (
cmor_helpers.py):filter_brands()entryhas_time_bnds,input_vert_dim, candidate brands, and actionable guidanceTests (
test_cmor_helpers.py):test_filter_brands_empty_brands_listtest_filter_brands_all_eliminated_message_contains_propertiestest_filter_brands_multiple_remain_message_contains_propertiesIssue ticket number and link
Checklist before requesting a review
pylintandpytestchecks are passingNote: If you are a maintainer updating the tag or releasing a new version, 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.