Skip to content

Commit

Permalink
Updated docs to NumPy style
Browse files Browse the repository at this point in the history
I installed numpydoc, and switched docstrings to NumPy
formats.Getting a lot of warnings during build, but the
HTML is okay (still needs some cleaning up).
  • Loading branch information
rlabbe committed Jan 17, 2016
1 parent d94993d commit c533dc3
Show file tree
Hide file tree
Showing 29 changed files with 490 additions and 334 deletions.
16 changes: 8 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'numpydoc',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon'
'sphinx.ext.autodoc'
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -70,7 +70,7 @@

# General information about the project.
project = 'FilterPy'
copyright = '2015, Roger R. Labbe'
copyright = '2014-2016, Roger R. Labbe'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -97,10 +97,10 @@

# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None
#default_role = "autolink"

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
add_function_parentheses = False

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
Expand Down Expand Up @@ -185,13 +185,13 @@
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
Expand Down
6 changes: 2 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ filterpy.kalman

The classes in this submodule implement the various Kalman filters. There is
also support for smoother functions. The smoothers are methods of the classes.
For example, the KalmanFilter class contains rts_smoother. to perform
For example, the KalmanFilter class contains rts_smoother to perform
Rauch-Tung-Striebal smoothing.


Expand Down Expand Up @@ -202,9 +202,7 @@ These modules are used to implement the Unscented Kalman filter.

kalman/UnscentedKalmanFilter
kalman/unscented_transform
kalman/MerweScaledSigmaPoints
kalman/JulierSigmaPoints


Ensemble Kalman Filter
+++++++++++++++++++++++
.. toctree::
Expand Down
22 changes: 0 additions & 22 deletions docs/kalman/JulierSigmaPoints.rst

This file was deleted.

23 changes: 0 additions & 23 deletions docs/kalman/MerweScaledSigmaPoints.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/kalman/UnscentedKalmanFilter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ This implements the unscented Kalman filter.
.. automethod:: __init__



--------


Expand Down
2 changes: 1 addition & 1 deletion filterpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
for more information.
"""

__version__ = "0.1.0"
__version__ = "0.1.1"
13 changes: 13 additions & 0 deletions filterpy/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Version 0.1.10
==============

* Added discrete_bayes module, which supports discrete Bayesian filtering.

* Brought docstrings (mostly) into compliance with NumPy documentation style.
This requires installation of numpy doc with
pip install numpydoc

docs\conf.py has been modified to use numpydoc.



Version 0.1.0
==============

Expand Down
14 changes: 9 additions & 5 deletions filterpy/common/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ def Q_discrete_white_noise(dim, dt=1., var=1.):
variance in the noise.
Q is computed as the G * G^T * variance, where G is the process noise per
time step. In other words, G = [[.5dt^2][dt]]^T for the constant velocity
time step. In other words, G = [[.5dt^2][dt]]^T for the constant velocity
model.
**Paramaeters**
Parameters
-----------
dim : int (2 or 3)
dimension for Q, where the final dimension is (dim x dim)
Expand Down Expand Up @@ -62,7 +63,8 @@ def Q_continuous_white_noise(dim, dt=1., spectral_density=1.):
Model. dim may be either 2 or 3, dt is the time step, and sigma is the
variance in the noise.
**Paramaeters**
Parameters
----------
dim : int (2 or 3)
dimension for Q, where the final dimension is (dim x dim)
Expand Down Expand Up @@ -99,7 +101,8 @@ def van_loan_discretization(F, G, dt):
that discretizes that equation.
**Example**::
Examples
--------
Given y'' + y = 2u(t), we create the continuous state model of
Expand All @@ -124,7 +127,8 @@ def van_loan_discretization(F, G, dt):
(example taken from Brown[2])
**References**
References
----------
[1] C. F. van Loan. "Computing Integrals Involving the Matrix Exponential."
IEEE Trans. Automomatic Control, AC-23 (3): 395-404 (June 1978)
Expand Down
3 changes: 2 additions & 1 deletion filterpy/common/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def dotn(*args):
def runge_kutta4(y, x, dx, f):
"""computes 4th order Runge-Kutta for dy/dx.
**Parameters**
Parameters
----------
y : scalar
Initial/current value for y
Expand Down
12 changes: 6 additions & 6 deletions filterpy/discrete_bayes/discrete_bayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def update(likelihood, prior):
Returns array representing the posterior.
Example
-------
.. code::
Examples
--------
.. code-block:: Python
# self driving car. Sensor returns values that can be equated to positions
# on the road. A real likelihood compuation would be much more complicated
Expand Down Expand Up @@ -113,9 +113,9 @@ def predict(pdf, offset, kernel, mode='wrap', cval=0.):
If `mode='constant'`, or any other value the pdf is shifted, with `cval`
used to fill in missing elements.
Example
-------
.. code::
Examples
--------
.. code-block:: Python
belief = [.05, .05, .05, .05, .55, .05, .05, .05, .05, .05]
prior = predict(belief, offset=2, kernel=[.1, .8, .1])
Expand Down
Loading

0 comments on commit c533dc3

Please sign in to comment.