Skip to content

Commit 0a14a9e

Browse files
authored
Merge pull request #328 from python-adaptive/docs-env-update
Documentation conda environment update to latest versions
2 parents d75fd79 + 477fddc commit 0a14a9e

File tree

4 files changed

+32
-23
lines changed

4 files changed

+32
-23
lines changed

docs/environment.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: adaptive
1+
name: adaptive-docs
22

33
channels:
44
- conda-forge
@@ -7,15 +7,16 @@ dependencies:
77
- python
88
- sortedcollections=2.1.0
99
- scikit-optimize=0.8.1
10-
- scikit-learn=0.24.1
11-
- scipy=1.6.1
12-
- holoviews=1.13.3
13-
- bokeh=2.2.1
14-
- plotly=4.14.3
15-
- ipywidgets=7.6.3
16-
- jupyter_sphinx=0.3.1
10+
- scikit-learn=0.24.2
11+
- scipy=1.7.1
12+
- holoviews=1.14.6
13+
- bokeh=2.4.0
14+
- panel=0.12.3
15+
- plotly=5.3.1
16+
- ipywidgets=7.6.5
17+
- jupyter-sphinx=0.3.2
1718
- atomicwrites=1.4.0
1819
- sphinx_fontawesome=0.0.6
19-
- sphinx=3.5.2
20-
- m2r2=0.2.7
21-
- sphinx_rtd_theme=0.5.1
20+
- sphinx=4.2.0
21+
- m2r2=0.3.1
22+
- sphinx_rtd_theme=1.0.0

docs/source/_static/custom.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.ignore-css{all:unset !important;}
22

33
/* https://gitter.im/pyviz/pyviz?at=5e8efb2b16f84f0461683446 */
4-
.widget-box.bk form {
5-
display: flex !important;
4+
.panel-widget-box.bk form {
5+
display: none !important;
66
margin-left: auto !important;
77
margin-right: auto !important;
88
width: 25%;

docs/source/conf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,14 @@
143143
}
144144

145145
html_js_files = [
146-
"https://cdn.bokeh.org/bokeh/release/bokeh-2.2.1.min.js",
147-
"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.1.min.js",
146+
"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.0.min.js",
147+
"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.0.min.js",
148+
"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.0.min.js",
149+
"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.0.min.js",
150+
"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.0.min.js",
148151
]
152+
153+
149154
html_logo = "logo_docs.png"
150155

151156

docs/source/docs.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ on the *Play* :fa:`play` button or move the sliders.
5050
from adaptive.learner.learner1D import uniform_loss, default_loss
5151
import holoviews as hv
5252
import numpy as np
53+
5354
adaptive.notebook_extension()
54-
%output holomap='scrubber'
55+
hv.output(holomap="scrubber")
5556

5657
`adaptive.Learner1D`
5758
~~~~~~~~~~~~~~~~~~~~
5859

5960
.. jupyter-execute::
6061
:hide-code:
6162

62-
%%opts Layout [toolbar=None]
6363
def f(x, offset=0.07357338543088588):
6464
a = 0.01
6565
return x + a**2 / (a**2 + (x - offset)**2)
@@ -71,20 +71,23 @@ on the *Play* :fa:`play` button or move the sliders.
7171
x, y = [x_0, x_1], [y_0, y_1]
7272
else:
7373
x, y = [], []
74-
return hv.Scatter((x, y)).opts(style=dict(size=6, color='r'))
74+
return hv.Scatter((x, y)).opts(style=dict(size=6, color="r"))
7575

7676
def plot(learner, npoints):
7777
adaptive.runner.simple(learner, lambda l: l.npoints == npoints)
7878
return (learner.plot() * plot_loss_interval(learner))[:, -1.1:1.1]
7979

8080
def get_hm(loss_per_interval, N=101):
81-
learner = adaptive.Learner1D(f, bounds=(-1, 1),
82-
loss_per_interval=loss_per_interval)
81+
learner = adaptive.Learner1D(f, bounds=(-1, 1), loss_per_interval=loss_per_interval)
8382
plots = {n: plot(learner, n) for n in range(N)}
84-
return hv.HoloMap(plots, kdims=['npoints'])
83+
return hv.HoloMap(plots, kdims=["npoints"])
84+
85+
layout = (
86+
get_hm(uniform_loss).relabel("homogeneous samping")
87+
+ get_hm(default_loss).relabel("with adaptive")
88+
)
8589

86-
(get_hm(uniform_loss).relabel('homogeneous samping')
87-
+ get_hm(default_loss).relabel('with adaptive'))
90+
layout.opts(plot=dict(toolbar=None))
8891

8992
`adaptive.Learner2D`
9093
~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)