-
Notifications
You must be signed in to change notification settings - Fork 43
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
Breaking: Implement AbstractArray
interface for AbstractDimStack
#871
base: main
Are you sure you want to change the base?
Breaking: Implement AbstractArray
interface for AbstractDimStack
#871
Conversation
Lots of method ambiguities to work through. Possibly we can get even more out of this by making it an |
Yes I was already working on that. It mean I had to add the DimTuple to the type signature of |
AbstractArray
interface for AbstractDimStack
AbstractArray
interface for AbstractDimStack
except for all the ambiguities the only tests that are broken are in |
Okay I actually managed to get rid of all ambiguities, I think. Most of it I could just delete, but I also explicitly specified that the eltype of a I ran some of the tests locally but let's see what they say. |
Yeah its always a One day we can make a |
I think this should work for the most part now, but would like to suggest one more breaking change. Currently the way DimArrays are treated in |
The problem is broadcasting over NamedTuple is a very inefficient and annoying way to e.g. multiply all layers of a stack by a scalar, especially if you have mixed size layers. That change will probably break (There are reasons it's not AbstractArray ;) Trying the Rasters tests may help clarify this |
Wouldn't that already require something like
I know, but I'm positively surprised that deleting a bunch of methods and some small tweaks made tests pass.
I'll give it a try and see how much of is broken on this branch |
Ok maybe a little clearer is multiplying by another raster that is a subset of the dimensions, often a bitmask. broadcast_dims means the same code works for a Raster and a RasterStack but that will break with your approach. We will at least need to provide a function that does that. Maybe or a |
For whatever it's worth: I got methods and stack tests to pass just by changing a few |
Okay with that example I see the problem more clearly. A keyword is an option but also makes a pretty basic and intuitive function more complicated. On this branch I think the easiest way to solve a case like this is
where |
Except
|
Both those changes work well together, I think? So Then we can define |
Why a warning? |
We don't have to, I was thinking it could be worth warning because the function doesn't do anything in that case. Anyway, I gave it a shot and you can tell me what you think about that implementation. Multiple dispatch got complicated because |
Right. We just don't want warnings because we'll actually use this on Rasters. |
See #870