From d98ce842e7c1270bf9d63aa0a70fc4d0cf683e1f Mon Sep 17 00:00:00 2001 From: Bas Nijholt <basnijholt@gmail.com> Date: Fri, 19 Oct 2018 13:24:42 +0200 Subject: [PATCH] fix live_info css --- adaptive/notebook_integration.py | 2 +- docs/source/_static/custom.css | 1 + docs/source/conf.py | 1 + docs/source/tutorial/tutorial.Learner1D.rst | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 docs/source/_static/custom.css diff --git a/adaptive/notebook_integration.py b/adaptive/notebook_integration.py index 9f4dd48b..0cb9158b 100644 --- a/adaptive/notebook_integration.py +++ b/adaptive/notebook_integration.py @@ -176,7 +176,7 @@ def _info_html(runner): with suppress(Exception): info.append(('latest loss', f'{runner.learner._cache["loss"]:.3f}')) - template = '<dt>{}</dt><dd>{}</dd>' + template = '<dt class="ignore-css">{}</dt><dd>{}</dd>' table = '\n'.join(template.format(k, v) for k, v in info) return f''' diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css new file mode 100644 index 00000000..10fedb43 --- /dev/null +++ b/docs/source/_static/custom.css @@ -0,0 +1 @@ +.ignore-css{all:unset !important;} diff --git a/docs/source/conf.py b/docs/source/conf.py index cf26f128..170b1a95 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -148,4 +148,5 @@ 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") diff --git a/docs/source/tutorial/tutorial.Learner1D.rst b/docs/source/tutorial/tutorial.Learner1D.rst index 25bfcb6f..ed4a73c6 100644 --- a/docs/source/tutorial/tutorial.Learner1D.rst +++ b/docs/source/tutorial/tutorial.Learner1D.rst @@ -39,7 +39,7 @@ background with a sharp peak at a random location: a = 0.01 if wait: - sleep(random()) + sleep(random() / 10) return x + a**2 / (a**2 + (x - offset)**2) We start by initializing a 1D “learnerâ€, which will suggest points to -- GitLab