-
Notifications
You must be signed in to change notification settings - Fork 289
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
Unify merge and concatenate #3234
Comments
Ping @dkillick |
@kaedonkers Just seeking clarification here... Are you proposing that |
@bjlittle I'd love to see merge and concatenate become the same operation. Making a distinction between them is somewhat arbitrary, confusing for Iris users and perhaps primarily there to make life easy for devs and not users. Also merge is slow compared to concatenate, so if we could pull the functionality of concatenate in line with merge then we could remove merge and run everything through concatenate instead. |
@dkillick I think the issue is that you can get different results given the order that you use i.e. That's why we originally left it to the user to decide, rather than Keeping them separate also feeds into the custom pipeline approach of processing data... I'm not against bringing merge + concatenate together, but we'd need to think about that carefully. Concatenate doesn't create new dimensions, it only works with existing dimensions, whereas merge will create new dimensionality in the cube (just making the point, rather than teaching you to suck 🥚 's) Otherwise, we could have concatenate with automatic scalar coordinate self-promotion to a new dimension, which might do the trick.... I had an experimental branch that did this years ago, but got shot down at the time. Just thought I'd resurrect that notion as food for thought... 🤔 |
Would concatenate be able to cope with examples like #2761? |
@rcomer as it stands, no, because I don't think concatenate can handle scalar anything. The intention here is that if we unified merge and concatenate then the single resultant thing would be able to handle scalars (and get right what merge currently isn't, as per your example). |
@kaedonkers @dkillick @rcomer See here... couldn't resist 😉 |
So here's one possible unification proposal... note that, I'm initially aiming to build on what we have-ish, without a massive rewrite, although I'm not discounting that as a possibility. Let's assume that the current recusive stratagem of concatenate is reasonably sound as a foundation from which to move forward, glazing over the obvious warts. So for me, the two big questions at this point are:
Up front, I'm going to suppress the temptation to bias the design with any thoughts regarding optimisation through parallelism or sparse constructions of hypercubes. Let's keep it reasonably simple. For me, that's always a good place to start... So going back to my comment above, I've previously toyed with the concept of concatenate automatically promoting a scalar coordinate to be a new singleton dimension. Then using the naive brute force approach inherent within concatenate, to automatically promote like scalar coordinates on candidate cubes in order to concatenate over the newly promoted dimension. That's fine and dandy, but this only works for simple candidate cubes that differ by the promoted scalar coordinate. This simple approach doesn't work for a simple
Anyways, scalar coordinate promotion as a mechanism within The interesting part is addressing question [2.]... and the leap of faith here is borrowing/leaning on the dimensionality smarts of Given that, we then simply rinse and repeat, by promoting scalar coordinate The devil is most definitely in the detail, but there may be mileage with this approach... then again, may be not. But it does (to me) suggest there may be a ray of hope for possible unification... |
There have been many comments through the years about combining the function of
merge
andconcatenate
to reduce the pain of turning many cubes into one. The main argument is that, while each function is doing a distinctly different thing, it should not matter from a user's point of view whether the cubes are merging from a scalar coordinate into a new dimension, or concatenating cubes onto an existing common dimension.This issue acts as a placeholder to bring these issues together and assign this change to milestone Iris v3.0.
The (potentially) related issues are listed below:
Please edit this list as appropriate.
The text was updated successfully, but these errors were encountered: