Skip to content

chang_credible: pass scatter's size, colour and marker by keyword - #76

Merged
mmcky merged 1 commit into
mainfrom
chang-credible-scatter-keywords
Nov 22, 2026
Merged

mmcky merged 1 commit into
mainfrom
chang-credible-scatter-keywords

Conversation

@mmcky

@mmcky mmcky commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What

The same one-line change as advanced's copy of this lecture, QuantEcon/lecture-python-advanced.myst#419 (merged 2026-11-22). plot_equilibria in chang_credible passed the size, colour and marker to Axes.scatter positionally:

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

Passing marker positionally has been deprecated since Matplotlib 3.10, and it becomes keyword-only in 3.12. So each of the page's two calls of plot_equilibria prints a MatplotlibDeprecationWarning into its output. The values are unchanged, so the figures should be the same. chang_ramsey's similar call already passes marker by keyword, and is left as it is.

This is part of reporting lecture fixes upstream to each lecture's source of truth (QuantEcon/project-monorepo#77). dp publishes this copy of the lecture.

Validation

Done on 2026-11-22, a full validation: fresh builds with no cache of this pull request and of main, every notebook executed, both green. The evidence is in the comment below.

This changes lecture content, so it needs a person's review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL

The same change as advanced's copy of this lecture
(QuantEcon/lecture-python-advanced.myst#419, merged 2026-11-22):
plot_equilibria passed `s`, `c` and `marker` to Axes.scatter positionally.
Passing `marker` positionally is deprecated since Matplotlib 3.10 and
becomes keyword-only in 3.12, so each of the page's two calls of
plot_equilibria printed a MatplotlibDeprecationWarning into its output.
The values are unchanged, so the figure is the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WT8bMacV9Lmy1VLUc6XJoL
@mmcky

mmcky commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Validation: a full validation

As for dp's last upgrade (#75): a fresh build with no cache of main and of this pull request, each executing all 51 notebooks in ghcr.io/quantecon/quantecon-build:latest (cache.yml). Each was then rendered by ci.yml, which restored exactly that build's cache (its key names the run) and executed nothing.

main at 5aaa712, 2026-11-22 this pull request at b7647e4, 2026-11-22
fresh build 45012310197 45012314792
render 45015664442 45015670949

chang_credible. The two MatplotlibDeprecationWarnings are gone, and both figures are byte-identical. The only other difference is pip's progress spinner while installing polytope.

Build logs. No Sphinx warning on either side.

The rest of the HTML. 13 of 57 pages differ in all. Besides chang_credible, there are 11 pages of output noise, the same as between any two builds: unseeded draws, timings and solver printouts. There is also the status page, with its build times.

@mmcky
mmcky marked this pull request as ready for review November 22, 2026 11:17
Copilot AI adaptive review requested due to automatic review settings November 22, 2026 11:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Because the change affects executable lecture content and rendered figures, human confirmation is still needed to verify visual and notebook-output equivalence across supported Matplotlib and publishing environments.

No open issues 🎉

What changed in this PR

Updates chang_credible.md to pass scatter plot styling arguments by keyword, preventing Matplotlib deprecation warnings while preserving the existing figure output.

Changes:

  • Passes scatter size, colour, and marker via keyword arguments.
  • Preserves the existing values and plot ordering.
  • Keeps both existing plot_equilibria calls unchanged.
File Description
lectures/​chang_credible.md Updates the plot_equilibria scatter call to use keyword arguments for size, colour, and marker.

Review effort: Lite (adaptive)

@mmcky

mmcky commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Validation correction: pages whose only difference is a figure

The evidence comment above says 13 of 57 pages differ. The comparison behind it compared a figure only when the page wraps it in a link, and this series doesn't, so a page whose only difference is a figure wasn't counted. With every figure now compared by content, 27 of 57 pages differ. The 14 added pages differ only in figures:

Page Figures that differ, and why
amss2 figure 2 of 2, from a long simulation whose Markov states mc.simulate draws without a seed
amss3 figures 1 and 4 of 5, from a long simulation whose Markov states mc.simulate draws without a seed
career figure 5 of 6, from qe.random.draw, which draws without a seed
jv figures 1 and 2 of 3, from unseeded draws (np.random.beta, np.random.uniform)
lq_inventories figures 1, 2, 4, 5, 6, 12, 15 and 16 of 16, from simulate, which calls LQ.compute_sequence without a seed
lqcontrol figures 1, 2, 8, 9 and 10 of 10, from LQ.compute_sequence, which draws its shocks without a seed
lqramsey figures 1 to 6 of 6, from paths drawn with numpy's unseeded randn
markov_jump_lq figure 2 of 52, from compute_sequence, which draws its shocks without a seed
perm_income figures 1 and 2 of 3, from unseeded draws (np.random.randn)
perm_income_cons figures 1 to 6 of 6, from lss.simulate, which draws without a seed
smoothing figure 1 of 2, from a simulation whose seed is itself drawn at random (np.random.randint)
tax_smoothing_1 figures 1 to 3 of 3, from compute_sequence, which draws its shocks without a seed
tax_smoothing_2 figures 1 to 4 of 4, from compute_sequence, which draws its shocks without a seed
tax_smoothing_3 figures 1 and 2 of 2, from compute_sequence, which draws its shocks without a seed

This pull request's own pages. chang_credible, the page it changes, has the same two figures on both sides, byte for byte, as the evidence comment says.

None of the added pages is one this pull request changes, and each also differs when the same main build is compared with the build of #81, which changes only the conda channel's name and installs the same packages. The conclusion doesn't change: no other page's prose differs.

@mmcky
mmcky merged commit e9b47eb into main Nov 22, 2026
4 checks passed
@mmcky
mmcky deleted the chang-credible-scatter-keywords branch November 22, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants