MCPcopy Index your code
hub / github.com/rlabbe/filterpy / save

Method save

filterpy/common/helpers.py:120–152  ·  view source on GitHub ↗

save the current state of the Kalman filter

(self)

Source from the content-addressed store, hash-verified

118 self.save()
119
120 def save(self):
121 """ save the current state of the Kalman filter"""
122
123 kf = self._kf
124
125 # force all attributes to be computed. this is only necessary
126 # if the class uses properties that compute data only when
127 # accessed
128 for prop in self.properties:
129 self._DL[prop[0]].append(getattr(kf, prop[0]))
130
131 v = copy.deepcopy(kf.__dict__)
132
133 if self._skip_private:
134 for key in list(v.keys()):
135 if key.startswith('_'):
136 print('deleting', key)
137 del v[key]
138
139 if self._skip_callable:
140 for key in list(v.keys()):
141 if callable(v[key]):
142 del v[key]
143
144 for ig in self._ignore:
145 if ig in v:
146 del v[ig]
147
148 for key in list(v.keys()):
149 self._DL[key].append(v[key])
150
151 self.__dict__.update(self._DL)
152 self._len += 1
153
154 def __getitem__(self, key):
155 return self._DL[key]

Callers 15

test_linear_rtsFunction · 0.95
_test_log_likelihoodFunction · 0.95
test_immFunction · 0.95
test_1dFunction · 0.95
test_ekfFunction · 0.95
test_1dFunction · 0.95
test_1d_const_velFunction · 0.95
test_noisy_1dFunction · 0.95
test_MMAE2Function · 0.95
__init__Method · 0.95
test_saver_UKFFunction · 0.95
test_saver_kfFunction · 0.95

Calls 2

keysMethod · 0.80
updateMethod · 0.45

Tested by 14

test_linear_rtsFunction · 0.76
_test_log_likelihoodFunction · 0.76
test_immFunction · 0.76
test_1dFunction · 0.76
test_ekfFunction · 0.76
test_1dFunction · 0.76
test_1d_const_velFunction · 0.76
test_noisy_1dFunction · 0.76
test_MMAE2Function · 0.76
test_saver_UKFFunction · 0.76
test_saver_kfFunction · 0.76
test_saver_ekfFunction · 0.76