Skip to content

Commit

Permalink
Fixes rlabbe#14 and rlabbe#35.
Browse files Browse the repository at this point in the history
numpydoc module is included in the list of sphinx extensions which
fixes rlabbe#14 and including scipy.ndimage in the list of mock modules fixes
rlabbe#35.
  • Loading branch information
veeresht committed May 23, 2016
1 parent 0061879 commit 8060090
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 23 deletions.
14 changes: 8 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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'
autodoc_member_order = 'bysource'
2 changes: 0 additions & 2 deletions docs/discrete_bayes/discrete_bayes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ words go here
-----

.. autofunction:: predict

-----
32 changes: 17 additions & 15 deletions filterpy/kalman/kalman_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -645,7 +645,7 @@ def get_prediction(self, u=0):
Returns
-------
(x, P)
(x, P) : tuple
State vector and covariance array of the prediction.
"""

Expand Down Expand Up @@ -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)
"""

Expand Down

0 comments on commit 8060090

Please sign in to comment.