When a function created with numpy.vectorize is called on a nested sequence or numpy array, it calls its underlying function for each element in each nested sequence. So when given a sequence of biggus arrays, the underlying function is called for each element in those arrays, not on the arrays themselves.
This causes a bug in ArrayStack.__deepcopy__; when the _stack attribute is deepcopied, rather than creating a new biggus array for each element, a numpy array is created. Not only does this load the data prematurely, it causes errors in other parts of the code which assume _stack contains biggus arrays.
This change fixes this bug by replacing the vectorization with a list comprehension.
When a function created with
numpy.vectorize
is called on a nested sequence or numpy array, it calls its underlying function for each element in each nested sequence. So when given a sequence of biggus arrays, the underlying function is called for each element in those arrays, not on the arrays themselves.This causes a bug in
ArrayStack.__deepcopy__
; when the_stack
attribute is deepcopied, rather than creating a new biggus array for each element, a numpy array is created. Not only does this load the data prematurely, it causes errors in other parts of the code which assume_stack
contains biggus arrays.This change fixes this bug by replacing the vectorization with a list comprehension.