Skip to content

Commit 61ed359

Browse files
authored
Move the documentation from Sphinx to Zensical, refresh the README and its animations (#500)
1 parent b3a40ef commit 61ed359

99 files changed

Lines changed: 1700 additions & 1554 deletions

File tree

Some content is hidden

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

‎.gitignore‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ instance/
6161
# Scrapy stuff:
6262
.scrapy
6363

64-
# Sphinx documentation
65-
docs/_build/
6664

6765
# PyBuilder
6866
target/
@@ -81,6 +79,7 @@ celerybeat-schedule
8179

8280
# virtualenv
8381
venv/
82+
.venv/
8483
ENV/
8584

8685
# Spyder project settings
@@ -99,3 +98,7 @@ benchmarks/results/
9998

10099
# vscode configuration
101100
.vscode/
101+
102+
# Zensical
103+
_site/
104+
.notebook_cache/

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ repos:
2626
rev: "v1.15.0"
2727
hooks:
2828
- id: mypy
29-
exclude: ipynb_filter.py|docs/source/conf.py
29+
exclude: ipynb_filter.py

‎AUTHORS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 👥 Authors
1+
## Authors
22

33
The current maintainers of Adaptive are:
44

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 🗞️ Changelog
1+
# Changelog
22

33
## [v1.4.0](https://github.com/python-adaptive/adaptive/tree/v1.3.0) (2025-05-13)
44

‎README.md‎

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# ![logo](https://adaptive.readthedocs.io/en/latest/_static/logo.png) *Adaptive*: Parallel Active Learning of Mathematical Functions
3-
<!-- badges-start -->
3+
<!-- --8<-- [start:badges] -->
44

55
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/python-adaptive/adaptive/main?filepath=example-notebook.ipynb)
66
[![Conda](https://img.shields.io/badge/install%20with-conda-green.svg)](https://anaconda.org/conda-forge/adaptive)
@@ -9,24 +9,24 @@
99
[![Documentation](https://readthedocs.org/projects/adaptive/badge/?version=latest)](https://adaptive.readthedocs.io/en/latest/?badge=latest)
1010
[![Downloads](https://img.shields.io/conda/dn/conda-forge/adaptive.svg)](https://anaconda.org/conda-forge/adaptive)
1111
[![GitHub](https://img.shields.io/github/stars/python-adaptive/adaptive.svg?style=social)](https://github.com/python-adaptive/adaptive/stargazers)
12-
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/python-adaptive/adaptive)
1312
[![PyPI](https://img.shields.io/pypi/v/adaptive.svg)](https://pypi.python.org/pypi/adaptive)
13+
[![Python](https://img.shields.io/pypi/pyversions/adaptive.svg)](https://pypi.python.org/pypi/adaptive)
1414

15-
<!-- badges-end -->
15+
<!-- --8<-- [end:badges] -->
1616

17-
<!-- summary-start -->
17+
<!-- --8<-- [start:summary] -->
1818

1919
Adaptive is an open-source Python library that streamlines adaptive parallel function evaluations.
2020
Rather than calculating all points on a dense grid, it intelligently selects the "best" points in the parameter space based on your provided function and bounds.
2121
With minimal code, you can perform evaluations on a computing cluster, display live plots, and optimize the adaptive sampling algorithm.
2222

2323
Adaptive is most efficient for computations where each function evaluation takes at least ≈50ms due to the overhead of selecting potentially interesting points.
2424

25-
To see Adaptive in action, try the [example notebook on Binder](https://mybinder.org/v2/gh/python-adaptive/adaptive/main?filepath=example-notebook.ipynb) or explore the [tutorial on Read the Docs](https://adaptive.readthedocs.io/en/latest/tutorial/tutorial).
25+
To see Adaptive in action, try the [example notebook on Binder](https://mybinder.org/v2/gh/python-adaptive/adaptive/main?filepath=example-notebook.ipynb) or explore the [tutorial on Read the Docs](https://adaptive.readthedocs.io/en/latest/tutorial/tutorial/).
2626

27-
<!-- summary-end -->
27+
<!-- --8<-- [end:summary] -->
2828

29-
<details><summary><b><u>[ToC]</u></b> 📚</summary>
29+
<details><summary><b>Table of contents</b></summary>
3030

3131
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
3232
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -38,6 +38,7 @@ To see Adaptive in action, try the [example notebook on Binder](https://mybinder
3838
- [Installation](#installation)
3939
- [Faster triangulation (optional)](#faster-triangulation-optional)
4040
- [Development](#development)
41+
- [Documentation](#documentation)
4142
- [Citing](#citing)
4243
- [Draft Paper](#draft-paper)
4344
- [Credits](#credits)
@@ -46,20 +47,20 @@ To see Adaptive in action, try the [example notebook on Binder](https://mybinder
4647

4748
</details>
4849

49-
<!-- key-features-start -->
50+
<!-- --8<-- [start:key-features] -->
5051

5152
## Key features
5253

53-
- 🎯 **Intelligent Adaptive Sampling**: Adaptive focuses on areas of interest within a function, ensuring better results with fewer evaluations, saving time, and computational resources.
54-
- ⚡ **Parallel Execution**: The library leverages parallel processing for faster function evaluations, making optimal use of available computational resources.
55-
- 📊 **Live Plotting and Info Widgets**: When working in Jupyter notebooks, Adaptive offers real-time visualization of the learning process, making it easier to monitor progress and identify areas of improvement.
56-
- 🔧 **Customizable Loss Functions**: Adaptive supports various loss functions and allows customization, enabling users to tailor the learning process according to their specific needs.
57-
- 📈 **Support for Multidimensional Functions**: The library can handle functions with scalar or vector outputs in one or multiple dimensions, providing flexibility for a wide range of problems.
58-
- 🧩 **Seamless Integration**: Adaptive offers a simple and intuitive interface, making it easy to integrate with existing Python projects and workflows.
59-
- 💾 **Flexible Data Export**: The library provides options to export learned data as NumPy arrays or Pandas DataFrames, ensuring compatibility with various data processing tools.
60-
- 🌐 **Open-Source and Community-Driven**: Adaptive is an open-source project, encouraging contributions from the community to continuously improve and expand the library's features and capabilities.
54+
- **Intelligent Adaptive Sampling**: Adaptive focuses on areas of interest within a function, ensuring better results with fewer evaluations, saving time, and computational resources.
55+
- **Parallel Execution**: The library leverages parallel processing for faster function evaluations, making optimal use of available computational resources.
56+
- **Live Plotting and Info Widgets**: When working in Jupyter notebooks, Adaptive offers real-time visualization of the learning process, making it easier to monitor progress and identify areas of improvement.
57+
- **Customizable Loss Functions**: Adaptive supports various loss functions and allows customization, enabling users to tailor the learning process according to their specific needs.
58+
- **Support for Multidimensional Functions**: The library can handle functions with scalar or vector outputs in one or multiple dimensions, providing flexibility for a wide range of problems.
59+
- **Seamless Integration**: Adaptive offers a simple and intuitive interface, making it easy to integrate with existing Python projects and workflows.
60+
- **Flexible Data Export**: The library provides options to export learned data as NumPy arrays or Pandas DataFrames, ensuring compatibility with various data processing tools.
61+
- **Open-Source and Community-Driven**: Adaptive is an open-source project, encouraging contributions from the community to continuously improve and expand the library's features and capabilities.
6162

62-
<!-- key-features-end -->
63+
<!-- --8<-- [end:key-features] -->
6364

6465
## Example usage
6566

@@ -81,7 +82,13 @@ runner.live_info()
8182
runner.live_plot()
8283
```
8384

84-
<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>
85+
With the same number of points, adaptive sampling resolves features that a homogeneous grid misses:
86+
87+
<p align="center">
88+
<img src="https://raw.githubusercontent.com/python-adaptive/adaptive/main/docs/_static/readme/learner1d.gif" width="43%" alt="Learner1D: homogeneous grid versus adaptive sampling of a sharp peak">
89+
<img src="https://raw.githubusercontent.com/python-adaptive/adaptive/main/docs/_static/readme/learner2d.gif" width="36%" alt="Learner2D: homogeneous grid versus adaptive triangulation of a ring">
90+
<img src="https://raw.githubusercontent.com/python-adaptive/adaptive/main/docs/_static/readme/learnerND.gif" width="19%" alt="LearnerND: sampled points concentrate on a spherical shell">
91+
</p>
8592

8693
### Exporting Data
8794

@@ -97,7 +104,7 @@ If you have Pandas installed, you can also export the data as a DataFrame:
97104
df = learner.to_dataframe()
98105
```
99106

100-
<!-- implemented-algorithms-start -->
107+
<!-- --8<-- [start:implemented-algorithms] -->
101108

102109
## Implemented Algorithms
103110

@@ -110,15 +117,15 @@ While `adaptive` provides sensible default choices, the adaptive sampling proces
110117

111118
The following learners are implemented:
112119

113-
<!-- implemented-algorithms-end -->
120+
<!-- --8<-- [end:implemented-algorithms] -->
114121

115122
- `Learner1D`: for 1D functions `f: ℝ → ℝ^N`,
116123
- `Learner2D`: for 2D functions `f: ℝ^2 → ℝ^N`,
117124
- `LearnerND`: for ND functions `f: ℝ^N → ℝ^M`,
118125
- `AverageLearner`: for random variables, allowing averaging of results over multiple evaluations,
119126
- `AverageLearner1D`: for stochastic 1D functions, estimating the mean value at each point,
120127
- `IntegratorLearner`: for integrating a 1D function `f: ℝ → ℝ`,
121-
- `BalancingLearner`: for running multiple learners simultaneously and selecting the "best" one as more points are gathered.
128+
- `SequenceLearner`: for evaluating a fixed sequence of points while still using the runners, parallelism, and data export of Adaptive.
122129

123130
Meta-learners (to be used with other learners):
124131

@@ -132,11 +139,11 @@ In addition to learners, `adaptive` offers primitives for parallel sampling acro
132139
[ipyparallel](https://ipyparallel.readthedocs.io/en/latest/), and
133140
[distributed](https://distributed.readthedocs.io/en/latest/).
134141

135-
<!-- rest-start -->
142+
<!-- --8<-- [start:rest] -->
136143

137144
## Installation
138145

139-
`adaptive` works with Python 3.7 and higher on Linux, Windows, or Mac, and provides optional extensions for working with the Jupyter/IPython Notebook.
146+
`adaptive` works with Python 3.11 and higher on Linux, Windows, or Mac, and provides optional extensions for working with Jupyter.
140147

141148
The recommended way to install adaptive is using `conda`:
142149

@@ -150,7 +157,7 @@ conda install -c conda-forge adaptive
150157
pip install "adaptive[notebook]"
151158
```
152159

153-
The `[notebook]` above will also install the optional dependencies for running `adaptive` inside a Jupyter notebook.
160+
The `[notebook]` above also installs the optional dependencies for live plotting and widgets in JupyterLab and Jupyter Notebook; no extra Jupyter extensions need to be installed.
154161

155162
### Faster triangulation (optional)
156163

@@ -163,24 +170,17 @@ pip install "adaptive[rust]"
163170
No code changes are needed — the Rust backend is detected and used automatically.
164171
To control the selection, pass `LearnerND(..., triangulation_backend="python" | "rust" | "auto")` per learner, or set the environment variable `ADAPTIVE_TRIANGULATION_BACKEND=python` to force the pure-Python implementation globally (or to `rust` to make a missing Rust backend an error instead of a silent fallback).
165172

166-
To use Adaptive in Jupyterlab, you need to install the following labextensions.
167-
168-
```bash
169-
jupyter labextension install @jupyter-widgets/jupyterlab-manager
170-
jupyter labextension install @pyviz/jupyterlab_pyviz
171-
```
172-
173173
## Development
174174

175-
Clone the repository and run `pip install -e ".[notebook,test,other]"` to add a link to the cloned repo into your Python path:
175+
Clone the repository and install it in editable mode with the optional dependencies:
176176

177177
```bash
178178
git clone git@github.com:python-adaptive/adaptive.git
179179
cd adaptive
180180
pip install -e ".[notebook,test,other]"
181181
```
182182

183-
We recommend using a Conda environment or a virtualenv for package management during Adaptive development.
183+
We recommend a virtual environment, for example with [uv](https://docs.astral.sh/uv/) (`uv sync --extra notebook --extra test --extra other`) or Conda.
184184

185185
To avoid polluting the history with notebook output, set up the git filter by running:
186186

@@ -198,6 +198,19 @@ pre-commit install
198198

199199
in the repository.
200200

201+
### Documentation
202+
203+
The documentation is built with [Zensical](https://zensical.org).
204+
The executable pages in `docs/notebooks/` are Jupyter notebooks in [jupytext's MyST Markdown format](https://jupytext.readthedocs.io/en/latest/formats-markdown.html).
205+
`docs/build_notebooks.py` executes them (with caching) and renders them into `docs/`, after which Zensical builds the site:
206+
207+
```bash
208+
uv run --group docs python docs/build_notebooks.py
209+
uv run --group docs zensical serve # preview on http://localhost:8000
210+
```
211+
212+
The animations in this README are rendered from real learner runs with `uv run --group docs python docs/make_animations.py` (requires `ffmpeg` and Chrome or Chromium).
213+
201214
## Citing
202215

203216
If you used Adaptive in a scientific work, please cite it as follows.
@@ -224,7 +237,10 @@ We would like to give credits to the following people:
224237
- Pedro Gonnet for his implementation of [CQUAD](https://www.gnu.org/software/gsl/manual/html_node/CQUAD-doubly_002dadaptive-integration.html), “Algorithm 4” as described in “Increasing the Reliability of Adaptive Quadrature Using Explicit Interpolants”, P. Gonnet, ACM Transactions on Mathematical Software, 37 (3), art. no. 26, 2010.
225238
- Pauli Virtanen for his `AdaptiveTriSampling` script (no longer available online since SciPy Central went down) which served as inspiration for the `adaptive.Learner2D`.
226239

227-
<!-- rest-end -->
240+
<!-- --8<-- [end:rest] -->
241+
<!-- --8<-- [start:community] -->
228242

229243
For general discussion, we have a [Gitter chat channel](https://gitter.im/python-adaptive/adaptive).
230244
If you find any bugs or have any feature suggestions please file a GitHub [issue](https://github.com/python-adaptive/adaptive/issues/new) or submit a [pull request](https://github.com/python-adaptive/adaptive/pulls).
245+
246+
<!-- --8<-- [end:community] -->

‎docs/.gitignore‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
build/*
2-
source/_static/holoviews.*
1+
# Rendered from docs/notebooks/ by docs/build_notebooks.py
2+
/algorithms_and_examples.md
3+
/benchmarks.md
4+
/tutorial/
5+
*.ipynb
6+
# Written by notebooks during execution
7+
/notebooks/tutorial/data/

‎docs/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CHANGELOG.md

‎docs/Makefile‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/source/_static/example_uses/battle_for_majoranas.jpeg renamed to docs/_static/example_uses/battle_for_majoranas.jpeg

File renamed without changes.

docs/source/_static/example_uses/quasi_majorana_paper.jpeg renamed to docs/_static/example_uses/quasi_majorana_paper.jpeg

File renamed without changes.

0 commit comments

Comments
 (0)