From 8ff5ebdf1e13460451d1758a63ff33719814c938 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 22 Dec 2025 12:11:44 +1100 Subject: [PATCH 1/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20build=20soft?= =?UTF-8?q?ware=20and=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Upgrade anaconda to 2025.12 - Upgrade quantecon-book-theme to 0.15.1 - Add jupyter-book version constraint (<2.0) - Configure Dependabot for conda ecosystem with jupyter-book restriction - Temporarily disable build cache for full execution check --- .github/dependabot.yml | 10 ++++++++++ .github/workflows/ci.yml | 10 +++++----- environment.yml | 6 +++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7809c2a97..bb2ad36d2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,13 @@ updates: prefix: ⬆️ schedule: interval: weekly + + - package-ecosystem: "conda" + directory: "/" + commit-message: + prefix: ⬆️ + schedule: + interval: weekly + ignore: + - dependency-name: "jupyter-book" + versions: [">=2.0"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f418e0b10..64d035d8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,11 +43,11 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v11 - with: - workflow: cache.yml - branch: main + # - name: Download "build" folder (cache) + # uses: dawidd6/action-download-artifact@v11 + # with: + # workflow: cache.yml + # branch: main name: build-cache path: _build # Build Assets (Download Notebooks and PDF via LaTeX) diff --git a/environment.yml b/environment.yml index adb1b2856..58b7cc019 100644 --- a/environment.yml +++ b/environment.yml @@ -3,11 +3,11 @@ channels: - default dependencies: - python=3.13 - - anaconda=2025.06 + - anaconda=2025.12 - pip - pip: - - jupyter-book==1.0.4post1 - - quantecon-book-theme==0.15.0 + - jupyter-book>=1.0.4post1,<2.0 + - quantecon-book-theme==0.15.1 - sphinx-tojupyter==0.4.0 - sphinxext-rediraffe==0.2.7 - sphinx-exercise==1.2.0 From 3d9b42dc304a751f0be7d159a2be8cc87c9ca30c Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 22 Dec 2025 12:16:36 +1100 Subject: [PATCH 2/6] Fix YAML syntax error in ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64d035d8e..55cdc9124 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,8 +48,8 @@ jobs: # with: # workflow: cache.yml # branch: main - name: build-cache - path: _build + # name: build-cache + # path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build Download Notebooks (sphinx-tojupyter) shell: bash -l {0} From 48334ceb934506ea2275c5ee1a1f1408b551e161 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 23 Dec 2025 12:15:35 +1100 Subject: [PATCH 3/6] FIX: Use p_solution variable in exercise 2 to avoid dimension mismatch The variable p was being reused from the high-dimensional problem section (3000-dim vector) when the raises-exception cell failed, causing a shape mismatch with the 3x3 matrix A defined in the exercise. --- lectures/newton_method.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lectures/newton_method.md b/lectures/newton_method.md index 54194ca80..0573e15b3 100644 --- a/lectures/newton_method.md +++ b/lectures/newton_method.md @@ -1077,7 +1077,7 @@ Let's run through each initial guess and check the output attempt = 1 for init in initLs: print(f"Attempt {attempt}: Starting value is {init} \n") - %time p = newton(lambda p: e(p, A, b, c), init, tol=1e-15, max_iter=15) + %time p_solution = newton(lambda p: e(p, A, b, c), init, tol=1e-15, max_iter=15) print("-" * 64) attempt += 1 ``` @@ -1089,7 +1089,7 @@ Sometimes it may take a few initial guesses to achieve convergence. Substitute the result back to the formula to check our result ```{code-cell} ipython3 -e(p, A, b, c) +e(p_solution, A, b, c) ``` We can see the result is very accurate. From 42b58d625f667cce8a9d2ed474791316c0f5fa9d Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 23 Dec 2025 13:00:55 +1100 Subject: [PATCH 4/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Configure=20dependabot?= =?UTF-8?q?=20to=20ignore=20Python=20version=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python version should be constrained by the anaconda distribution version specified in environment.yml, not updated independently by dependabot. --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bb2ad36d2..1ab7ca35e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,3 +21,5 @@ updates: ignore: - dependency-name: "jupyter-book" versions: [">=2.0"] + - dependency-name: "python" + # Python version should be constrained by the anaconda distribution version From 6945f8aa7a02ed4f379f63c8044360241ec89d9e Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 23 Dec 2025 14:20:38 +1100 Subject: [PATCH 5/6] Fix dependabot python ignore rule to include versions constraint --- .github/dependabot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1ab7ca35e..048041084 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,3 +23,4 @@ updates: versions: [">=2.0"] - dependency-name: "python" # Python version should be constrained by the anaconda distribution version + versions: [">0"] From 86098c99cf74cbc1634e9ef5c3d7828d07eb76ea Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 23 Dec 2025 15:41:18 +1100 Subject: [PATCH 6/6] FIX: Compute p_solution explicitly with converging initial value The raises-exception cell stops at the first failure, so p_solution may not be assigned. Now we explicitly compute p_solution using initLs[1] which is known to converge. --- lectures/newton_method.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lectures/newton_method.md b/lectures/newton_method.md index 0573e15b3..1966b06f3 100644 --- a/lectures/newton_method.md +++ b/lectures/newton_method.md @@ -1074,21 +1074,20 @@ Let's run through each initial guess and check the output ```{code-cell} ipython3 :tags: [raises-exception] -attempt = 1 -for init in initLs: +for attempt, init in enumerate(initLs, start=1): print(f"Attempt {attempt}: Starting value is {init} \n") - %time p_solution = newton(lambda p: e(p, A, b, c), init, tol=1e-15, max_iter=15) + %time p = newton(lambda p: e(p, A, b, c), init, tol=1e-15, max_iter=15) print("-" * 64) - attempt += 1 ``` We can see that Newton's method may fail for some starting values. Sometimes it may take a few initial guesses to achieve convergence. -Substitute the result back to the formula to check our result +Substitute the result back to the formula to check our result using the second initial guess which converges ```{code-cell} ipython3 +p_solution = newton(lambda p: e(p, A, b, c), initLs[1], tol=1e-15, max_iter=15) e(p_solution, A, b, c) ```