From 08760b254d63ebc78257e17b83851d750d494533 Mon Sep 17 00:00:00 2001 From: "Adriano rsvp.github.com" Date: Sat, 26 Dec 2015 21:41:38 -0800 Subject: [PATCH 1/4] Add __init__.py to top level directory for package Useful for absolute import, without pip install, e.g. from filterpy.filterpy.kalman import KalmanFilter --- __init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 From 5027293214aaebf6da762218b3a4a49a630028a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Carretero?= Date: Mon, 25 Apr 2016 17:07:00 -0400 Subject: [PATCH 2/4] Update LICENSE Fixup typso ;) --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 49beefe..5588707 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -he MIT License (MIT) +The MIT License (MIT) Copyright (c) 2015 Roger R. Labbe Jr @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file +THE SOFTWARE. From 988f9edc4ba89310a049c3d46778b2003bfabcbb Mon Sep 17 00:00:00 2001 From: "Saurav R. Tuladhar" Date: Thu, 5 May 2016 11:46:42 -0400 Subject: [PATCH 3/4] Correct typo in predict_update docstring --- filterpy/kalman/EKF.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filterpy/kalman/EKF.py b/filterpy/kalman/EKF.py index 18a2218..8ebcd2e 100644 --- a/filterpy/kalman/EKF.py +++ b/filterpy/kalman/EKF.py @@ -84,7 +84,7 @@ def predict_update(self, z, HJacobian, Hx, args=(), hx_args=(), u=0): variable. hx_args : tuple, optional, default (,) - arguments to be passed into HJacobian after the required state + arguments to be passed into Hx after the required state variable. u : np.array or scalar From 80600907ee33b20007f51aea97db91c9f74483d3 Mon Sep 17 00:00:00 2001 From: Veeresh Taranalli Date: Mon, 23 May 2016 00:20:23 -0700 Subject: [PATCH 4/4] Fixes #14 and #35. numpydoc module is included in the list of sphinx extensions which fixes #14 and including scipy.ndimage in the list of mock modules fixes #35. --- docs/conf.py | 14 ++++++----- docs/discrete_bayes/discrete_bayes.rst | 2 -- filterpy/kalman/kalman_filter.py | 32 ++++++++++++++------------ 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 01089b9..f9c683a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,13 +17,13 @@ import os import mock - + MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot', 'scipy.linalg', 'numpy.linalg', 'matplotlib.pyplot', 'numpy.random', 'scipy.sparse', 'scipy.sparse.linalg', 'scipy.stats', 'matplotlib.patches', 'scipy.ndimage.filters', - 'scipy.ndimage.interpolation'] - + 'scipy.ndimage.interpolation', 'scipy.ndimage'] + for mod_name in MOCK_MODULES: sys.modules[mod_name] = mock.Mock() @@ -32,7 +32,8 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) -sys.path.insert(0, os.path.abspath('../filterpy')) +#sys.path.insert(0, os.path.abspath('../filterpy')) +sys.path.insert(0, os.path.abspath('../')) from filterpy import * import filterpy @@ -53,7 +54,8 @@ 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', 'sphinx.ext.viewcode', - 'sphinx.ext.autodoc' + 'sphinx.ext.autodoc', + 'numpydoc' ] # Add any paths that contain templates here, relative to this directory. @@ -357,4 +359,4 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} -autodoc_member_order = 'bysource' \ No newline at end of file +autodoc_member_order = 'bysource' diff --git a/docs/discrete_bayes/discrete_bayes.rst b/docs/discrete_bayes/discrete_bayes.rst index c226939..8f9c045 100644 --- a/docs/discrete_bayes/discrete_bayes.rst +++ b/docs/discrete_bayes/discrete_bayes.rst @@ -16,5 +16,3 @@ words go here ----- .. autofunction:: predict - ------ diff --git a/filterpy/kalman/kalman_filter.py b/filterpy/kalman/kalman_filter.py index c47b876..579eddb 100644 --- a/filterpy/kalman/kalman_filter.py +++ b/filterpy/kalman/kalman_filter.py @@ -468,21 +468,21 @@ def batch_filter(self, zs, Fs=None, Qs=None, Hs=None, Rs=None, Bs=None, us=None, Returns ------- - means: np.array((n,dim_x,1)) + means : np.array((n,dim_x,1)) array of the state for each time step after the update. Each entry is an np.array. In other words `means[k,:]` is the state at step `k`. - covariance: np.array((n,dim_x,dim_x)) + covariance : np.array((n,dim_x,dim_x)) array of the covariances for each time step after the update. In other words `covariance[k,:,:]` is the covariance at step `k`. - means_predictions: np.array((n,dim_x,1)) + means_predictions : np.array((n,dim_x,1)) array of the state for each time step after the predictions. Each entry is an np.array. In other words `means[k,:]` is the state at step `k`. - covariance_predictions: np.array((n,dim_x,dim_x)) + covariance_predictions : np.array((n,dim_x,dim_x)) array of the covariances for each time step after the prediction. In other words `covariance[k,:,:]` is the covariance at step `k`. @@ -645,7 +645,7 @@ def get_prediction(self, u=0): Returns ------- - (x, P) + (x, P) : tuple State vector and covariance array of the prediction. """ @@ -1006,34 +1006,36 @@ def batch_filter(x, P, zs, Fs, Qs, Hs, Rs, Bs=None, us=None, update_first=False) Returns ------- - means: np.array((n,dim_x,1)) + means : np.array((n,dim_x,1)) array of the state for each time step after the update. Each entry is an np.array. In other words `means[k,:]` is the state at step `k`. - covariance: np.array((n,dim_x,dim_x)) + covariance : np.array((n,dim_x,dim_x)) array of the covariances for each time step after the update. In other words `covariance[k,:,:]` is the covariance at step `k`. - means_predictions: np.array((n,dim_x,1)) + means_predictions : np.array((n,dim_x,1)) array of the state for each time step after the predictions. Each entry is an np.array. In other words `means[k,:]` is the state at step `k`. - covariance_predictions: np.array((n,dim_x,dim_x)) + covariance_predictions : np.array((n,dim_x,dim_x)) array of the covariances for each time step after the prediction. In other words `covariance[k,:,:]` is the covariance at step `k`. Examples -------- - zs = [t + random.randn()*4 for t in range (40)] - Fs = [kf.F for t in range (40)] - Hs = [kf.H for t in range (40)] + .. code-block:: Python + + zs = [t + random.randn()*4 for t in range (40)] + Fs = [kf.F for t in range (40)] + Hs = [kf.H for t in range (40)] - (mu, cov, _, _) = kf.batch_filter(zs, Rs=R_list, Fs=Fs, Hs=Hs, Qs=None, - Bs=None, us=None, update_first=False) - (xs, Ps, Ks) = kf.rts_smoother(mu, cov, Fs=Fs, Qs=None) + (mu, cov, _, _) = kf.batch_filter(zs, Rs=R_list, Fs=Fs, Hs=Hs, Qs=None, + Bs=None, us=None, update_first=False) + (xs, Ps, Ks) = kf.rts_smoother(mu, cov, Fs=Fs, Qs=None) """