Skip to content

Commit

Permalink
docs: simplify install cells
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Jan 16, 2022
1 parent 4d207ae commit 498ce93
Show file tree
Hide file tree
Showing 10 changed files with 229 additions and 146 deletions.
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ repos:
- --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
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
41 changes: 25 additions & 16 deletions docs/usage/caching.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/chi-squared.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

1 comment on commit 498ce93

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'TensorWaves benchmark results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 498ce93 Previous: 730b89a Ratio
benchmarks/expression.py::test_fit[1000-Minuit2-numpy] 4.641558938938408 iter/sec (stddev: 0.003052614876889301) 9.411585296707777 iter/sec (stddev: 0.00055870356669898) 2.03
benchmarks/expression.py::test_fit[1000-Minuit2-numba] 4.629297010353084 iter/sec (stddev: 0.002816347203701868) 9.328857233198576 iter/sec (stddev: 0.0004291207662271506) 2.02

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.