-
Notifications
You must be signed in to change notification settings - Fork 284
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 |
In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity. If this issue is still important to you, then please comment on this issue and the stale label will be removed. Otherwise this issue will be automatically closed in 28 days time. |
Re-raising this is timely, as we're hoping to address some related questions under the banner of #5375, when we concentrate on some 'dragon tasks' over the next few weeks. However I see that the needs here go beyond the use of 'equalise_attributes' or similar, in that it seems you may need an operation which will focus on some specific identified attributes. What is the status of the outstanding need here @schlunma @larsbarring ? |
I believe our needs have been solved by several "pre-processor" tools that harmonise the data before going into the main analysis tools. A key part of the pre-processors is the take care of the output from the But with respect coordinate attributes, that often contain floating point data, I still think that something else than exact equality is required. ping @nCarolina |
We have a custom solution in ESMValCore that basically does what I described in this PR description. Since we are quite pleased with this, I am happy to close this issue here in favor of #5375. If there was a similar feature within Iris, we would use it, but this is really not critical for us at all. |
✨ 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: