Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
......@@ -63,7 +63,7 @@ Examples
.. raw:: html
<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/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>
.. not-in-documentation-end
......@@ -145,8 +145,8 @@ request <https://gitlab.kwant-project.org/qt/adaptive/merge_requests>`_.
:target: https://anaconda.org/conda-forge/adaptive
.. |Pipeline status| image:: https://gitlab.kwant-project.org/qt/adaptive/badges/master/pipeline.svg
:target: https://gitlab.kwant-project.org/qt/adaptive/pipelines
.. |DOI| image:: https://zenodo.org/badge/113714660.svg
:target: https://doi.org/10.5281/zenodo.1446400
.. |DOI| image:: https://img.shields.io/badge/doi-10.5281%2Fzenodo.1182437-blue.svg
:target: https://doi.org/10.5281/zenodo.1182437
.. |Binder| image:: https://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/python-adaptive/adaptive/master?filepath=learner.ipynb
.. |Gitter| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
......
......@@ -219,8 +219,8 @@ class LearnerND(BaseLearner):
@property
def tri(self):
"""A `adaptive.learner.Triangulation` instance with all the points
of the learner."""
"""An `adaptive.learner.triangulation.Triangulation` instance
with all the points of the learner."""
if self._tri is not None:
return self._tri
......@@ -230,8 +230,8 @@ class LearnerND(BaseLearner):
return self._tri
except ValueError:
# A ValueError is raised if we do not have enough points or
# the provided points are coplanar, so we need more points to create
# a valid triangulation
# the provided points are coplanar, so we need more points to
# create a valid triangulation
return None
@property
......
// This file is empty because we are already loading jQuery with holoviews in the <head>
......@@ -50,7 +50,7 @@ extensions = [
'sphinx.ext.napoleon',
'jupyter_sphinx.execute',
'sphinx_fontawesome',
'm2r'
'm2r',
]
source_parsers = {}
......@@ -136,7 +136,7 @@ def get_holoviews_js_css():
from holoviews.plotting import Renderer
dependencies = {**Renderer.core_dependencies,
**Renderer.extra_dependencies}
required = ['jQueryUI', 'jQuery', 'require']
required = ['jQuery', 'jQueryUI', 'underscore', 'require']
js = [url for name in required for url in dependencies[name].get('js', [])]
css = [url for name in required for url in dependencies[name].get('css', [])]
return js, css
......@@ -146,9 +146,18 @@ js, css = get_holoviews_js_css()
html_context = {'holoviews_js_files': js}
def remove_jquery_and_underscore(app):
# We need to remove the jquery and underscore file that are
# added by default because we already add it in the <head> tag.
remove = lambda x: not any(js in x for js in ['jquery', 'underscore'])
if hasattr(app.builder, 'script_files'):
app.builder.script_files = [x for x in app.builder.script_files
if remove(x)]
def setup(app):
for url in css:
app.add_stylesheet(url)
app.add_stylesheet('custom.css') # For the `live_info` widget
app.add_javascript("https://unpkg.com/@jupyter-widgets/html-manager@0.14.4/dist/embed-amd.js")
app.connect('builder-inited', remove_jquery_and_underscore)
......@@ -40,7 +40,8 @@ implementation the seed parameter can be ignored by the function).
.. jupyter-execute::
learner = adaptive.AverageLearner(g, atol=None, rtol=0.01)
runner = adaptive.Runner(learner, goal=lambda l: l.loss() < 2)
# `loss < 1` means that we reached the `rtol` or `atol`
runner = adaptive.Runner(learner, goal=lambda l: l.loss() < 1)
.. jupyter-execute::
:hide-code:
......