From ef36b04f47f00a7dc39baa076a9e26f843e37d12 Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Fri, 19 Jul 2024 19:41:12 +0430 Subject: [PATCH 1/5] fix : doc_run script --> notebook_run.py --- Otherfiles/doc_run.bat | 17 ----------------- .../{notebook_check.py => notebook_run.py} | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 Otherfiles/doc_run.bat rename Otherfiles/{notebook_check.py => notebook_run.py} (50%) diff --git a/Otherfiles/doc_run.bat b/Otherfiles/doc_run.bat deleted file mode 100644 index 224b9ea6..00000000 --- a/Otherfiles/doc_run.bat +++ /dev/null @@ -1,17 +0,0 @@ -@echo off -call python -m art text "Doc Run Script" -call python setup.py install -for %%f in (Document\*.ipynb) do ( -echo %%f is running! -call python -m nbconvert %%f --execute --clear-output --log-level=ERROR -if ERRORLEVEL 1 (echo %%f Failed! & exit /b 0) else (echo %%f Done!) -echo -------------------------- -) - -copy Document\Document_files\cm1.csv Otherfiles\test.csv -copy Document\Document_files\cm1.html Otherfiles\test.html -copy Document\Document_files\cm1.obj Otherfiles\test.obj -copy Document\Document_files\cm1.pycm Otherfiles\test.pycm -copy Document\Document_files\cp.comp Otherfiles\test.comp - -call python Otherfiles\version_check.py diff --git a/Otherfiles/notebook_check.py b/Otherfiles/notebook_run.py similarity index 50% rename from Otherfiles/notebook_check.py rename to Otherfiles/notebook_run.py index a8f8ae75..52d8c24a 100644 --- a/Otherfiles/notebook_check.py +++ b/Otherfiles/notebook_run.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- -"""Notebook-check script.""" +"""Notebook-run script.""" import os +import shutil +import pycm import nbformat from nbconvert.preprocessors import ExecutePreprocessor from art import tprint @@ -17,11 +19,19 @@ "Example7", "Example8"] +COPY_DICT = {os.path.join("Document", "Document_files", "cm1.csv"): os.path.join("Otherfiles", "test.csv"), + os.path.join("Document", "Document_files", "cm1.html"): os.path.join("Otherfiles", "test.html"), + os.path.join("Document", "Document_files", "cm1.obj"): os.path.join("Otherfiles", "test.obj"), + os.path.join("Document", "Document_files", "cm1.pycm"): os.path.join("Otherfiles", "test.pycm"), + os.path.join("Document", "Document_files", "cp.comp"): os.path.join("Otherfiles", "test.comp"), + } + EXTENSION = ".ipynb" if __name__ == "__main__": tprint("PYCM", "bulbhead") - tprint("Document", "bulbhead") + tprint("v{0}".format(pycm.__version__), "bulbhead") + tprint("Notebook Run", "amc3line") print("Processing ...") for index, notebook in enumerate(NOTEBOOKS_LIST): ep = ExecutePreprocessor(timeout=6000, kernel_name='python3') @@ -32,3 +42,7 @@ with open(path + EXTENSION, 'w', encoding='utf-8') as f: nbformat.write(nb, f) print("{0}.{1} [OK]".format(str(index + 1), notebook)) + print("\nCopying ...") + for index, item in enumerate(sorted(COPY_DICT)): + shutil.copy(item, COPY_DICT[item]) + print("\t{0}.{1} --> {2} [OK]".format(index + 1, item, COPY_DICT[item])) From 27f64cc3e0577064754a3ccc8d7d0f4648f465c6 Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Fri, 19 Jul 2024 19:41:59 +0430 Subject: [PATCH 2/5] fix : notebook_run.py added to test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a511ad88..29a6afa6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: - name: Notebook check run: | pip install notebook>=5.2.2 - python Otherfiles/notebook_check.py + python Otherfiles/notebook_run.py if: matrix.python-version == env.TEST_PYTHON_VERSION && matrix.os == env.TEST_OS - name: Other tests run: | From 01adedbac33af52920cc1aca6941e4e8bb2cd18e Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Fri, 19 Jul 2024 19:43:43 +0430 Subject: [PATCH 3/5] doc : RELEASE.md updated --- Otherfiles/RELEASE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Otherfiles/RELEASE.md b/Otherfiles/RELEASE.md index 058c3b4d..1589ab29 100644 --- a/Otherfiles/RELEASE.md +++ b/Otherfiles/RELEASE.md @@ -1,7 +1,7 @@ # PyCM Release Instructions -**Last Update: 2024-07-02** +**Last Update: 2024-07-19** 1. Create the `release` branch under `dev` 2. Update all version tags @@ -18,7 +18,7 @@ 4. Update `.github/ISSUE_TEMPLATE/bug_report.yml` 1. Add new version tag to `PyCM version` dropbox options 5. Update Document - 1. Run `Otherfiles/doc_run.bat` + 1. Run `Otherfiles/notebook_run.py` 6. Create a PR from `release` to `dev` 1. Title: `Version x.x` (Example: `Version 0.1`) 2. Tag all related issues From 8f8805062e02f6cee7e7f16ac6fcc2e9a1ea5f16 Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Fri, 19 Jul 2024 19:44:42 +0430 Subject: [PATCH 4/5] doc : CHANGELOG.md updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f948a5f..a8f3dace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `__trapezoidal_numeric_integral__` function updated - Diagrams updated - Document modified +- Document build system updated - `AUTHORS.md` updated - `README.md` modified - Test system modified From 4f14266525ad7586e6b347bbfb014f5fe2141bd2 Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Fri, 19 Jul 2024 19:55:46 +0430 Subject: [PATCH 5/5] fix : minor edit in notebook_run.py --- Otherfiles/notebook_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Otherfiles/notebook_run.py b/Otherfiles/notebook_run.py index 52d8c24a..4244dfdd 100644 --- a/Otherfiles/notebook_run.py +++ b/Otherfiles/notebook_run.py @@ -41,7 +41,7 @@ ep.preprocess(nb, {'metadata': {'path': 'Document/'}}) with open(path + EXTENSION, 'w', encoding='utf-8') as f: nbformat.write(nb, f) - print("{0}.{1} [OK]".format(str(index + 1), notebook)) + print("\t{0}.{1} [OK]".format(str(index + 1), notebook)) print("\nCopying ...") for index, item in enumerate(sorted(COPY_DICT)): shutil.copy(item, COPY_DICT[item])