OpArrayCache.setInSlot() not working
burgerdev opened this issue · comments
Markus Rudy commented
The setInSlot()
method of the OpArrayCache
class is not working correctly, I suspect because the method _allocateManagementStructures()
is not called by default, which leads to _dirtyShape
being None
.
Workaround is to set the block shape to something different.
from lazyflow.operators.opArrayCache import OpArrayCache
from lazyflow.graph import Graph
import numpy
op = OpArrayCache(graph=Graph())
op.Input.setValue(numpy.zeros((20,20)))
op.Input[0:20,0:20] = numpy.ones((20,20))
Result:
Traceback (most recent call last):
File "chachetest.py", line 8, in <module>
op.Input[0:20,0:20] = numpy.ones((20,20))
File "/home/burger/Private/Coding/hci/lazyflow/lazyflow/slot.py", line 896, in __setitem__
self.operator.setInSlot(self, (), roi, value)
File "/home/burger/Private/Coding/hci/lazyflow/lazyflow/operators/opArrayCache.py", line 414, in setInSlot
blockKey = roiToSlice(blockStart,blockStop)
File "/home/burger/Private/Coding/hci/lazyflow/lazyflow/roi.py", line 287, in roiToSlice
return tuple(map(rTsl1,start,stop))
File "/home/burger/Private/Coding/hci/lazyflow/lazyflow/roi.py", line 269, in <lambda>
rTsl1 = lambda x,y:slice(x.__int__(),y.__int__())
AttributeError: 'NoneType' object has no attribute '__int__'