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. diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 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/EKF.py b/filterpy/kalman/EKF.py index 22b9de8..35abc3d 100644 --- a/filterpy/kalman/EKF.py +++ b/filterpy/kalman/EKF.py @@ -86,7 +86,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 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) """