From a87f1bb6babb7e1cfeb9b8bd949041b474467f00 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Sun, 22 Nov 2026 21:22:27 +1100 Subject: [PATCH] Kaleido lectures: drop to_image's deprecated engine argument BCG_complete_mkts, BCG_incomplete_mkts and knowing_forecasts_of_others call plotly's fig.to_image(format="png", engine="kaleido"). Plotly has deprecated the engine argument, since Kaleido is now its only engine, so each of the seven calls printed a DeprecationWarning ("Support for the 'engine' argument is deprecated and will be removed after September 2025. Kaleido will be the only supported engine at that time.") into its output. Without the argument plotly uses Kaleido all the same, so the images are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL --- lectures/BCG_complete_mkts.md | 2 +- lectures/BCG_incomplete_mkts.md | 10 +++++----- lectures/knowing_forecasts_of_others.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lectures/BCG_complete_mkts.md b/lectures/BCG_complete_mkts.md index 4a4a6dc4..08d13a1d 100644 --- a/lectures/BCG_complete_mkts.md +++ b/lectures/BCG_complete_mkts.md @@ -1069,7 +1069,7 @@ fig.update_layout(width=500, fig.update_layout(scene_camera=dict(eye=dict(x=2, y=-2, z=1.5))) # Export to PNG file -Image(fig.to_image(format="png", engine="kaleido")) +Image(fig.to_image(format="png")) # fig.show() will provide interactive plot when running # notebook locally ``` diff --git a/lectures/BCG_incomplete_mkts.md b/lectures/BCG_incomplete_mkts.md index 150b9e6b..7bf1a2cd 100644 --- a/lectures/BCG_incomplete_mkts.md +++ b/lectures/BCG_incomplete_mkts.md @@ -1168,7 +1168,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2))) fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)') # Export to PNG file -Image(fig.to_image(format="png", engine="kaleido")) +Image(fig.to_image(format="png")) # fig.show() will provide interactive plot when running # code locally ``` @@ -1485,7 +1485,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2))) fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)') # Export to PNG file -Image(fig.to_image(format="png", engine="kaleido")) +Image(fig.to_image(format="png")) # fig.show() will provide interactive plot when running # code locally ``` @@ -1533,7 +1533,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2))) fig.update_layout(title='Equilibrium firm valuation for the grid of (k,b)') # Export to PNG file -Image(fig.to_image(format="png", engine="kaleido")) +Image(fig.to_image(format="png")) # fig.show() will provide interactive plot when running # code locally ``` @@ -1586,7 +1586,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2))) fig.update_layout(title='Equilibrium equity valuation for the grid of (k,b)') # Export to PNG file -Image(fig.to_image(format="png", engine="kaleido")) +Image(fig.to_image(format="png")) # fig.show() will provide interactive plot when running # code locally ``` @@ -1615,7 +1615,7 @@ fig.update_layout(scene_camera=dict(eye=dict(x=1.5, y=-1.5, z=2))) fig.update_layout(title='Equilibrium bond valuation for the grid of (k,b)') # Export to PNG file -Image(fig.to_image(format="png", engine="kaleido")) +Image(fig.to_image(format="png")) # fig.show() will provide interactive plot when running # code locally ``` diff --git a/lectures/knowing_forecasts_of_others.md b/lectures/knowing_forecasts_of_others.md index 09902a4f..1cea620b 100644 --- a/lectures/knowing_forecasts_of_others.md +++ b/lectures/knowing_forecasts_of_others.md @@ -1021,7 +1021,7 @@ fig.update_layout(title=r'Impulse Response Function', yaxis_title=r'$k^{i}_{t}$') fig1 = fig # Export to PNG file -Image(fig1.to_image(format="png", engine="kaleido")) +Image(fig1.to_image(format="png")) # fig1.show() will provide interactive plot when running # notebook locally ```