QuantEcon / QuantEcon/lecture-python-advanced.myst

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

Open Beginner friendly
#348 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
37
Forks
26
Avg merge
13d 22h
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the listed lines in lectures/chang_credible.md, BCG_complete_mkts.md, BCG_incomplete_mkts.md, and knowing_forecasts_of_others.md. Start by comparing the affected calls with the warning text and the existing warning-free to_image example. Done means the keyword and engine deprecation warnings no longer appear during full re-execution validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, plotly, python
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.