From 153720b907239e18ff8a17a4532b7bdf4b7ac786 Mon Sep 17 00:00:00 2001 From: triasha72 Date: Sun, 23 Aug 2026 11:16:04 -0400 Subject: [PATCH 1/3] ci: reproduce notebooks from clean kernels --- .github/workflows/notebooks.yml | 33 +++++++++++++++++++++++++++++++++ READMe.md | 6 ++++++ Requirements.txt | 15 +-------------- 3 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/notebooks.yml diff --git a/.github/workflows/notebooks.yml b/.github/workflows/notebooks.yml new file mode 100644 index 0000000..1f174be --- /dev/null +++ b/.github/workflows/notebooks.yml @@ -0,0 +1,33 @@ +name: Reproduce notebooks + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + execute: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: pip + - name: Install dependencies + run: python -m pip install -r requirements.txt + - name: Execute every study from a clean kernel + env: + MPLBACKEND: Agg + run: | + mkdir -p /tmp/executed-notebooks + for notebook in notebooks/*.ipynb; do + jupyter nbconvert \ + --to notebook \ + --execute "$notebook" \ + --output-dir /tmp/executed-notebooks \ + --ExecutePreprocessor.timeout=300 + done diff --git a/READMe.md b/READMe.md index 6241d5c..e90b69a 100644 --- a/READMe.md +++ b/READMe.md @@ -1,5 +1,7 @@ # Surrogate Model Learning +[![Reproduce notebooks](https://github.com/triasha72/Surrogate-model-learning/actions/workflows/notebooks.yml/badge.svg)](https://github.com/triasha72/Surrogate-model-learning/actions/workflows/notebooks.yml) + Learning surrogate modeling from scratch — starting with the basics and working toward real engineering applications. @@ -114,6 +116,10 @@ pip install -r requirements.txt jupyter notebook ``` +Every notebook is also executed from a clean kernel in GitHub Actions. This +checks that the committed studies can be reproduced with the pinned dependency +versions instead of relying on variables left in an interactive session. + ## Notebooks | Notebook | Topic | Key Result | diff --git a/Requirements.txt b/Requirements.txt index 10610e1..b91233d 100644 --- a/Requirements.txt +++ b/Requirements.txt @@ -1,19 +1,6 @@ -numpy -scipy -matplotlib -jupyter -scikit-learn -pyDOE2 - -## Installation - -Create environment and install dependencies: - -pip install -r requirements.txt - numpy==1.26.4 scipy==1.11.4 matplotlib==3.8.2 scikit-learn==1.4.0 pyDOE2==1.3.0 -jupyter==1.0.0ß \ No newline at end of file +jupyter==1.0.0 From e4c660f67da8b9d9f976f609a40229c539593f40 Mon Sep 17 00:00:00 2001 From: triasha72 Date: Sun, 23 Aug 2026 11:18:05 -0400 Subject: [PATCH 2/3] fix: normalize requirements filename --- Requirements.txt => requirements.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Requirements.txt => requirements.txt (100%) diff --git a/Requirements.txt b/requirements.txt similarity index 100% rename from Requirements.txt rename to requirements.txt From cf96b903fa3afa730fcdee9b98cf8a4b1a3b22b9 Mon Sep 17 00:00:00 2001 From: triasha72 Date: Sun, 23 Aug 2026 11:21:20 -0400 Subject: [PATCH 3/3] fix: pin compatible notebook runtime --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index b91233d..8fb2859 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ matplotlib==3.8.2 scikit-learn==1.4.0 pyDOE2==1.3.0 jupyter==1.0.0 +ipython==8.22.1