Skip to content

Commit 3d327f6

Browse files
committed
Not all arrays were being fully flattened
If a variable has the format y=[[2.]] for each update, then the saver contains [[[2.]], [[3.]], ...] and after flattening it was a 2D colmn array. This is a bug, and I changed it to flatten that 2D column array to a 1D array.
1 parent 8a6e60d commit 3d327f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

filterpy/common/helpers.py

+4
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ def flatten(self):
205205
shape = arr.shape
206206
if shape[2] == 1:
207207
self.__dict__[key] = arr.reshape(shape[0], shape[1])
208+
arr = self.__dict__[key]
209+
shape = arr.shape
210+
if len(shape) == 2 and shape[1] == 1:
211+
self.__dict__[key] = arr.ravel()
208212
except:
209213
# not an ndarray or not a column vector
210214
pass

0 commit comments

Comments
 (0)