Skip to content

Commit 940f676

Browse files
committed
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
1 parent 75b6e19 commit 940f676

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ dependencies:
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/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)