Skip to content

Commit 6c93e96

Browse files
authored
⬆️ Upgrade build software and dependencies (#768)
* ⬆️ Upgrade build software and dependencies - 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 * Fix YAML syntax error in ci.yml * 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. * ⬆️ Configure dependabot to ignore Python version updates Python version should be constrained by the anaconda distribution version specified in environment.yml, not updated independently by dependabot. * Fix dependabot python ignore rule to include versions constraint * 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.
1 parent 137feaa commit 6c93e96

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@ updates:
1111
prefix: ⬆️
1212
schedule:
1313
interval: weekly
14+
15+
- package-ecosystem: "conda"
16+
directory: "/"
17+
commit-message:
18+
prefix: ⬆️
19+
schedule:
20+
interval: weekly
21+
ignore:
22+
- dependency-name: "jupyter-book"
23+
versions: [">=2.0"]
24+
- dependency-name: "python"
25+
# Python version should be constrained by the anaconda distribution version
26+
versions: [">0"]

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ jobs:
4343
- name: Display Pip Versions
4444
shell: bash -l {0}
4545
run: pip list
46-
- name: Download "build" folder (cache)
47-
uses: dawidd6/action-download-artifact@v11
48-
with:
49-
workflow: cache.yml
50-
branch: main
51-
name: build-cache
52-
path: _build
46+
# - name: Download "build" folder (cache)
47+
# uses: dawidd6/action-download-artifact@v11
48+
# with:
49+
# workflow: cache.yml
50+
# branch: main
51+
# name: build-cache
52+
# path: _build
5353
# Build Assets (Download Notebooks and PDF via LaTeX)
5454
- name: Build Download Notebooks (sphinx-tojupyter)
5555
shell: bash -l {0}

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ channels:
33
- default
44
dependencies:
55
- python=3.13
6-
- anaconda=2025.06
6+
- anaconda=2025.12
77
- pip
88
- pip:
9-
- jupyter-book==1.0.4post1
10-
- quantecon-book-theme==0.15.0
9+
- jupyter-book>=1.0.4post1,<2.0
10+
- quantecon-book-theme==0.15.1
1111
- sphinx-tojupyter==0.4.0
1212
- sphinxext-rediraffe==0.2.7
1313
- sphinx-exercise==1.2.0

lectures/newton_method.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,22 +1074,21 @@ Let's run through each initial guess and check the output
10741074
```{code-cell} ipython3
10751075
:tags: [raises-exception]
10761076
1077-
attempt = 1
1078-
for init in initLs:
1077+
for attempt, init in enumerate(initLs, start=1):
10791078
print(f"Attempt {attempt}: Starting value is {init} \n")
10801079
%time p = newton(lambda p: e(p, A, b, c), init, tol=1e-15, max_iter=15)
10811080
print("-" * 64)
1082-
attempt += 1
10831081
```
10841082

10851083
We can see that Newton's method may fail for some starting values.
10861084

10871085
Sometimes it may take a few initial guesses to achieve convergence.
10881086

1089-
Substitute the result back to the formula to check our result
1087+
Substitute the result back to the formula to check our result using the second initial guess which converges
10901088

10911089
```{code-cell} ipython3
1092-
e(p, A, b, c)
1090+
p_solution = newton(lambda p: e(p, A, b, c), initLs[1], tol=1e-15, max_iter=15)
1091+
e(p_solution, A, b, c)
10931092
```
10941093

10951094
We can see the result is very accurate.

0 commit comments

Comments
 (0)