I'm trying to use numpylines branch, but got some exception. After inspect the code, I think the numpylines might not work properly. For example:
https://github.com/mementum/backtrader/blob/numpylines/backtrader/linebuffer.py
class LineBuffer(LineSingle):
def forward(self, value=NAN, size=1):
self.idx += size
self.lencount += size
if size > 1:
if BCOLZLEVEL >= 1:
# Use bcolz also for resized arrays
self.array = bcolz.fill(size, dflt=NAN,
expectedlen=size, dtype=np.float64)
else:
if not PANDIZE:
self.array = array.array(str('d'), [NAN] * size)
else:
self.array = pd.Series([NAN] * size, dtype=np.float64) #Is this right?
return
if False and len(self) == 1:
print(self._owner, 'current len:', len(self))
print('array is:', self.array)
for i in range(size):
self.array.append(value)
self.array = pd.Series([NAN] * size, dtype=np.float64) #Is this right?
I think the code will overwrite data in self.array instead of appending Nan
Am I right?