From b83f410699b8af4943050426a29034b0cdba0827 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 00:29:51 -0700 Subject: [PATCH 01/13] LAB_version --- docs/source/installation.myst | 4 ++-- docs/source/labs.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/installation.myst b/docs/source/installation.myst index 542644e..115ca45 100644 --- a/docs/source/installation.myst +++ b/docs/source/installation.myst @@ -61,10 +61,10 @@ To ensure you have the same package versions as those built here, run: --- tags: [skip-execution] --- -pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/v2/requirements.txt +pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/LAB_VERSION/requirements.txt ``` -For more specific install instructions go to [ISLP_labs](https://github.com/intro-stat-learning/ISLP_labs/tree/v2). +For more specific install instructions go to [ISLP_labs](https://github.com/intro-stat-learning/ISLP_labs/tree/LAB_VERSION). ## Torch requirements diff --git a/docs/source/labs.rst b/docs/source/labs.rst index 653020d..e103b8e 100644 --- a/docs/source/labs.rst +++ b/docs/source/labs.rst @@ -15,7 +15,7 @@ Package versions To ensure you have the same package versions as those built here, run: - pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/v2/requirements.txt; + pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/LAB_VERSION/requirements.txt; .. toctree:: :maxdepth: 1 From 7868525a3cefaf82d347acc38bf29bef7726783a Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 01:31:06 -0700 Subject: [PATCH 02/13] setting a __lab_version__ for building docs --- .github/workflows/build_docs.yml | 10 +------- ISLP/__init__.py | 2 ++ docs/fix_and_clear_notebooks.py | 4 ++-- docs/source/conf.py | 10 +++++++- docs/source/installation.myst | 15 +++--------- docs/source/labs.myst | 39 ++++++++++++++++++++++++++++++++ docs/source/labs.rst | 36 ----------------------------- 7 files changed, 56 insertions(+), 60 deletions(-) create mode 100644 docs/source/labs.myst delete mode 100644 docs/source/labs.rst diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 7328c69..ce9de47 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -5,12 +5,6 @@ name: Build docs # Controls when the workflow will run on: workflow_dispatch: - inputs: - LABS: - description: 'Labs version' - required: true - default: 'v2' - type: string # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -39,12 +33,10 @@ jobs: # Checkout labs - name: Checkout version of labs - env: - LABS: ${{ inputs.LABS }} run: | git submodule update --init --force docs/ISLP_labs cd docs - python fix_and_clear_notebooks.py --version $LABS + python fix_and_clear_notebooks.py rm source/labs/Ch*md - name: Make docs diff --git a/ISLP/__init__.py b/ISLP/__init__.py index 0cd8d3e..8fa4574 100644 --- a/ISLP/__init__.py +++ b/ISLP/__init__.py @@ -119,3 +119,5 @@ def confusion_table(predicted_labels, from . import _version __version__ = _version.get_versions()['version'] + +__lab_version__ = 'v2' diff --git a/docs/fix_and_clear_notebooks.py b/docs/fix_and_clear_notebooks.py index aac28ee..aa0bd34 100644 --- a/docs/fix_and_clear_notebooks.py +++ b/docs/fix_and_clear_notebooks.py @@ -3,8 +3,9 @@ from argparse import ArgumentParser from glob import glob +from ISLP import __lab_version__ parser = ArgumentParser() -parser.add_argument('--version', default='v2') +parser.add_argument('--version', default=__lab_version__) args = parser.parse_args() version = args.version @@ -84,7 +85,6 @@ open(f'{base}.md', 'w').write(myst) -# cmd = f'jupytext --sync {base}.ipynb; rm {base}.md' cmd = f'jupytext --sync {base}.ipynb; ' print(f'Running: {cmd}') os.system(cmd) diff --git a/docs/source/conf.py b/docs/source/conf.py index dac1a2d..b78013f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -7,7 +7,15 @@ author = 'Jonathan Taylor' release = '0.1' -version = '0.1.0' +import ISLP +version = ISLP.__version__ + +lab_version = ISLP.__lab_version__ +myst_enable_extensions = ['substitution'] + +myst_substitutions = { + "ISLP_lab_link": f"[ISLP_labs {lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})" + } # -- General configuration diff --git a/docs/source/installation.myst b/docs/source/installation.myst index 115ca45..e89acff 100644 --- a/docs/source/installation.myst +++ b/docs/source/installation.myst @@ -3,6 +3,7 @@ file_format: mystnb kernelspec: name: python3 display_name: python3 +myst_number_code_blocks: [python] --- @@ -52,20 +53,10 @@ pip install ISLP ```{attention} Python packages change frequently. The labs here are built -with specific versions of the various packages. +with {{ ISLP_lab_link }}. Visit the lab git repo for specific instructions +to install the frozen environment. ``` -To ensure you have the same package versions as those built here, run: - -```{code-cell} ipython3 ---- -tags: [skip-execution] ---- -pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/LAB_VERSION/requirements.txt -``` - -For more specific install instructions go to [ISLP_labs](https://github.com/intro-stat-learning/ISLP_labs/tree/LAB_VERSION). - ## Torch requirements The `ISLP` labs use `torch` and various related packages for the lab diff --git a/docs/source/labs.myst b/docs/source/labs.myst new file mode 100644 index 0000000..67fd61f --- /dev/null +++ b/docs/source/labs.myst @@ -0,0 +1,39 @@ +--- +file_format: mystnb +kernelspec: + name: python3 + display_name: python3 +myst_number_code_blocks: python +--- + +# Labs + +The current version of the labs for `ISLP` are included here. + +## Package versions + + +```{attention} + +Python packages change frequently. The labs here are built +with {{ ISLP_lab_link }}. Visit the lab git repo for specific instructions +to install the frozen environment. +``` + +```{toctree} +maxdepth: 1 + +labs/Ch02-statlearn-lab +labs/Ch03-linreg-lab +labs/Ch04-classification-lab +labs/Ch05-resample-lab +labs/Ch06-varselect-lab +labs/Ch07-nonlin-lab +labs/Ch08-baggboost-lab +labs/Ch09-svm-lab +labs/Ch10-deeplearning-lab +labs/Ch11-surv-lab +labs/Ch12-unsup-lab +labs/Ch13-multiple-lab +``` + diff --git a/docs/source/labs.rst b/docs/source/labs.rst deleted file mode 100644 index e103b8e..0000000 --- a/docs/source/labs.rst +++ /dev/null @@ -1,36 +0,0 @@ -Labs -==== - -The current version of the labs for `ISLP` are included here. - - -Package versions ----------------- - -.. attention:: - - Python packages change frequently. The labs here are built - with specific versions of the various packages. - - -To ensure you have the same package versions as those built here, run: - - pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/LAB_VERSION/requirements.txt; - -.. toctree:: - :maxdepth: 1 - - labs/Ch02-statlearn-lab - labs/Ch03-linreg-lab - labs/Ch04-classification-lab - labs/Ch05-resample-lab - labs/Ch06-varselect-lab - labs/Ch07-nonlin-lab - labs/Ch08-baggboost-lab - labs/Ch09-svm-lab - labs/Ch10-deeplearning-lab - labs/Ch11-surv-lab - labs/Ch12-unsup-lab - labs/Ch13-multiple-lab - - From 173c741d4d42a8e316e8fbf44e541422b1220b4c Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 12:50:00 -0700 Subject: [PATCH 03/13] not clearing lab outputs --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index ce9de47..a5cd054 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -36,7 +36,7 @@ jobs: run: | git submodule update --init --force docs/ISLP_labs cd docs - python fix_and_clear_notebooks.py + python fix_and_clear_notebooks.py --noclear rm source/labs/Ch*md - name: Make docs From c4b6f43be41db3ada6eeb1ad61d03f3225078b20 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 13:32:54 -0700 Subject: [PATCH 04/13] including built version of labs --- ISLP/__init__.py | 7 ++++++- docs/fix_and_clear_notebooks.py | 9 ++++++--- docs/source/conf.py | 7 +++++-- docs/source/labs.myst | 11 +++++++++++ 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ISLP/__init__.py b/ISLP/__init__.py index 8fa4574..2039803 100644 --- a/ISLP/__init__.py +++ b/ISLP/__init__.py @@ -120,4 +120,9 @@ def confusion_table(predicted_labels, from . import _version __version__ = _version.get_versions()['version'] -__lab_version__ = 'v2' +# related to docs +# __docs_lab_version__ should be a commit on intro-stat-learning/ISLP_labs +# __docs_lab_ISLP_version__ should be the tag in requirements.txt of __docs_lab_version__ + +__docs_lab_version__ = 'v2' +__docs_lab_ISLP_version__ = 'v0.3.18' diff --git a/docs/fix_and_clear_notebooks.py b/docs/fix_and_clear_notebooks.py index aa0bd34..853bd5a 100644 --- a/docs/fix_and_clear_notebooks.py +++ b/docs/fix_and_clear_notebooks.py @@ -6,6 +6,8 @@ from ISLP import __lab_version__ parser = ArgumentParser() parser.add_argument('--version', default=__lab_version__) +parser.add_argument('--clear', dest='clear', action='store_true', default=False) +parser.add_argument('--noclear', dest='clear', action='store_false') args = parser.parse_args() version = args.version @@ -64,9 +66,10 @@ if labname[:4] not in ['Ch10', 'Ch13']: # clear outputs for all but Ch10,Ch13 - cmd = f'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace {nbfile}' - print(f'Running: {cmd}') - os.system(cmd) + if args.clear: + cmd = f'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace {nbfile}' + print(f'Running the clearing command: {cmd}') + os.system(cmd) cmd = f'jupytext --set-formats ipynb,md:myst {nbfile}; jupytext --sync {nbfile}' print(f'Running: {cmd}') diff --git a/docs/source/conf.py b/docs/source/conf.py index b78013f..38f1805 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,11 +10,14 @@ import ISLP version = ISLP.__version__ -lab_version = ISLP.__lab_version__ +lab_version = ISLP.__docs_lab_version__ + myst_enable_extensions = ['substitution'] myst_substitutions = { - "ISLP_lab_link": f"[ISLP_labs {lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})" + "ISLP_lab_link": f"[ISLP_labs/{lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})" + "ISLP_binder_code": f"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/{lab_version}", + "ISLP_lab_version": ISLP.__docs_lab_ISLP_version__ } # -- General configuration diff --git a/docs/source/labs.myst b/docs/source/labs.myst index 67fd61f..80ae7eb 100644 --- a/docs/source/labs.myst +++ b/docs/source/labs.myst @@ -8,6 +8,8 @@ myst_number_code_blocks: python # Labs +{{ ISLP_binder_code }} + The current version of the labs for `ISLP` are included here. ## Package versions @@ -18,8 +20,17 @@ The current version of the labs for `ISLP` are included here. Python packages change frequently. The labs here are built with {{ ISLP_lab_link }}. Visit the lab git repo for specific instructions to install the frozen environment. + + ``` +```{warning} +The version of the `ISLP` library used to build these labs +may differ slightly from the one documented here. +The labs are built with {{ ISLP_lab_version }}. +``` + + ```{toctree} maxdepth: 1 From 25067600a0f91bb5334abca3e1aec542b9307db0 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 13:41:10 -0700 Subject: [PATCH 05/13] BF: changed name of docs version --- docs/fix_and_clear_notebooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/fix_and_clear_notebooks.py b/docs/fix_and_clear_notebooks.py index 853bd5a..fc16f0a 100644 --- a/docs/fix_and_clear_notebooks.py +++ b/docs/fix_and_clear_notebooks.py @@ -3,9 +3,9 @@ from argparse import ArgumentParser from glob import glob -from ISLP import __lab_version__ +from ISLP import __docs_lab_version__ parser = ArgumentParser() -parser.add_argument('--version', default=__lab_version__) +parser.add_argument('--version', default=__docs_lab_version__) parser.add_argument('--clear', dest='clear', action='store_true', default=False) parser.add_argument('--noclear', dest='clear', action='store_false') args = parser.parse_args() From e1e07f87a7afaaa4ef537bcb21b2e12427ee1799 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 14:00:40 -0700 Subject: [PATCH 06/13] BF: punctuation fix --- docs/source/conf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 38f1805..08b0cc9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -2,6 +2,8 @@ # -- Project information +import json + project = 'ISLP' copyright = '2023, ISLP authors' author = 'Jonathan Taylor' @@ -10,15 +12,17 @@ import ISLP version = ISLP.__version__ -lab_version = ISLP.__docs_lab_version__ +docs_version = json.loads(open(os.path.join(dirname, 'docs_version.json')).read()) +lab_version = docs_version['labs'] myst_enable_extensions = ['substitution'] myst_substitutions = { "ISLP_lab_link": f"[ISLP_labs/{lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})" "ISLP_binder_code": f"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/{lab_version}", - "ISLP_lab_version": ISLP.__docs_lab_ISLP_version__ + "ISLP_lab_version": docs_version['library'], } +myst_number_code_blocks = ['python', 'ipython3'] # -- General configuration From 7912716df8ecddb6e0198d7239532d62b6f95eb4 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 14:12:31 -0700 Subject: [PATCH 07/13] BF: syntax errors --- docs/source/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 08b0cc9..aa35fa6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -3,6 +3,7 @@ # -- Project information import json +import os project = 'ISLP' copyright = '2023, ISLP authors' @@ -12,13 +13,17 @@ import ISLP version = ISLP.__version__ +import __main__ +dirname = os.path.split(__main__.__file__)[0] +print(dirname) + docs_version = json.loads(open(os.path.join(dirname, 'docs_version.json')).read()) lab_version = docs_version['labs'] myst_enable_extensions = ['substitution'] myst_substitutions = { - "ISLP_lab_link": f"[ISLP_labs/{lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})" + "ISLP_lab_link": f"[ISLP_labs/{lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})", "ISLP_binder_code": f"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/{lab_version}", "ISLP_lab_version": docs_version['library'], } From cfb865a2dc7ab056c73997d569e5a085fe5947ad Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 14:41:50 -0700 Subject: [PATCH 08/13] docs version JSON --- docs/fix_and_clear_notebooks.py | 16 ++++++++++------ docs/source/conf.py | 5 ++++- docs/source/docs_version.json | 4 ++++ 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 docs/source/docs_version.json diff --git a/docs/fix_and_clear_notebooks.py b/docs/fix_and_clear_notebooks.py index fc16f0a..2e42f03 100644 --- a/docs/fix_and_clear_notebooks.py +++ b/docs/fix_and_clear_notebooks.py @@ -1,20 +1,24 @@ import os +import sys +import json import nbformat from argparse import ArgumentParser from glob import glob -from ISLP import __docs_lab_version__ +import __main__ +dirname = os.path.split(__main__.__file__)[0] +print(dirname) +sys.path.append(os.path.join(dirname, 'source')) +from conf import docs_version +#docs_version = json.loads(open(os.path.join(dirname, 'source', 'docs_version.json')).read()) + parser = ArgumentParser() -parser.add_argument('--version', default=__docs_lab_version__) +parser.add_argument('--version', default=docs_version['labs']) parser.add_argument('--clear', dest='clear', action='store_true', default=False) parser.add_argument('--noclear', dest='clear', action='store_false') args = parser.parse_args() version = args.version -import __main__ -dirname = os.path.split(__main__.__file__)[0] -print(dirname) - for f in glob(os.path.join(dirname, 'source', 'labs', 'Ch14*')): os.remove(f) print(f) diff --git a/docs/source/conf.py b/docs/source/conf.py index aa35fa6..e57aa09 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -17,7 +17,10 @@ dirname = os.path.split(__main__.__file__)[0] print(dirname) -docs_version = json.loads(open(os.path.join(dirname, 'docs_version.json')).read()) +docs_version = {"labs": "v2", + "library": "v0.3.18"} + +#docs_version = json.loads(open(os.path.join(dirname, 'docs_version.json')).read()) lab_version = docs_version['labs'] myst_enable_extensions = ['substitution'] diff --git a/docs/source/docs_version.json b/docs/source/docs_version.json new file mode 100644 index 0000000..1a334d8 --- /dev/null +++ b/docs/source/docs_version.json @@ -0,0 +1,4 @@ +{"labs": "v2", + "library": "v0.3.18", + "comment":"library should be version of ISLP pointed to in ISLP/labs" +} From a421b02212978234a0377b193595e7765a96cda5 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 15:02:26 -0700 Subject: [PATCH 09/13] link for library version --- docs/source/conf.py | 4 ++-- docs/source/installation.myst | 1 - docs/source/labs.myst | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e57aa09..ce81b23 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -27,8 +27,8 @@ myst_substitutions = { "ISLP_lab_link": f"[ISLP_labs/{lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})", - "ISLP_binder_code": f"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/{lab_version}", - "ISLP_lab_version": docs_version['library'], + "ISLP_binder_code": f"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/{lab_version})", + "ISLP_lab_version": "[ISLP/{0}](https://github.com/intro-stat-learning/ISLP_labs/tree/{0})".format(docs_version['library']) } myst_number_code_blocks = ['python', 'ipython3'] diff --git a/docs/source/installation.myst b/docs/source/installation.myst index e89acff..cb42d7f 100644 --- a/docs/source/installation.myst +++ b/docs/source/installation.myst @@ -3,7 +3,6 @@ file_format: mystnb kernelspec: name: python3 display_name: python3 -myst_number_code_blocks: [python] --- diff --git a/docs/source/labs.myst b/docs/source/labs.myst index 80ae7eb..264277b 100644 --- a/docs/source/labs.myst +++ b/docs/source/labs.myst @@ -30,6 +30,10 @@ may differ slightly from the one documented here. The labs are built with {{ ISLP_lab_version }}. ``` +```python +{{ ISLP_binder_code }} +``` + ```{toctree} maxdepth: 1 From e892a64ea2220cff594df21c527ad92cdb240ce3 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 15:19:21 -0700 Subject: [PATCH 10/13] BF: wrong repo --- ISLP/__init__.py | 6 ------ docs/source/conf.py | 2 +- docs/source/labs.myst | 4 ---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/ISLP/__init__.py b/ISLP/__init__.py index 2039803..4e7e3f4 100644 --- a/ISLP/__init__.py +++ b/ISLP/__init__.py @@ -120,9 +120,3 @@ def confusion_table(predicted_labels, from . import _version __version__ = _version.get_versions()['version'] -# related to docs -# __docs_lab_version__ should be a commit on intro-stat-learning/ISLP_labs -# __docs_lab_ISLP_version__ should be the tag in requirements.txt of __docs_lab_version__ - -__docs_lab_version__ = 'v2' -__docs_lab_ISLP_version__ = 'v0.3.18' diff --git a/docs/source/conf.py b/docs/source/conf.py index ce81b23..b81dcbf 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,7 +28,7 @@ myst_substitutions = { "ISLP_lab_link": f"[ISLP_labs/{lab_version}](https://github.com/intro-stat-learning/ISLP_labs/tree/{lab_version})", "ISLP_binder_code": f"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/{lab_version})", - "ISLP_lab_version": "[ISLP/{0}](https://github.com/intro-stat-learning/ISLP_labs/tree/{0})".format(docs_version['library']) + "ISLP_lab_version": "[ISLP/{0}](https://github.com/intro-stat-learning/ISLP/tree/{0})".format(docs_version['library']) } myst_number_code_blocks = ['python', 'ipython3'] diff --git a/docs/source/labs.myst b/docs/source/labs.myst index 264277b..80ae7eb 100644 --- a/docs/source/labs.myst +++ b/docs/source/labs.myst @@ -30,10 +30,6 @@ may differ slightly from the one documented here. The labs are built with {{ ISLP_lab_version }}. ``` -```python -{{ ISLP_binder_code }} -``` - ```{toctree} maxdepth: 1 From 6612f087c8290e9dd990264c30ed960ab4361594 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Wed, 9 Aug 2023 15:37:17 -0700 Subject: [PATCH 11/13] update message about binder --- docs/source/labs.myst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/labs.myst b/docs/source/labs.myst index 80ae7eb..373c500 100644 --- a/docs/source/labs.myst +++ b/docs/source/labs.myst @@ -28,6 +28,10 @@ to install the frozen environment. The version of the `ISLP` library used to build these labs may differ slightly from the one documented here. The labs are built with {{ ISLP_lab_version }}. + +The [Binder](http://mybinder.org) link above will run {{ ISLP_lab_link }} with +library version {{ ISLP_lab_version }}. + ``` From ef199bf2557a253081d84954027c9d2918cbf55d Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Tue, 4 Jun 2024 13:49:58 -0700 Subject: [PATCH 12/13] some update to doc build process --- docs/source/conf.py | 10 +++------- docs/source/docs_version.json | 4 ++-- docs/{ => source}/fix_and_clear_notebooks.py | 5 +---- 3 files changed, 6 insertions(+), 13 deletions(-) rename docs/{ => source}/fix_and_clear_notebooks.py (92%) diff --git a/docs/source/conf.py b/docs/source/conf.py index b81dcbf..c1e337c 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -9,18 +9,14 @@ copyright = '2023, ISLP authors' author = 'Jonathan Taylor' -release = '0.1' import ISLP version = ISLP.__version__ -import __main__ -dirname = os.path.split(__main__.__file__)[0] -print(dirname) -docs_version = {"labs": "v2", - "library": "v0.3.18"} +# this should agree with +docs_version = {"labs": "v2.2", + "library": "v0.4"} -#docs_version = json.loads(open(os.path.join(dirname, 'docs_version.json')).read()) lab_version = docs_version['labs'] myst_enable_extensions = ['substitution'] diff --git a/docs/source/docs_version.json b/docs/source/docs_version.json index 1a334d8..d5c8575 100644 --- a/docs/source/docs_version.json +++ b/docs/source/docs_version.json @@ -1,4 +1,4 @@ -{"labs": "v2", - "library": "v0.3.18", +{"labs": "v2.2", + "library": "v0.4", "comment":"library should be version of ISLP pointed to in ISLP/labs" } diff --git a/docs/fix_and_clear_notebooks.py b/docs/source/fix_and_clear_notebooks.py similarity index 92% rename from docs/fix_and_clear_notebooks.py rename to docs/source/fix_and_clear_notebooks.py index 2e42f03..87e1254 100644 --- a/docs/fix_and_clear_notebooks.py +++ b/docs/source/fix_and_clear_notebooks.py @@ -6,11 +6,8 @@ from glob import glob import __main__ -dirname = os.path.split(__main__.__file__)[0] -print(dirname) -sys.path.append(os.path.join(dirname, 'source')) +dirname = os.path.abspath(os.path.join(os.path.split(__main__.__file__)[0], '..')) from conf import docs_version -#docs_version = json.loads(open(os.path.join(dirname, 'source', 'docs_version.json')).read()) parser = ArgumentParser() parser.add_argument('--version', default=docs_version['labs']) From 2a682c62917564e7abe7ba9cc82c4c950bd99d09 Mon Sep 17 00:00:00 2001 From: Jonathan Taylor Date: Tue, 4 Jun 2024 13:52:18 -0700 Subject: [PATCH 13/13] moved the fix notebooks script --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index a5cd054..1802a4a 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -36,7 +36,7 @@ jobs: run: | git submodule update --init --force docs/ISLP_labs cd docs - python fix_and_clear_notebooks.py --noclear + python source/fix_and_clear_notebooks.py --noclear rm source/labs/Ch*md - name: Make docs