Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add notebook button for Deepnote #400

Merged
merged 6 commits into from
Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .constraints/py3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ smmap==5.0.0
sniffio==1.2.0
snowballstemmer==2.2.0
soupsieve==2.3.1
sphinx==4.3.2
sphinx==4.3.2 ; python_version < "3.8.0"
sphinx-autobuild==2021.3.14
sphinx-book-theme==0.1.10
sphinx-book-theme==0.2.0
sphinx-copybutton==0.4.0
sphinx-panels==0.6.0
sphinx-thebe==0.0.10
Expand Down
4 changes: 2 additions & 2 deletions .constraints/py3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ smmap==5.0.0
sniffio==1.2.0
snowballstemmer==2.2.0
soupsieve==2.3.1
sphinx==4.3.2
sphinx==4.3.2 ; python_version < "3.8.0"
sphinx-autobuild==2021.3.14
sphinx-book-theme==0.1.10
sphinx-book-theme==0.2.0
sphinx-copybutton==0.4.0
sphinx-panels==0.6.0
sphinx-thebe==0.0.10
Expand Down
4 changes: 2 additions & 2 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ smmap==5.0.0
sniffio==1.2.0
snowballstemmer==2.2.0
soupsieve==2.3.1
sphinx==4.3.2
sphinx==4.4.0
sphinx-autobuild==2021.3.14
sphinx-book-theme==0.1.10
sphinx-book-theme==0.2.0
sphinx-copybutton==0.4.0
sphinx-panels==0.6.0
sphinx-thebe==0.0.10
Expand Down
4 changes: 2 additions & 2 deletions .constraints/py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ smmap==5.0.0
sniffio==1.2.0
snowballstemmer==2.2.0
soupsieve==2.3.1
sphinx==4.3.2
sphinx==4.4.0
sphinx-autobuild==2021.3.14
sphinx-book-theme==0.1.10
sphinx-book-theme==0.2.0
sphinx-copybutton==0.4.0
sphinx-panels==0.6.0
sphinx-thebe==0.0.10
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.7"
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c .constraints/py3.7.txt .[doc]
pip install -c .constraints/py3.8.txt .[doc]
sudo apt-get -y install graphviz pandoc
- name: Build documentation and run notebooks
working-directory: docs
Expand Down
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.0.98
rev: 0.0.99
hooks:
- id: check-dev-files
args:
- --pin-requirements
- id: fix-first-nbcell
args:
- --colab
- --replace
- --add-install-cell
- --additional-packages=IPython
- --extras-require=doc,viz
- id: fix-nbformat-version
- id: format-setup-cfg

Expand Down Expand Up @@ -125,6 +126,7 @@ repos:
metadata.toc-showmarkdowntxt
metadata.toc-showtags
metadata.varInspector

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
Expand Down
41 changes: 25 additions & 16 deletions docs/amplitude-analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,34 @@
},
"outputs": [],
"source": [
"%%capture\n",
"%config Completer.use_jedi = False\n",
"%config InlineBackend.figure_formats = ['svg']\n",
"import os\n",
"\n",
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n",
"\n",
"# Install on Google Colab\n",
"import subprocess\n",
"import sys\n",
"\n",
"from IPython import get_ipython\n",
"\n",
"install_packages = \"google.colab\" in str(get_ipython())\n",
"if install_packages:\n",
" for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", package]\n",
" )"
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hideCode": true,
"hideOutput": true,
"hidePrompt": true,
"jupyter": {
"source_hidden": true
},
"slideshow": {
"slide_type": "skip"
},
"tags": [
"remove-cell",
"skip-execution"
]
},
"outputs": [],
"source": [
"# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n",
"%pip install -q tensorwaves[doc,viz] IPython"
]
},
{
Expand Down
41 changes: 25 additions & 16 deletions docs/amplitude-analysis/analytic-continuation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,34 @@
},
"outputs": [],
"source": [
"%%capture\n",
"%config Completer.use_jedi = False\n",
"%config InlineBackend.figure_formats = ['svg']\n",
"import os\n",
"\n",
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n",
"\n",
"# Install on Google Colab\n",
"import subprocess\n",
"import sys\n",
"\n",
"from IPython import get_ipython\n",
"\n",
"install_packages = \"google.colab\" in str(get_ipython())\n",
"if install_packages:\n",
" for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", package]\n",
" )"
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hideCode": true,
"hideOutput": true,
"hidePrompt": true,
"jupyter": {
"source_hidden": true
},
"slideshow": {
"slide_type": "skip"
},
"tags": [
"remove-cell",
"skip-execution"
]
},
"outputs": [],
"source": [
"# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n",
"%pip install -q tensorwaves[doc,viz] IPython"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def fetch_logo(url: str, output_path: str) -> None:
"launch_buttons": {
"binderhub_url": "https://mybinder.org",
"colab_url": "https://colab.research.google.com",
"deepnote_url": "https://deepnote.com",
"notebook_interface": "jupyterlab",
"thebe": True,
"thebelab": True,
Expand Down
41 changes: 25 additions & 16 deletions docs/usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,34 @@
},
"outputs": [],
"source": [
"%%capture\n",
"%config Completer.use_jedi = False\n",
"%config InlineBackend.figure_formats = ['svg']\n",
"import os\n",
"\n",
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n",
"\n",
"# Install on Google Colab\n",
"import subprocess\n",
"import sys\n",
"\n",
"from IPython import get_ipython\n",
"\n",
"install_packages = \"google.colab\" in str(get_ipython())\n",
"if install_packages:\n",
" for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", package]\n",
" )"
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hideCode": true,
"hideOutput": true,
"hidePrompt": true,
"jupyter": {
"source_hidden": true
},
"slideshow": {
"slide_type": "skip"
},
"tags": [
"remove-cell",
"skip-execution"
]
},
"outputs": [],
"source": [
"# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n",
"%pip install -q tensorwaves[doc,viz] IPython"
]
},
{
Expand Down
41 changes: 25 additions & 16 deletions docs/usage/basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,34 @@
},
"outputs": [],
"source": [
"%%capture\n",
"%config Completer.use_jedi = False\n",
"%config InlineBackend.figure_formats = ['svg']\n",
"import os\n",
"\n",
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n",
"\n",
"# Install on Google Colab\n",
"import subprocess\n",
"import sys\n",
"\n",
"from IPython import get_ipython\n",
"\n",
"install_packages = \"google.colab\" in str(get_ipython())\n",
"if install_packages:\n",
" for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", package]\n",
" )"
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hideCode": true,
"hideOutput": true,
"hidePrompt": true,
"jupyter": {
"source_hidden": true
},
"slideshow": {
"slide_type": "skip"
},
"tags": [
"remove-cell",
"skip-execution"
]
},
"outputs": [],
"source": [
"# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n",
"%pip install -q tensorwaves[doc,viz] IPython"
]
},
{
Expand Down
41 changes: 25 additions & 16 deletions docs/usage/binned-fit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,34 @@
},
"outputs": [],
"source": [
"%%capture\n",
"%config Completer.use_jedi = False\n",
"%config InlineBackend.figure_formats = ['svg']\n",
"import os\n",
"\n",
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)\n",
"\n",
"# Install on Google Colab\n",
"import subprocess\n",
"import sys\n",
"\n",
"from IPython import get_ipython\n",
"\n",
"install_packages = \"google.colab\" in str(get_ipython())\n",
"if install_packages:\n",
" for package in [\"tensorwaves[doc]\", \"graphviz\"]:\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", package]\n",
" )"
"STATIC_WEB_PAGE = {\"EXECUTE_NB\", \"READTHEDOCS\"}.intersection(os.environ)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"hideCode": true,
"hideOutput": true,
"hidePrompt": true,
"jupyter": {
"source_hidden": true
},
"slideshow": {
"slide_type": "skip"
},
"tags": [
"remove-cell",
"skip-execution"
]
},
"outputs": [],
"source": [
"# WARNING: advised to install a specific version, e.g. tensorwaves==0.1.2\n",
"%pip install -q tensorwaves[doc,viz] IPython"
]
},
{
Expand Down
Loading