-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging attributes of different cubes before concatenation/merging #5050
Comments
From offline "peloton" discussions ...
|
@schlunma Thanks for raising this issue 👍 In general, Just to get people thinking about this in a general way... for example, what if we were to expose a callback-like capability to Clearly, needs a lot of thought, but to me, without thinking about this too deeply, seems attractive in principle. The mechanics of how that's implemented is a separate concern, but at the moment I'm more interested to know whether such a capability would have genuine user benefit. Just a thought... |
Re: @bjlittle "The difference is that the callback on load only sees one cube" That's nice, but the proposed form still only deals with cubes 2 at a time. I certainly do agree that it makes sense to apply an operation to a specific attribute, as suggested -- ? or a set of them, somehow?. But anyway control it somehow : Applying it regardless to all attributes will be liable to mess up anything with controlled meaning (i.e. not CF terms, which Iris excludes from user attributes, but terms with meaning according to "some other conventions", like for a data repository) One thing that also bothers me is that with multiple cubes (>=3), it's not too clear whether for general purposes we would always want to form a list of content options, or just make an entry for each distinct value (i.e. a "set" approach), |
Thanks all for having a look at this! 3 points from our (ESMValTool) perspective:
|
I had -- and still have -- a use case very similar to the what @schlunma describes (and that is why |
✨ Feature Request
Cube concatenation and merging fails if the cubes contain different attributes. A possible way out of this is
iris.util.equalise_attributes
, which simply deletes attributes that are not identical across cubes.An alternative approach could be to "merge" attributes that differ, e.g., combine them in a single string with a given delimiter, e.g,
" "
.Example
Merge the attributes
exp: historical
andexp: ssp585
toexp: historical ssp585
.I can image three possible locations for code like this:
util
module, e.g,iris.util.merge_attributes
.concatenate
/merge
code.Is this something that might be interesting for Iris? If yes, I could try to tackle this.
Motivation
Using the existing function
iris.util.equalise_attributes
is not an optimal solution if one wants to keep attributes.Additional context
A possible implementation is given in the ESMValTool repository here.
The text was updated successfully, but these errors were encountered: