fix(grouping): ignore metadata keys missing from some fields when matching - #327
Open
NRaoult wants to merge 1 commit into
Open
fix(grouping): ignore metadata keys missing from some fields when matching#327NRaoult wants to merge 1 commit into
NRaoult wants to merge 1 commit into
Conversation
…ching GroupByParam groups fields by their full MARS namespace metadata, so fields from GRIB1 files without ECMWF local definitions (missing class/type/stream/expver, e.g. IFS climate files such as climate.v015/95_4/sfc) could never be matched with GRIB2 fields that carry those keys. This broke MatchingFieldsFilter subclasses like land_parameters when joining such files. Keys that are not present in every candidate field are now ignored for grouping (with a warning), while keys present in all fields still separate groups as before. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
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
GroupByParam(used by allMatchingFieldsFiltersubclasses, e.g.land_parameters) groups fields by their full MARS-namespace metadata. Fields read from GRIB1 files without ECMWF local definitions (e.g. IFS climate files such asclimate.v015/95_4/sfc) have noclass/type/stream/expverkeys, so they could never land in the same group as GRIB2 fields that carry those keys, and matching failed withMissing component. Want ['slt', 'tvh', 'tvl'], got ['slt'].GroupByParamandGroupByParamVertical; regression tests added.Motivation
Building
aifs-l5-an-oper-0001-mars-o96-1979-2024-6h-v1-landfailed in theland_parametersfilter when joiningrepeated_datessources fortvh/tvl(GRIB1,climate.v015/95_4/sfc) withslt(GRIB2,climate.v015/95_4/slt). Verified end-to-end with those files: the filter now produces all eight derived parameters, with a warningIgnoring metadata keys not present in all fields when grouping: ['class', 'domain', 'expver', 'stream', 'type'].🤖 Generated with Claude Code