Skip to content

Clean up pre-existing deprecation warnings (matplotlib scatter marker, plotly kaleido engine) #348

Description

@mmcky

These two deprecation warnings surfaced during the full re-execution validation for the anaconda=2026.06 upgrade (#346). They are pre-existing (not caused by that upgrade) and non-blocking — the affected lectures still build — but worth cleaning up, especially the matplotlib one, which becomes a hard error in a future release.

1. Matplotlib — positional marker in scatter() (will error in matplotlib 3.12)

lectures/chang_credible.md:849

ax.scatter(R[0], R[1], 150, 'black', 'o', zorder=1)

MatplotlibDeprecationWarning: Passing the marker parameter of scatter() positionally is deprecated since Matplotlib 3.10; the parameter will become keyword-only in 3.12.

Suggested fix — pass the size/color/marker as keywords:

ax.scatter(R[0], R[1], s=150, c='black', marker='o', zorder=1)

2. plotly to_image(..., engine="kaleido") deprecation

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.

Kaleido is already the default/only engine going forward, so the engine="kaleido" argument can simply be dropped (several calls in knowing_forecasts_of_others.md already omit it, e.g. fig2.to_image(format="png")).

Affected lines:

  • lectures/BCG_complete_mkts.md:1197
  • lectures/BCG_incomplete_mkts.md:1273, :1637, :1688, :1749, :1779
  • lectures/knowing_forecasts_of_others.md:1024
# from
Image(fig.to_image(format="png", engine="kaleido"))
# to
Image(fig.to_image(format="png"))

Tasks

  • chang_credible: pass s / c / marker as keywords in ax.scatter(...)
  • BCG_complete_mkts, BCG_incomplete_mkts, knowing_forecasts_of_others: drop engine="kaleido" from to_image(...) calls

Found during validation in #346.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions