add preliminary broadcasting support#54
Conversation
|
Thanks for doing this! I'll try to find some time to more thoroughly evaluate this within a week, but some initial comments:
It looks like you're trying to match the axes and re-order them as needed. I'm not sure that's the behavior we want here — am I reading this correctly that it'd mean that |
|
no problem! Yah, all the tail recursion and multiple dispatch routines in As for your last question, However, if that doesn't make any sense to you, I guess it wouldn't be too painful to force the user to do some kind of |
|
👍 for automatically aligning arrays. As it says in the README: "This permits one to implement algorithms that are oblivious to the storage order of the underlying arrays." From my perspective there should be no difference in the information represented by a general 2D AxisArray versus its transpose - the order of dimensions is just an implementation detail. For performance-sensitive tasks where you know and care about your dimension ordering, it's easy enough to pull out |
|
FWIW, |
|
From my experience using the The As far as I can tell, there are several possible solutions to this issue: (1) provide a method for selecting some tolerance, but keep exact equality as the default (2) more radically, provide a method of interpolating/extrapolating from one discretization to another (3) more conservatively, demand identity between the The second issue concerns what happens if there is a mismatch in coordinates along some dimension. Presently, |
|
I generally agree that errors are better than magic for dealing with non-identical coordinates, and that there is a fair amount of magic under the hood of |
|
I'm closing this since it seems pretty dead. |
Hi. I did some work, and I got a basic prototype of broadcasting working with AxisArrays objects. Basically, the code permutes the dimensions of the
datafields of an AxisArray to match a parent list of Axis objects. I then add singleton dimensions to eachdataarray, and pass these modified arrays tobroadcast!. I only rely on the julia's broadcast.jl code for this final step. It might be worthwhile to use the core language architecture a bit more, but I honestly had some trouble understanding their code.So far my method has a couple of issues.
1 +Awill return anArray, whileA + 1will return an AxisArray object. This could be fixed by defining a pairwisebroadcast(A::AxisArray, b)method, and then performing a reduction.Realtype elements.