Skip to content

Commit 915366c

Browse files
mmckyCopilot
andauthored
⬆️ Upgrade build software and dependencies (#293)
* ⬆️ 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 - Add nb_merge_streams and path_to_docs to _config.yml - Temporarily disable build cache for full execution check * Fix plotly orca timeout errors by using kaleido engine - Add kaleido to environment.yml for reliable image export - Update all fig.to_image() calls to use engine='kaleido' - Fixes execution errors in BCG_complete_mkts, BCG_incomplete_mkts, and knowing_forecasts_of_others - Kaleido is the modern replacement for orca and works reliably in CI environments * Fix scipy gradient compatibility for Python 3.13 - Update objf_prime to return 1D gradient array instead of 2D - Fixes 'Input array gradx must be 1D' error in amss2 and amss3 - Resolves compatibility issue with scipy.optimize.fmin_slsqp in Python 3.13 * ⬆️ 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. * Update .github/dependabot.yml Co-authored-by: Copilot <[email protected]> * Re-enable build cache in CI workflow --------- Co-authored-by: Copilot <[email protected]>
1 parent 18b02bb commit 915366c

File tree

7 files changed

+30
-14
lines changed

7 files changed

+30
-14
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"]

environment.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ 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.9.3
9+
- jupyter-book>=1.0.4post1,<2.0
10+
- quantecon-book-theme==0.15.1
1111
- sphinx-tojupyter==0.3.1
1212
- sphinxext-rediraffe==0.2.7
1313
- sphinx-exercise==1.0.1
1414
- sphinx-proof==0.2.1
1515
- sphinxcontrib-youtube==1.4.1
1616
- sphinx-togglebutton==0.3.2
1717
- sphinx-reredirects==0.1.4
18+
- kaleido
1819

1920

lectures/BCG_complete_mkts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ fig.update_layout(width=500,
11941194
fig.update_layout(scene_camera=dict(eye=dict(x=2, y=-2, z=1.5)))
11951195
11961196
# Export to PNG file
1197-
Image(fig.to_image(format="png"))
1197+
Image(fig.to_image(format="png", engine="kaleido"))
11981198
# fig.show() will provide interactive plot when running
11991199
# notebook locally
12001200
```

lectures/BCG_incomplete_mkts.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2)))
12701270
fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)')
12711271
12721272
# Export to PNG file
1273-
Image(fig.to_image(format="png"))
1273+
Image(fig.to_image(format="png", engine="kaleido"))
12741274
# fig.show() will provide interactive plot when running
12751275
# code locally
12761276
```
@@ -1634,7 +1634,7 @@ fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)')
16341634
16351635
16361636
# Export to PNG file
1637-
Image(fig.to_image(format="png"))
1637+
Image(fig.to_image(format="png", engine="kaleido"))
16381638
# fig.show() will provide interactive plot when running
16391639
# code locally
16401640
```
@@ -1685,7 +1685,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2)))
16851685
fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)')
16861686
16871687
# Export to PNG file
1688-
Image(fig.to_image(format="png"))
1688+
Image(fig.to_image(format="png", engine="kaleido"))
16891689
# fig.show() will provide interactive plot when running
16901690
# code locally
16911691
```
@@ -1746,7 +1746,7 @@ fig.update_layout(title='Equilibrium equity valuation for the grid of (k,b)')
17461746
17471747
17481748
# Export to PNG file
1749-
Image(fig.to_image(format="png"))
1749+
Image(fig.to_image(format="png", engine="kaleido"))
17501750
# fig.show() will provide interactive plot when running
17511751
# code locally
17521752
```
@@ -1776,7 +1776,7 @@ fig.update_layout(title='Equilibrium bond valuation for the grid of (k,b)')
17761776
17771777
17781778
# Export to PNG file
1779-
Image(fig.to_image(format="png"))
1779+
Image(fig.to_image(format="png", engine="kaleido"))
17801780
# fig.show() will provide interactive plot when running
17811781
# code locally
17821782
```

lectures/_config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ sphinx:
3939
'https://doi.org/10.1086/262078',
4040
'https://keras.io/',
4141
'https://data.oecd.org/']
42+
nb_merge_streams: true
4243
nb_mime_priority_overrides: [
4344
# HTML
4445
['html', 'application/vnd.jupyter.widget-view+json', 10],
@@ -85,6 +86,7 @@ sphinx:
8586
header_organisation: QuantEcon
8687
repository_url: https://github.com/QuantEcon/lecture-python-advanced.myst
8788
nb_repository_url: https://github.com/QuantEcon/lecture-python-advanced.notebooks
89+
path_to_docs: lectures
8890
twitter: quantecon
8991
twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
9092
og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png

lectures/_static/lecture_specific/amss2/recursive_allocation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ def objf_prime(x):
231231

232232
epsilon = 1e-7
233233
x0 = np.asarray(x, dtype=float)
234-
f0 = np.atleast_1d(objf(x0))
235-
jac = np.zeros([len(x0), len(f0)])
234+
f0 = objf(x0)
235+
grad = np.zeros(len(x0))
236236
dx = np.zeros(len(x0))
237237
for i in range(len(x0)):
238238
dx[i] = epsilon
239-
jac[i] = (objf(x0+dx) - f0)/epsilon
239+
grad[i] = (objf(x0+dx) - f0)/epsilon
240240
dx[i] = 0.0
241241

242-
return jac.transpose()
242+
return grad
243243

244244
def cons(z):
245245
c, n, xprime, T = z[:S], z[S:2 * S], z[2 * S:3 * S], z[3 * S:]

lectures/knowing_forecasts_of_others.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ fig.update_layout(title=r'Impulse Response Function',
10201020
yaxis_title=r'$k^{i}_{t}$')
10211021
fig1 = fig
10221022
# Export to PNG file
1023-
Image(fig1.to_image(format="png"))
1023+
Image(fig1.to_image(format="png", engine="kaleido"))
10241024
# fig1.show() will provide interactive plot when running
10251025
# notebook locally
10261026
```

0 commit comments

Comments
 (0)