Skip to content

Commit c835eb0

Browse files
committed
copying over readme.md as sphinx docs homepage now
1 parent 2822a40 commit c835eb0

4 files changed

Lines changed: 8 additions & 212 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Python methods for numerical differentiation of noisy data, including multi-objective optimization routines for automated parameter selection.
44

55
<p align="center">
6-
<a href="https://pynumdiff.readthedocs.io/en/master/" target="_blank" >
7-
<img alt="Python for Numerical Differentiation of noisy time series data" src="docs/source/_static/logo_PyNumDiff.png" width="300" height="200" />
6+
<a href="https://pynumdiff.readthedocs.io/master/">
7+
<img alt="Python for Numerical Differentiation of noisy time series data" src="https://raw.githubusercontent.com/florisvb/PyNumDiff/main/logo.png" width="300" height="200" />
88
</a>
99
</p>
1010

11-
<p align="center">
11+
<p align="center">https://pynumdiff.readthedocs.io/master/
1212
<a href='https://pynumdiff.readthedocs.io/master/'>
1313
<img src='https://app.readthedocs.org/projects/pynumdiff/badge/?version=master' alt='Documentation Status' /></a>
1414
<a href="https://badge.fury.io/py/pynumdiff">
@@ -67,7 +67,7 @@ For more details, refer to [this paper](https://doi.org/10.1109/ACCESS.2020.3034
6767

6868
See CITATION.cff file as well as the following references.
6969

70-
#### PyNumDiff python package:
70+
### PyNumDiff python package:
7171

7272
@article{PyNumDiff2022,
7373
doi = {10.21105/joss.04078},
@@ -83,7 +83,7 @@ See CITATION.cff file as well as the following references.
8383
}
8484

8585

86-
#### Optimization algorithm:
86+
### Optimization algorithm:
8787

8888
@article{ParamOptimizationDerivatives2020,
8989
doi={10.1109/ACCESS.2020.3034077}

docs/source/conf.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
# Add any Sphinx extension module names here, as strings. They can be
3333
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3434
# ones.
35-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary'
36-
]
35+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'myst_parser']
3736

3837
# Add any paths that contain templates here, relative to this directory.
3938
templates_path = ['_templates']
@@ -48,12 +47,6 @@
4847

4948
# The theme to use for HTML and HTML Help pages. See the documentation for
5049
# a list of builtin themes.
51-
#
5250
html_theme = 'sphinx_rtd_theme'
5351

54-
# Add any paths that contain custom static files (such as style sheets) here,
55-
# relative to this directory. They are copied after the builtin static files,
56-
# so a file named "default.css" will overwrite the builtin "default.css".
57-
html_static_path = ['_static']
58-
5952
master_doc = 'index'

docs/source/index.rst

Lines changed: 2 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -1,202 +1,5 @@
1-
PyNumDiff
2-
=========
3-
4-
Python methods for numerical differentiation of noisy data, including
5-
multi-objective optimization routines for automated parameter selection.
6-
7-
Table of contents
8-
-----------------
9-
10-
- `Introduction <#introduction>`__
11-
- `Structure <#structure>`__
12-
- `Getting Started <#getting-started>`__
13-
14-
- `Prerequisite <#prerequisite>`__
15-
- `Installing <#installing>`__
16-
17-
- `Usage <#usage>`__
18-
19-
- `Basic usages <#basic-usages>`__
20-
- `Notebook examples <#notebook-examples>`__
21-
- `Important notes <#important-notes>`__
22-
- `Running the tests <#running-the-tests>`__
23-
24-
- `Citation <#citation>`__
25-
- `License <#license>`__
26-
27-
Introduction
28-
------------
29-
30-
PyNumDiff is a Python package that implements various methods for
31-
computing numerical derivatives of noisy data, which can be a critical
32-
step in developing dynamic models or designing control. There are four
33-
different families of methods implemented in this repository: smoothing
34-
followed by finite difference calculation, local approximation with
35-
linear models, Kalman filtering based methods and total variation
36-
regularization methods. Most of these methods have multiple parameters
37-
involved to tune. We take a principled approach and propose a
38-
multi-objective optimization framework for choosing parameters that
39-
minimize a loss function to balance the faithfulness and smoothness of
40-
the derivative estimate. For more details, refer to `this
41-
paper <https://doi.org/10.1109/ACCESS.2020.3034077>`__.
42-
43-
Structure
44-
---------
45-
46-
::
47-
48-
PyNumDiff/
49-
|- README.md
50-
|- pynumdiff/
51-
|- __init__.py
52-
|- __version__.py
53-
|- finite_difference/
54-
|- kalman_smooth/
55-
|- linear_model/
56-
|- smooth_finite_difference/
57-
|- total_variation_regularization/
58-
|- utils/
59-
|- optimize/
60-
|- __init__.py
61-
|- __optimize__.py
62-
|- finite_difference/
63-
|- kalman_smooth/
64-
|- linear_model/
65-
|- smooth_finite_difference/
66-
|- total_variation_regularization/
67-
|- tests/
68-
|- examples
69-
|- 1_basic_tutorial.ipynb
70-
|- 2a_optimizing_parameters_with_dxdt_known.ipynb
71-
|- 2b_optimizing_parameters_with_dxdt_unknown.ipynb
72-
|- docs/
73-
|- Makefile
74-
|- make.bat
75-
|- build/
76-
|- source/
77-
|- _static
78-
|- _summaries
79-
|- conf.py
80-
|- index.rst
81-
|- ...
82-
|- setup.py
83-
|- .gitignore
84-
|- LICENSE.txt
85-
|- pyproject.toml
86-
87-
Getting Started
88-
---------------
89-
90-
Prerequisite
91-
~~~~~~~~~~~~
92-
93-
PyNumDiff requires common packages like ``numpy``, ``scipy``,
94-
``matplotlib``, ``pytest`` (for unittests), ``pylint`` (for PEP8 style
95-
check). For a full list, you can check the file
96-
`pyproject.toml <https://github.com/florisvb/PyNumDiff/blob/master/pyproject.toml>`__
97-
98-
In addition, it also requires certain additional packages for select
99-
functions, though these are not required for a successful install of
100-
PyNumDiff:
101-
102-
- Total Variation Regularization methods: `cvxpy <http://www.cvxpy.org/install/index.html>`__
103-
104-
When using ``cvxpy``, our default solver is set to be ``MOSEK`` (highly
105-
recommended), you would need to download their free academic license
106-
from their
107-
`website <https://www.mosek.com/products/academic-licenses/>`__.
108-
Otherwise, you can also use other solvers which are listed
109-
`here <https://www.cvxpy.org/tutorial/advanced/index.html>`__.
110-
111-
Installing
112-
~~~~~~~~~~
113-
114-
The code is compatible with >=Python 3.5. It can be installed using pip
115-
or directly from the source code. Basic installation options include:
116-
117-
- From PyPI using pip: ``pip install pynumdiff``.
118-
- From source using pip git+:
119-
``pip install git+https://github.com/florisvb/PyNumDiff``
120-
- From local source code: Run ``pip install .`` from inside this directory.
121-
122-
For additional solvers, run ``pip install pynumdiff[advanced]``. This includes ``cvxpy``,
123-
which can be tricky when compiling from source. If an error occurs in installing
124-
``cvxpy``, see `cvxpy install documentation <https://www.cvxpy.org/install/>`__, install
125-
``cvxpy`` according to those instructions, and try ``pip install pynumdiff[advanced]``
126-
again.
127-
128-
129-
Note: If using the optional MOSEK solver for cvxpy you will also need a
130-
`MOSEK license <https://www.mosek.com/products/academic-licenses/>`__,
131-
free academic license.
132-
133-
Usage
134-
-----
135-
136-
Basic usages
137-
~~~~~~~~~~~~
138-
139-
- Basic Usage: you provide the parameters
140-
141-
.. code:: bash
142-
143-
x_hat, dxdt_hat = pynumdiff.sub_module.method(x, dt, params, options)
144-
145-
- Advanced usage: automated parameter selection through multi-objective
146-
optimization
147-
148-
.. code:: bash
149-
150-
params, val = pynumdiff.optimize.sub_module.method(x, dt, params=None,
151-
tvgamma=tvgamma, # hyperparameter
152-
dxdt_truth=None, # no ground truth data
153-
options={})
154-
print('Optimal parameters: ', params)
155-
x_hat, dxdt_hat = pynumdiff.sub_module.method(x, dt, params, options={'smooth': True})`
156-
157-
Notebook examples
158-
~~~~~~~~~~~~~~~~~
159-
160-
- Differentiation with different methods: `1\_basic\_tutorial.ipynb <https://github.com/florisvb/PyNumDiff/tree/master/examples/1_basic_tutorial.ipynb>`__
161-
- Parameter Optimization with known ground truth (only for demonstration purpose): `2a\_optimizing\_parameters\_with\_dxdt\_known.ipynb <https://github.com/florisvb/PyNumDiff/tree/master/examples/2a_optimizing_parameters_with_dxdt_known.ipynb>`__
162-
- Parameter Optimization with unknown ground truth: `2b\_optimizing\_parameters\_with\_dxdt\_unknown.ipynb <https://github.com/florisvb/PyNumDiff/tree/master/examples/2b_optimizing_parameters_with_dxdt_unknown.ipynb>`__
163-
164-
165-
Important notes
166-
~~~~~~~~~~~~~~~
167-
168-
- Larger values of ``tvgamma`` produce smoother derivatives
169-
- The value of ``tvgamma`` is largely universal across methods, making
170-
it easy to compare method results
171-
- The optimization is not fast. Run it on subsets of your data if you
172-
have a lot of data. It will also be much faster with faster
173-
differentiation methods, like savgoldiff and butterdiff, and probably
174-
too slow for sliding methods like sliding DMD and sliding LTI fit.
175-
- The following heuristic works well for choosing ``tvgamma``, where
176-
``cutoff_frequency`` is the highest frequency content of the signal
177-
in your data, and ``dt`` is the timestep:
178-
``tvgamma=np.exp(-1.6*np.log(cutoff_frequency)-0.71*np.log(dt)-5.1)``
179-
180-
Running the tests
181-
~~~~~~~~~~~~~~~~~
182-
183-
To run tests locally, type:
184-
185-
.. code:: bash
186-
187-
> pytest pynumdiff
188-
189-
Citation
190-
--------
191-
192-
@ARTICLE{9241009, author={F. {van Breugel} and J. {Nathan Kutz} and B.
193-
W. {Brunton}}, journal={IEEE Access}, title={Numerical differentiation
194-
of noisy data: A unifying multi-objective optimization framework},
195-
year={2020}, volume={}, number={}, pages={1-1},
196-
doi={10.1109/ACCESS.2020.3034077}}
197-
198-
Developer's Guide
199-
-----------------
1+
.. include:: ../../README.md
2+
:parser: myst_parser.sphinx_
2003

2014
.. toctree::
2025
:maxdepth: 1

0 commit comments

Comments
 (0)