Browse code

add `runner.live_plot()` in README example

Bas Nijholt authored on 13/08/2020 17:24:35 • GitHub committed on 13/08/2020 17:24:35
Showing 1 changed files
... ...
@@ -76,6 +76,7 @@ Adaptively learning a 1D function (the `gif` below) and live-plotting the proces
76 76
     learner = Learner1D(peak, bounds=(-1, 1))
77 77
     runner = Runner(learner, goal=lambda l: l.loss() < 0.01)
78 78
     runner.live_info()
79
+    runner.live_plot()
79 80
 
80 81
 
81 82
 .. raw:: html
Browse code

add short code example to the README.rst

Bas Nijholt authored on 06/08/2020 15:16:49 • GitHub committed on 06/08/2020 15:16:49
Showing 1 changed files
... ...
@@ -63,6 +63,21 @@ with built-in support for
63 63
 Examples
64 64
 --------
65 65
 
66
+Adaptively learning a 1D function (the `gif` below) and live-plotting the process in a Jupyter notebook is as easy as
67
+
68
+.. code:: python
69
+
70
+    from adaptive import notebook_extension, Runner, Learner1D
71
+    notebook_extension()
72
+
73
+    def peak(x, a=0.01):
74
+        return x + a**2 / (a**2 + x**2)
75
+
76
+    learner = Learner1D(peak, bounds=(-1, 1))
77
+    runner = Runner(learner, goal=lambda l: l.loss() < 0.01)
78
+    runner.live_info()
79
+
80
+
66 81
 .. raw:: html
67 82
 
68 83
   <img src="https://user-images.githubusercontent.com/6897215/38739170-6ac7c014-3f34-11e8-9e8f-93b3a3a3d61b.gif" width='20%'> </img> <img src="https://user-images.githubusercontent.com/6897215/35219611-ac8b2122-ff73-11e7-9332-adffab64a8ce.gif" width='40%'> </img> <img src="https://user-images.githubusercontent.com/6897215/47256441-d6d53700-d480-11e8-8224-d1cc49dbdcf5.gif" width='20%'> </img>
Browse code

add mpi4py and loky to the README

Bas Nijholt authored on 29/04/2020 15:52:25 • GitHub committed on 29/04/2020 15:52:25
Showing 1 changed files
... ...
@@ -55,6 +55,8 @@ In addition to the learners, ``adaptive`` also provides primitives for
55 55
 running the sampling across several cores and even several machines,
56 56
 with built-in support for
57 57
 `concurrent.futures <https://docs.python.org/3/library/concurrent.futures.html>`_,
58
+`mpi4py <https://mpi4py.readthedocs.io/en/stable/mpi4py.futures.html>`_,
59
+`loky <https://loky.readthedocs.io/en/stable/>`_,
58 60
 `ipyparallel <https://ipyparallel.readthedocs.io/en/latest/>`_ and
59 61
 `distributed <https://distributed.readthedocs.io/en/latest/>`_.
60 62
 
Browse code

add instructions for installing labextensions for Jupyterlab (#257)

Bas Nijholt authored on 15/01/2020 15:20:12 • GitHub committed on 15/01/2020 15:20:12
Showing 1 changed files
... ...
@@ -89,6 +89,13 @@ The recommended way to install adaptive is using ``conda``:
89 89
 The ``[notebook]`` above will also install the optional dependencies for
90 90
 running ``adaptive`` inside a Jupyter notebook.
91 91
 
92
+To use Adaptive in Jupyterlab, you need to install the following labextensions.
93
+
94
+.. code:: bash
95
+
96
+    jupyter labextension install @jupyter-widgets/jupyterlab-manager
97
+    jupyter labextension install @pyviz/jupyterlab_pyviz
98
+
92 99
 Development
93 100
 -----------
94 101
 
Browse code

add coverage badge

Bas Nijholt authored on 16/12/2019 21:47:51
Showing 1 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 ===============
5 5
 
6 6
 |PyPI| |Conda| |Downloads| |Pipeline status| |DOI| |Binder| |Gitter|
7
-|Documentation| |GitHub|
7
+|Documentation| |Coverage| |GitHub|
8 8
 
9 9
   *Adaptive*: parallel active learning of mathematical functions.
10 10
 
... ...
@@ -178,4 +178,6 @@ request <https://github.com/python-adaptive/adaptive/pulls>`_.
178 178
    :target: https://adaptive.readthedocs.io/en/latest/?badge=latest
179 179
 .. |GitHub| image:: https://img.shields.io/github/stars/python-adaptive/adaptive.svg?style=social
180 180
    :target: https://github.com/python-adaptive/adaptive/stargazers
181
+.. |Coverage| image:: https://img.shields.io/codecov/c/github/python-adaptive/adaptive
182
+   :target: https://codecov.io/gh/python-adaptive/adaptive
181 183
 .. references-end
Browse code

rename learner.ipynb -> example-notebook.ipynb

Bas Nijholt authored on 13/12/2019 14:51:54
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ evaluate functions on a computing cluster, live-plot the data as it
16 16
 returns, and fine-tune the adaptive sampling algorithm.
17 17
 
18 18
 Run the ``adaptive`` example notebook `live on
19
-Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb>`_
19
+Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=example-notebook.ipynb>`_
20 20
 to see examples of how to use ``adaptive`` or visit the
21 21
 `tutorial on Read the Docs <https://adaptive.readthedocs.io/en/latest/tutorial/tutorial.html>`__.
22 22
 
... ...
@@ -171,7 +171,7 @@ request <https://github.com/python-adaptive/adaptive/pulls>`_.
171 171
 .. |DOI| image:: https://img.shields.io/badge/doi-10.5281%2Fzenodo.1182437-blue.svg
172 172
    :target: https://doi.org/10.5281/zenodo.1182437
173 173
 .. |Binder| image:: https://mybinder.org/badge.svg
174
-   :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb
174
+   :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=example-notebook.ipynb
175 175
 .. |Gitter| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
176 176
    :target: https://gitter.im/python-adaptive/adaptive
177 177
 .. |Documentation| image:: https://readthedocs.org/projects/adaptive/badge/?version=latest
Browse code

fix formatting for Sphinx

bold italic isn't possible...

Bas Nijholt authored on 11/12/2019 13:46:40 • GitHub committed on 11/12/2019 13:46:40
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@
6 6
 |PyPI| |Conda| |Downloads| |Pipeline status| |DOI| |Binder| |Gitter|
7 7
 |Documentation| |GitHub|
8 8
 
9
-** *Adaptive*: Parallel active learning of mathematical functions.**
9
+  *Adaptive*: parallel active learning of mathematical functions.
10 10
 
11 11
 ``adaptive`` is an open-source Python library designed to
12 12
 make adaptive parallel function evaluation simple. With ``adaptive`` you
... ...
@@ -126,7 +126,7 @@ Citing
126 126
 
127 127
 If you used Adaptive in a scientific work, please cite it as follows.
128 128
 
129
-.. code::
129
+.. code:: bib
130 130
 
131 131
     @misc{Nijholt2019,
132 132
       doi = {10.5281/zenodo.1182437},
Browse code

add a section of "How to cite" Adaptive

Bas Nijholt authored on 11/12/2019 11:24:19 • Joseph Weston committed on 11/12/2019 13:23:33
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@
6 6
 |PyPI| |Conda| |Downloads| |Pipeline status| |DOI| |Binder| |Gitter|
7 7
 |Documentation| |GitHub|
8 8
 
9
-**Tools for adaptive parallel sampling of mathematical functions.**
9
+** *Adaptive*: Parallel active learning of mathematical functions.**
10 10
 
11 11
 ``adaptive`` is an open-source Python library designed to
12 12
 make adaptive parallel function evaluation simple. With ``adaptive`` you
... ...
@@ -121,6 +121,21 @@ We implement several other checks in order to maintain a consistent code style.
121 121
 
122 122
 in the repository.
123 123
 
124
+Citing
125
+------
126
+
127
+If you used Adaptive in a scientific work, please cite it as follows.
128
+
129
+.. code::
130
+
131
+    @misc{Nijholt2019,
132
+      doi = {10.5281/zenodo.1182437},
133
+      author = {Bas Nijholt and Joseph Weston and Jorn Hoofwijk and Anton Akhmerov},
134
+      title = {\textit{Adaptive}: parallel active learning of mathematical functions},
135
+      publisher = {Zenodo},
136
+      year = {2019}
137
+    }
138
+
124 139
 Credits
125 140
 -------
126 141
 
Browse code

use rst syntax instead of markdown

Bas Nijholt authored on 10/05/2019 03:24:53
Showing 1 changed files
... ...
@@ -113,7 +113,7 @@ please setup the git filter by executing
113 113
 
114 114
 in the repository.
115 115
 
116
-We implement several other checks in order to maintain a consistent code style. We do this using [pre-commit`](https://pre-commit.com), execute
116
+We implement several other checks in order to maintain a consistent code style. We do this using `pre-commit <https://pre-commit.com>`_, execute
117 117
 
118 118
 .. code:: bash
119 119
 
Browse code

add pre-commit with black, flake8, and whitespace fixers

Bas Nijholt authored on 06/05/2019 20:12:32
Showing 1 changed files
... ...
@@ -113,6 +113,14 @@ please setup the git filter by executing
113 113
 
114 114
 in the repository.
115 115
 
116
+We implement several other checks in order to maintain a consistent code style. We do this using [pre-commit`](https://pre-commit.com), execute
117
+
118
+.. code:: bash
119
+
120
+    pre-commit install
121
+
122
+in the repository.
123
+
116 124
 Credits
117 125
 -------
118 126
 
Browse code

change urls from GitLab to GitHub

Bas Nijholt authored on 21/01/2019 14:56:03
Showing 1 changed files
... ...
@@ -130,10 +130,10 @@ We would like to give credits to the following people:
130 130
 
131 131
 For general discussion, we have a `Gitter chat
132 132
 channel <https://gitter.im/python-adaptive/adaptive>`_. If you find any
133
-bugs or have any feature suggestions please file a GitLab
134
-`issue <https://gitlab.kwant-project.org/qt/adaptive/issues/new?issue>`_
135
-or submit a `merge
136
-request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
133
+bugs or have any feature suggestions please file a GitHub
134
+`issue <https://github.com/python-adaptive/adaptive/issues/new>`_
135
+or submit a `pull
136
+request <https://github.com/python-adaptive/adaptive/pulls>`_.
137 137
 
138 138
 .. references-start
139 139
 .. |logo| image:: https://adaptive.readthedocs.io/en/latest/_static/logo.png
Browse code

replace the pipeline state badge with the Azure badge

Bas Nijholt authored on 19/12/2018 18:08:39 • GitHub committed on 19/12/2018 18:08:39
Showing 1 changed files
... ...
@@ -143,8 +143,8 @@ request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
143 143
    :target: https://anaconda.org/conda-forge/adaptive
144 144
 .. |Downloads| image:: https://img.shields.io/conda/dn/conda-forge/adaptive.svg
145 145
    :target: https://anaconda.org/conda-forge/adaptive
146
-.. |Pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg
147
-   :target: https://gitlab.kwant-project.org/qt/adaptive/pipelines
146
+.. |Pipeline status| image:: https://dev.azure.com/python-adaptive/adaptive/_apis/build/status/python-adaptive.adaptive?branchName=master
147
+   :target: https://dev.azure.com/python-adaptive/adaptive/_build/latest?definitionId=6?branchName=master
148 148
 .. |DOI| image:: https://img.shields.io/badge/doi-10.5281%2Fzenodo.1182437-blue.svg
149 149
    :target: https://doi.org/10.5281/zenodo.1182437
150 150
 .. |Binder| image:: https://mybinder.org/badge.svg
Browse code

add another gif to the README

The code is posed on https://github.com/python-adaptive/adaptive/issues/1

Bas Nijholt authored on 20/10/2018 15:59:03
Showing 1 changed files
... ...
@@ -63,7 +63,7 @@ Examples
63 63
 
64 64
 .. raw:: html
65 65
 
66
-  <img src="https://user-images.githubusercontent.com/6897215/38739170-6ac7c014-3f34-11e8-9e8f-93b3a3a3d61b.gif" width='20%'> </img> <img src="https://user-images.githubusercontent.com/6897215/35219611-ac8b2122-ff73-11e7-9332-adffab64a8ce.gif" width='40%'> </img>
66
+  <img src="https://user-images.githubusercontent.com/6897215/38739170-6ac7c014-3f34-11e8-9e8f-93b3a3a3d61b.gif" width='20%'> </img> <img src="https://user-images.githubusercontent.com/6897215/35219611-ac8b2122-ff73-11e7-9332-adffab64a8ce.gif" width='40%'> </img> <img src="https://user-images.githubusercontent.com/6897215/47256441-d6d53700-d480-11e8-8224-d1cc49dbdcf5.gif" width='20%'> </img>
67 67
 
68 68
 .. not-in-documentation-end
69 69
 
Browse code

use Zenodo DOI that always resolves to the latest version

See http://help.zenodo.org/#versioning for more information.

Bas Nijholt authored on 20/10/2018 15:15:53
Showing 1 changed files
... ...
@@ -145,8 +145,8 @@ request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
145 145
    :target: https://anaconda.org/conda-forge/adaptive
146 146
 .. |Pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg
147 147
    :target: https://gitlab.kwant-project.org/qt/adaptive/pipelines
148
-.. |DOI| image:: https://zenodo.org/badge/113714660.svg
149
-   :target: https://doi.org/10.5281/zenodo.1446400
148
+.. |DOI| image:: https://img.shields.io/badge/doi-10.5281%2Fzenodo.1182437-blue.svg
149
+   :target: https://doi.org/10.5281/zenodo.1182437
150 150
 .. |Binder| image:: https://mybinder.org/badge.svg
151 151
    :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb
152 152
 .. |Gitter| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
Browse code

documentation improvements

Bas Nijholt authored on 19/10/2018 14:19:42
Showing 1 changed files
... ...
@@ -1,12 +1,10 @@
1 1
 .. summary-start
2 2
 
3
-.. _logo-adaptive:
3
+|logo| adaptive
4
+===============
4 5
 
5
-|image0| adaptive
6
-=================
7
-
8
-|PyPI| |Conda| |Downloads| |pipeline status| |DOI| |Binder| |Join the
9
-chat at https://gitter.im/python-adaptive/adaptive| |Documentation Status|
6
+|PyPI| |Conda| |Downloads| |Pipeline status| |DOI| |Binder| |Gitter|
7
+|Documentation| |GitHub|
10 8
 
11 9
 **Tools for adaptive parallel sampling of mathematical functions.**
12 10
 
... ...
@@ -126,7 +124,9 @@ We would like to give credits to the following people:
126 124
   Mathematical Software, 37 (3), art. no. 26, 2010.
127 125
 - Pauli Virtanen for his ``AdaptiveTriSampling`` script (no longer
128 126
   available online since SciPy Central went down) which served as
129
-  inspiration for the ``~adaptive.Learner2D``.
127
+  inspiration for the `~adaptive.Learner2D`.
128
+
129
+.. credits-end
130 130
 
131 131
 For general discussion, we have a `Gitter chat
132 132
 channel <https://gitter.im/python-adaptive/adaptive>`_. If you find any
... ...
@@ -136,21 +136,23 @@ or submit a `merge
136 136
 request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
137 137
 
138 138
 .. references-start
139
-.. |image0| image:: https://gitlab.kwant-project.org/qt/adaptive/uploads/d20444093920a4a0499e165b5061d952/logo.png
139
+.. |logo| image:: https://adaptive.readthedocs.io/en/latest/_static/logo.png
140 140
 .. |PyPI| image:: https://img.shields.io/pypi/v/adaptive.svg
141 141
    :target: https://pypi.python.org/pypi/adaptive
142
-.. |Conda| image:: https://anaconda.org/conda-forge/adaptive/badges/installer/conda.svg
142
+.. |Conda| image:: https://img.shields.io/badge/install%20with-conda-green.svg
143 143
    :target: https://anaconda.org/conda-forge/adaptive
144
-.. |Downloads| image:: https://anaconda.org/conda-forge/adaptive/badges/downloads.svg
144
+.. |Downloads| image:: https://img.shields.io/conda/dn/conda-forge/adaptive.svg
145 145
    :target: https://anaconda.org/conda-forge/adaptive
146
-.. |pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg
146
+.. |Pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg
147 147
    :target: https://gitlab.kwant-project.org/qt/adaptive/pipelines
148 148
 .. |DOI| image:: https://zenodo.org/badge/113714660.svg
149
-   :target: https://zenodo.org/badge/latestdoi/113714660
149
+   :target: https://doi.org/10.5281/zenodo.1446400
150 150
 .. |Binder| image:: https://mybinder.org/badge.svg
151 151
    :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb
152
-.. |Join the chat at https://gitter.im/python-adaptive/adaptive| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
152
+.. |Gitter| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
153 153
    :target: https://gitter.im/python-adaptive/adaptive
154
-.. |Documentation Status| image:: https://readthedocs.org/projects/adaptive/badge/?version=latest
154
+.. |Documentation| image:: https://readthedocs.org/projects/adaptive/badge/?version=latest
155 155
    :target: https://adaptive.readthedocs.io/en/latest/?badge=latest
156
+.. |GitHub| image:: https://img.shields.io/github/stars/python-adaptive/adaptive.svg?style=social
157
+   :target: https://github.com/python-adaptive/adaptive/stargazers
156 158
 .. references-end
Browse code

make the examples in the docs use actual HoloViews

Bas Nijholt authored on 18/10/2018 15:43:00
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ to see examples of how to use ``adaptive`` or visit the
26 26
 
27 27
 **WARNING: adaptive is still in a beta development stage**
28 28
 
29
-.. implemented-algorithms-start
29
+.. not-in-documentation-start
30 30
 
31 31
 Implemented algorithms
32 32
 ----------------------
... ...
@@ -60,8 +60,6 @@ with built-in support for
60 60
 `ipyparallel <https://ipyparallel.readthedocs.io/en/latest/>`_ and
61 61
 `distributed <https://distributed.readthedocs.io/en/latest/>`_.
62 62
 
63
-.. implemented-algorithms-end
64
-
65 63
 Examples
66 64
 --------
67 65
 
... ...
@@ -69,6 +67,7 @@ Examples
69 67
 
70 68
   <img src="https://user-images.githubusercontent.com/6897215/38739170-6ac7c014-3f34-11e8-9e8f-93b3a3a3d61b.gif" width='20%'> </img> <img src="https://user-images.githubusercontent.com/6897215/35219611-ac8b2122-ff73-11e7-9332-adffab64a8ce.gif" width='40%'> </img>
71 69
 
70
+.. not-in-documentation-end
72 71
 
73 72
 Installation
74 73
 ------------
Browse code

small documentation improvements

Bas Nijholt authored on 18/10/2018 13:46:58
Showing 1 changed files
... ...
@@ -6,7 +6,7 @@
6 6
 =================
7 7
 
8 8
 |PyPI| |Conda| |Downloads| |pipeline status| |DOI| |Binder| |Join the
9
-chat at https://gitter.im/python-adaptive/adaptive|
9
+chat at https://gitter.im/python-adaptive/adaptive| |Documentation Status|
10 10
 
11 11
 **Tools for adaptive parallel sampling of mathematical functions.**
12 12
 
... ...
@@ -17,10 +17,10 @@ just supply a function with its bounds, and it will be evaluated at the
17 17
 evaluate functions on a computing cluster, live-plot the data as it
18 18
 returns, and fine-tune the adaptive sampling algorithm.
19 19
 
20
-Check out the ``adaptive`` example notebook
21
-`learner.ipynb <https://github.com/python-adaptive/adaptive/blob/master/learner.ipynb>`_ (or run it `live on
22
-Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb>`_)
23
-to see examples of how to use ``adaptive``.
20
+Run the ``adaptive`` example notebook `live on
21
+Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb>`_
22
+to see examples of how to use ``adaptive`` or visit the
23
+`tutorial on Read the Docs <https://adaptive.readthedocs.io/en/latest/tutorial/tutorial.html>`__.
24 24
 
25 25
 .. summary-end
26 26
 
... ...
@@ -152,4 +152,6 @@ request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
152 152
    :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb
153 153
 .. |Join the chat at https://gitter.im/python-adaptive/adaptive| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
154 154
    :target: https://gitter.im/python-adaptive/adaptive
155
+.. |Documentation Status| image:: https://readthedocs.org/projects/adaptive/badge/?version=latest
156
+   :target: https://adaptive.readthedocs.io/en/latest/?badge=latest
155 157
 .. references-end
Browse code

add doc files

Bas Nijholt authored on 16/10/2018 18:10:12
Showing 1 changed files
... ...
@@ -10,7 +10,7 @@ chat at https://gitter.im/python-adaptive/adaptive|
10 10
 
11 11
 **Tools for adaptive parallel sampling of mathematical functions.**
12 12
 
13
-``adaptive`` is an `open-source <LICENSE>`_ Python library designed to
13
+``adaptive`` is an open-source Python library designed to
14 14
 make adaptive parallel function evaluation simple. With ``adaptive`` you
15 15
 just supply a function with its bounds, and it will be evaluated at the
16 16
 “best” points in parameter space. With just a few lines of code you can
... ...
@@ -18,7 +18,7 @@ evaluate functions on a computing cluster, live-plot the data as it
18 18
 returns, and fine-tune the adaptive sampling algorithm.
19 19
 
20 20
 Check out the ``adaptive`` example notebook
21
-`learner.ipynb <learner.ipynb>`_ (or run it `live on
21
+`learner.ipynb <https://github.com/python-adaptive/adaptive/blob/master/learner.ipynb>`_ (or run it `live on
22 22
 Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb>`_)
23 23
 to see examples of how to use ``adaptive``.
24 24
 
... ...
@@ -127,7 +127,7 @@ We would like to give credits to the following people:
127 127
   Mathematical Software, 37 (3), art. no. 26, 2010.
128 128
 - Pauli Virtanen for his ``AdaptiveTriSampling`` script (no longer
129 129
   available online since SciPy Central went down) which served as
130
-  inspiration for the `Learner2D <adaptive/learner/learner2D.py>`_.
130
+  inspiration for the ``~adaptive.Learner2D``.
131 131
 
132 132
 For general discussion, we have a `Gitter chat
133 133
 channel <https://gitter.im/python-adaptive/adaptive>`_. If you find any
Browse code

change the README to rst

Bas Nijholt authored on 16/10/2018 16:30:07
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,155 @@
1
+.. summary-start
2
+
3
+.. _logo-adaptive:
4
+
5
+|image0| adaptive
6
+=================
7
+
8
+|PyPI| |Conda| |Downloads| |pipeline status| |DOI| |Binder| |Join the
9
+chat at https://gitter.im/python-adaptive/adaptive|
10
+
11
+**Tools for adaptive parallel sampling of mathematical functions.**
12
+
13
+``adaptive`` is an `open-source <LICENSE>`_ Python library designed to
14
+make adaptive parallel function evaluation simple. With ``adaptive`` you
15
+just supply a function with its bounds, and it will be evaluated at the
16
+“best” points in parameter space. With just a few lines of code you can
17
+evaluate functions on a computing cluster, live-plot the data as it
18
+returns, and fine-tune the adaptive sampling algorithm.
19
+
20
+Check out the ``adaptive`` example notebook
21
+`learner.ipynb <learner.ipynb>`_ (or run it `live on
22
+Binder <https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb>`_)
23
+to see examples of how to use ``adaptive``.
24
+
25
+.. summary-end
26
+
27
+**WARNING: adaptive is still in a beta development stage**
28
+
29
+.. implemented-algorithms-start
30
+
31
+Implemented algorithms
32
+----------------------
33
+
34
+The core concept in ``adaptive`` is that of a *learner*. A *learner*
35
+samples a function at the best places in its parameter space to get
36
+maximum “information” about the function. As it evaluates the function
37
+at more and more points in the parameter space, it gets a better idea of
38
+where the best places are to sample next.
39
+
40
+Of course, what qualifies as the “best places” will depend on your
41
+application domain! ``adaptive`` makes some reasonable default choices,
42
+but the details of the adaptive sampling are completely customizable.
43
+
44
+The following learners are implemented:
45
+
46
+- ``Learner1D``, for 1D functions ``f: ℝ → ℝ^N``,
47
+- ``Learner2D``, for 2D functions ``f: ℝ^2 → ℝ^N``,
48
+- ``LearnerND``, for ND functions ``f: ℝ^N → ℝ^M``,
49
+- ``AverageLearner``, For stochastic functions where you want to
50
+  average the result over many evaluations,
51
+- ``IntegratorLearner``, for
52
+  when you want to intergrate a 1D function ``f: ℝ → ℝ``,
53
+- ``BalancingLearner``, for when you want to run several learners at once,
54
+  selecting the “best” one each time you get more points.
55
+
56
+In addition to the learners, ``adaptive`` also provides primitives for
57
+running the sampling across several cores and even several machines,
58
+with built-in support for
59
+`concurrent.futures <https://docs.python.org/3/library/concurrent.futures.html>`_,
60
+`ipyparallel <https://ipyparallel.readthedocs.io/en/latest/>`_ and
61
+`distributed <https://distributed.readthedocs.io/en/latest/>`_.
62
+
63
+.. implemented-algorithms-end
64
+
65
+Examples
66
+--------
67
+
68
+.. raw:: html
69
+
70
+  <img src="https://user-images.githubusercontent.com/6897215/38739170-6ac7c014-3f34-11e8-9e8f-93b3a3a3d61b.gif" width='20%'> </img> <img src="https://user-images.githubusercontent.com/6897215/35219611-ac8b2122-ff73-11e7-9332-adffab64a8ce.gif" width='40%'> </img>
71
+
72
+
73
+Installation
74
+------------
75
+
76
+``adaptive`` works with Python 3.6 and higher on Linux, Windows, or Mac,
77
+and provides optional extensions for working with the Jupyter/IPython
78
+Notebook.
79
+
80
+The recommended way to install adaptive is using ``conda``:
81
+
82
+.. code:: bash
83
+
84
+    conda install -c conda-forge adaptive
85
+
86
+``adaptive`` is also available on PyPI:
87
+
88
+.. code:: bash
89
+
90
+    pip install adaptive[notebook]
91
+
92
+The ``[notebook]`` above will also install the optional dependencies for
93
+running ``adaptive`` inside a Jupyter notebook.
94
+
95
+Development
96
+-----------
97
+
98
+Clone the repository and run ``setup.py develop`` to add a link to the
99
+cloned repo into your Python path:
100
+
101
+.. code:: bash
102
+
103
+    git clone git@github.com:python-adaptive/adaptive.git
104
+    cd adaptive
105
+    python3 setup.py develop
106
+
107
+We highly recommend using a Conda environment or a virtualenv to manage
108
+the versions of your installed packages while working on ``adaptive``.
109
+
110
+In order to not pollute the history with the output of the notebooks,
111
+please setup the git filter by executing
112
+
113
+.. code:: bash
114
+
115
+    python ipynb_filter.py
116
+
117
+in the repository.
118
+
119
+Credits
120
+-------
121
+
122
+We would like to give credits to the following people:
123
+
124
+- Pedro Gonnet for his implementation of `CQUAD <https://www.gnu.org/software/gsl/manual/html_node/CQUAD-doubly_002dadaptive-integration.html>`_,
125
+  “Algorithm 4” as described in “Increasing the Reliability of Adaptive
126
+  Quadrature Using Explicit Interpolants”, P. Gonnet, ACM Transactions on
127
+  Mathematical Software, 37 (3), art. no. 26, 2010.
128
+- Pauli Virtanen for his ``AdaptiveTriSampling`` script (no longer
129
+  available online since SciPy Central went down) which served as
130
+  inspiration for the `Learner2D <adaptive/learner/learner2D.py>`_.
131
+
132
+For general discussion, we have a `Gitter chat
133
+channel <https://gitter.im/python-adaptive/adaptive>`_. If you find any
134
+bugs or have any feature suggestions please file a GitLab
135
+`issue <https://gitlab.kwant-project.org/qt/adaptive/issues/new?issue>`_
136
+or submit a `merge
137
+request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
138
+
139
+.. references-start
140
+.. |image0| image:: https://gitlab.kwant-project.org/qt/adaptive/uploads/d20444093920a4a0499e165b5061d952/logo.png
141
+.. |PyPI| image:: https://img.shields.io/pypi/v/adaptive.svg
142
+   :target: https://pypi.python.org/pypi/adaptive
143
+.. |Conda| image:: https://anaconda.org/conda-forge/adaptive/badges/installer/conda.svg
144
+   :target: https://anaconda.org/conda-forge/adaptive
145
+.. |Downloads| image:: https://anaconda.org/conda-forge/adaptive/badges/downloads.svg
146
+   :target: https://anaconda.org/conda-forge/adaptive
147
+.. |pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg
148
+   :target: https://gitlab.kwant-project.org/qt/adaptive/pipelines
149
+.. |DOI| image:: https://zenodo.org/badge/113714660.svg
150
+   :target: https://zenodo.org/badge/latestdoi/113714660
151
+.. |Binder| image:: https://mybinder.org/badge.svg
152
+   :target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb
153
+.. |Join the chat at https://gitter.im/python-adaptive/adaptive| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
154
+   :target: https://gitter.im/python-adaptive/adaptive
155
+.. references-end