Skip to content

Commit 4e33fe5

Browse files
authored
Documentation refactor (#302)
* pydata sphinx theme * refactoring docs structure
1 parent 4870a81 commit 4e33fe5

File tree

138 files changed

+8791
-7434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+8791
-7434
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
command: |
7777
source /home/circleci/venv/bin/activate
7878
coverage run --source=chaospy/ --module pytest --nbval-lax --doctest-modules \
79-
chaospy/ tests/ docs/notebooks/*.ipynb docs/*.rst docs/*/*.rst README.rst
79+
chaospy/ tests/ docs/*/*.ipynb docs/*/*.rst README.rst
8080
bash <(curl -s https://codecov.io/bash)
8181
deploy:
8282
executor: python-container

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ __pycache__
66
.mypy_cache
77
.envrc
88
docs/.build
9+
docs/reference/api

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "numpoly"]
2+
path = numpoly
3+
url = https://github.com/jonathf/numpoly

CHANGELOG.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
Master Branch
22
=============
33

4+
Version 4.2.0 (2020-11-23)
5+
==========================
6+
47
ADDED:
58
* `include_axis_dim` flag added to `Distribution.sample` to force the
69
inclusion of extra dimension. (Currently first dimension is omitted is
710
`len(dist) == 1`.)
11+
* Code of conduct and contribution descriptions in repo root.
12+
* Tutorial for doing sequential polynomial chaos kriging.
813
CHANGED:
914
* `chaospy.E_cond` changed to accept simple polynomials as second argument,
1015
allowing for e.g. `chaospy.E_cond(q0*q1, q0, dist)` which can be
1116
interpreted as "expectation of `q0*q1` given `q0` with respect to `dist`".
1217
* Bugfixes to `chaospy.Spearman`
13-
* Updates to the documentation.
18+
* Full refactorization of the documentation.
19+
* Updates `numpoly` to version 1.1.0. (some small breaking changes).
1420
REMOVED:
1521
* Deprecated `report_on_exception`. Caused recursion problems, and only a
1622
semi-useful diagnostic tool to begin with.

CONTRIBUTING.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Contributing guidelines
2+
=======================
3+
4+
Any kind of contribution to `chaospy` is very much welcome. Everything from
5+
simple comments or question to a full fledged `pull request
6+
<https://help.github.com/articles/about-pull-requests/>`_.
7+
8+
A contribution can be one of the following cases:
9+
10+
#. you have a question about usage;
11+
#. you think you may have found a bug (including unexpected behavior);
12+
#. you want to make some kind of change to the code base (e.g. to fix a bug, to
13+
add a new feature, to update documentation).
14+
15+
The sections below outline the steps in each case.
16+
17+
You have a question about usage
18+
-------------------------------
19+
20+
#. Use the search functionality `here
21+
<https://github.com/jonathf/chaospy/issues>`_ to see if someone already
22+
filed an issue on the same topic;
23+
#. If your issue search did not yield any relevant results, make a new issue;
24+
#. Choose the "Usage Question" template, and fill in the appropriate fields.
25+
26+
You think you may have found a bug
27+
----------------------------------
28+
29+
#. Use the search functionality `here
30+
<https://github.com/jonathf/chaospy/issues>`_ to see if someone already
31+
filed the same issue;
32+
#. If your issue search did not yield any relevant results, make a new issue;
33+
#. Choose the "Bug report" template, and fill in the appropriate fields.
34+
Make sure to provide enough information to the rest of the community to
35+
understand the cause and context of the problem.
36+
37+
You want to make some kind of change to the code base
38+
-----------------------------------------------------
39+
40+
#. Make an issue `here <https://github.com/jonathf/chaospy/issues>` and use the
41+
"Functionality Request" template.
42+
Announce your plan to the community *before you start working*.
43+
Note in the issue that you are willing to make the proposed changes yourself.
44+
#. Wait until a maintainer comments and tells you the idea is approved for
45+
implementation;
46+
#. If needed, fork the repository to your own Github profile and create your
47+
own feature branch off of the latest master commit. While working on your
48+
feature branch, make sure to stay up to date with the master branch by
49+
rebasing changes on top, possibly from the 'upstream' repository (follow the
50+
instructions `here
51+
<https://help.github.com/articles/configuring-a-remote-for-a-fork/>`_ and
52+
`here <https://help.github.com/articles/syncing-a-fork/>`_);
53+
#. Make sure the existing tests still work;
54+
#. Add your own tests (if necessary);
55+
#. Update or expand the documentation;
56+
#. `Push <http://rogerdudler.github.io/git-guide/>`_ your feature branch to
57+
(your fork of) the Chaospy repository on GitHub;
58+
#. Create the pull request, e.g. following the instructions `here
59+
<https://help.github.com/articles/creating-a-pull-request/>`_.
60+
61+
In case you feel like you've made a valuable contribution, but you don't know
62+
how to write or run tests for it, or how to generate the documentation: don't
63+
let this discourage you from making the pull request; we can help you! Just go
64+
ahead and submit the pull request, but keep in mind that you might be asked to
65+
append additional commits to your pull request.

README.rst

Lines changed: 8 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,31 @@
1616
.. |pypi| image:: https://img.shields.io/pypi/v/chaospy
1717
:target: https://pypi.org/project/chaospy
1818
.. |binder| image:: https://mybinder.org/badge_logo.svg
19-
:target: https://mybinder.org/v2/gh/jonathf/chaospy/master?filepath=docs%2Fnotebooks
19+
:target: https://mybinder.org/v2/gh/jonathf/chaospy/master?filepath=docs%2Ftutorials
2020

2121
Chaospy is a numerical tool for performing uncertainty quantification using
2222
polynomial chaos expansions and advanced Monte Carlo methods implemented in
2323
Python.
2424

2525
* `Documentation <https://chaospy.readthedocs.io/en/master>`_
26-
* `Interactive tutorials with Binder <https://mybinder.org/v2/gh/jonathf/chaospy/master?filepath=docs%2Fnotebooks>`_
26+
* `Interactive tutorials with Binder <https://mybinder.org/v2/gh/jonathf/chaospy/master?filepath=docs%2Ftutorials>`_
2727
* `Source code <https://github.com/jonathf/chaospy>`_
2828
* `Issue tracker <https://github.com/jonathf/chaospy/issues>`_
29+
* `Code of Conduct <https://github.com/jonathf/chaospy/blob/master/CODE_OF_CONDUCT.md>`_
30+
* `Contribution Guideline <https://github.com/jonathf/chaospy/blob/master/CONTRIBUTING.md>`_
31+
* `Changelog <https://github.com/jonathf/chaospy/blob/master/CHANGELOg.md>`
2932

3033
Installation
3134
------------
3235

33-
Installation should be straight forward from `PyPI <https://pypi.org/>`_:
36+
Installation should be straight forward using `pip <https://pypi.org/>`_:
3437

3538
.. code-block:: bash
3639
3740
$ pip install chaospy
3841
39-
Or alternatively using `Conda <https://conda.io/>`_:
40-
41-
.. code-block:: bash
42-
43-
$ conda install -c conda-forge chaospy
42+
For more installation details, see the `installation guide
43+
<https://chaospy.readthedocs.io/en/master/installation.html>`.
4444

4545
Example Usage
4646
-------------
@@ -137,78 +137,3 @@ For more extensive guides on this approach an others, see the `tutorial
137137
collection`_.
138138

139139
.. _tutorial collection: https://chaospy.readthedocs.io/en/master/tutorials
140-
141-
Contributions and Related Projects
142-
----------------------------------
143-
144-
A few shout-outs to people who have contributed to the Chaospy project:
145-
146-
+--------------+--------------------------------------------------------------+
147-
| `OpenTURNS`_ | Thanks to `Régis Lebrun`_ for both proposing a collaboration |
148-
| | and creating an initial implementation of both |
149-
| | `Chaospy Compatibility`_ in `OpenTURNS`_ and |
150-
| | `OpenTURNS Compatibility`_ in ``chaospy``. |
151-
+--------------+--------------------------------------------------------------+
152-
| `orthopy`_ | Thanks to `Nico Schlömer`_ for providing the implementation |
153-
| `quadpy`_ | for several of the quadrature integration methods. |
154-
+--------------+--------------------------------------------------------------+
155-
| ``UQRF`` | Thanks to `Florian Künzner`_ for providing the initial |
156-
| | implementation of kernel density estimation and |
157-
| | quantity-of-interest distribution. |
158-
+--------------+--------------------------------------------------------------+
159-
160-
.. _OpenTURNS: http://openturns.github.io/openturns/latest
161-
.. _Régis Lebrun: https://github.com/regislebrun
162-
.. _Chaospy Compatibility: http://openturns.github.io/openturns/latest/user_manual/_generated/openturns.ChaospyDistribution.html
163-
.. _OpenTURNS Compatibility: https://chaospy.readthedocs.io/en/master/recipes/external.html#module-chaospy.external.openturns_
164-
.. _orthopy: https://github.com/nschloe/orthopy
165-
.. _quadpy: https://github.com/nschloe/quadpy
166-
.. _Nico Schlömer: https://github.com/nschloe
167-
.. _Florian Künzner: https://github.com/flo2k
168-
169-
Chaospy is being used in other related projects that requires uncertainty
170-
quantification components ``chaospy`` provides. For example:
171-
172-
+-----------------+-----------------------------------------------------------+
173-
| `easyVVUQ`_ | Library designed to facilitate verification, validation |
174-
| | and uncertainty quantification. |
175-
+-----------------+-----------------------------------------------------------+
176-
| `STARFiSh`_ | Shell-based, scientific simulation program |
177-
| | for blood flow in mammals. |
178-
+-----------------+-----------------------------------------------------------+
179-
| `Profit`_ | Probabilistic response model fitting via interactive |
180-
| | tools. |
181-
+-----------------+-----------------------------------------------------------+
182-
| `UncertainPy`_ | Uncertainty quantification and sensitivity analysis, |
183-
| | tailored towards computational neuroscience. |
184-
+-----------------+-----------------------------------------------------------+
185-
| `SparseSpACE`_ | Spatially adaptive combination technique targeted to |
186-
| | solve high dimensional numerical integration. |
187-
+-----------------+-----------------------------------------------------------+
188-
189-
.. _easyVVUQ: https://github.com/UCL-CCS/EasyVVUQ
190-
.. _STARFiSh: https://www.ntnu.no/starfish
191-
.. _Profit: https://github.com/redmod-team/profit
192-
.. _UncertainPy: https://github.com/simetenn/uncertainpy
193-
.. _SparseSpACE: https://github.com/obersteiner/sparseSpACE
194-
195-
For a more comprehensive list, see `Github's dependency graph
196-
<https://github.com/jonathf/chaospy/network/dependents>`_.
197-
198-
Questions and Contributions
199-
---------------------------
200-
201-
Please feel free to
202-
`file an issue <https://github.com/jonathf/chaospy/issues>`_ for:
203-
204-
* bug reporting
205-
* asking questions related to usage
206-
* requesting new features
207-
* wanting to contribute with code
208-
209-
If you are going to publish work using this software, then please cite the
210-
article: `Chaospy: An open source tool for designing methods of uncertainty
211-
quantification <http://dx.doi.org/10.1016/j.jocs.2015.08.008>`_.
212-
In addition, if you deal with stochastic dependencies, please also cite:
213-
`Multivariate Polynomial Chaos Expansions with Dependent Variables
214-
<https://epubs.siam.org/doi/10.1137/15M1020447>`_.

chaospy/descriptives/__init__.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,4 @@
1-
"""
2-
Descriptives are a collection of statistical analysis tools that can be used to
3-
analyse distributions and polynomials, both as an expansion (see
4-
:ref:`orthogonality`) and as results. For example, the expected value operator
5-
:func:`~chaospy.descriptives.expected.E` can be applied on distributions
6-
directly as follows::
7-
8-
>>> distribution = chaospy.Uniform(0, 1)
9-
>>> expected = chaospy.E(distribution)
10-
>>> expected
11-
array(0.5)
12-
13-
For multivariate distributions::
14-
15-
>>> distribution = chaospy.J(
16-
... chaospy.Uniform(0, 1),
17-
... chaospy.Normal(0, 1)
18-
... )
19-
>>> expected = chaospy.E(distribution)
20-
>>> expected
21-
array([0.5, 0. ])
22-
23-
24-
For simple polynomials, distribution goes as the second argument. In other
25-
words, it calculates the expected value of the unit variable with respect to
26-
distribution. For example::
27-
28-
>>> distribution = chaospy.J(
29-
... chaospy.Uniform(0, 1),
30-
... chaospy.Normal(0, 1)
31-
... )
32-
>>> q0, q1 = chaospy.variable(2)
33-
>>> expected = chaospy.E(q1, distribution)
34-
>>> expected
35-
array(0.)
36-
"""
1+
"""Collection of descriptive statistics."""
372
from .expected import E
383
from .conditional import E_cond
394
from .covariance import Cov

chaospy/descriptives/conditional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def E_cond(poly, freeze, dist, **kws):
1212
"""
13-
Conditional expected value operator.
13+
Conditional expected value of a distribution or polynomial.
1414
1515
1st order statistics of a polynomial on a given probability space
1616
conditioned on some of the variables.

chaospy/descriptives/covariance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
def Cov(poly, dist=None, **kws):
1010
"""
11-
Covariance matrix, or 2rd order statistics.
11+
Variance/Covariance matrix of a distribution or polynomial array.
1212
1313
Args:
1414
poly (numpoly.ndpoly, Distribution) :

chaospy/descriptives/expected.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def E(poly, dist=None, **kws):
77
"""
8-
Expected value operator.
8+
The expected value of a distribution or polynomial.
99
1010
1st order statistics of a probability distribution or polynomial on a given
1111
probability space.

0 commit comments

Comments
 (0)