Closed ocefpaf closed 9 years ago
@pelson Also, if I do not make that 0-dim array a NumpyArrayAdapter
, this problem goes away too.
Ouch. This one is a bit more serious than #152 - it is a genuine bug. Simplest code to reproduce so far:
import biggus
import numpy as np
s = biggus.NumpyArrayAdapter(np.empty((1, 36, 1, 1)))
eta = biggus.NumpyArrayAdapter(np.empty((855, 1, 82, 130)))
z = eta * s
print z.shape
print eta.shape, s.shape
print z[:, :, 30]
Or just:
import biggus
import numpy as np
s = biggus.NumpyArrayAdapter(np.empty((1, 36, 1, 1)))
a = biggus.BroadcastArray(s, {0: 855, 2: 82, 3: 130})
print a[:, :, 30]
I have a nice little test now. Time to figure out a fix :wink:
I have the following scenario:
I convert all those arrays to
NumpyArrayAdapter
and then perform some computations with them:That should be a valid slice. If I do not make the 0-dim array a
NumpyArrayAdapter
things work as expected:PS: Sorry I could not make this simpler. I tried but simple versions of this actually work just fine!