Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 28, 2025

This PR sanitizes all lecture files by removing local matplotlib figsize adjustments as requested in the style cleanup issue.

Changes Made

  • Removed plt.rcParams["figure.figsize"] from 28 lecture files: All instances of local figsize configuration have been eliminated from the codebase
  • Preserved import structure: Maintained clean import sections while removing only the figsize configuration lines
  • Special handling for newton_method.md: This file used a different figsize (10, 5.7) vs the standard (11, 5), but has been cleaned like all others

Files Modified

All 28 files that contained local figsize settings have been updated:

  • aiyagari.md, cake_eating_problem.md, career.md, cass_koopmans_2.md
  • exchangeable.md, finite_markov.md, inventory_dynamics.md, lake_model.md
  • likelihood_bayes.md, linear_algebra.md, lln_clt.md, lq_inventories.md
  • lqcontrol.md, markov_asset.md, mccall_model.md, mix_model.md
  • mle.md, multi_hyper.md, multivariate_normal.md, newton_method.md
  • ols.md, optgrowth.md, perm_income.md, rational_expectations.md
  • samuelson.md, sir_model.md, uncertainty_traps.md, wealth_dynamics.md

Impact on Figure Rendering

Figures will now use matplotlib's default size (6.4 × 4.8 inches) instead of the previously configured (11 × 5 inches). The notebooks continue to execute successfully and generate figures as expected.

Testing

  • ✅ Verified all figsize references removed (grep -r "rcParams.*figsize" lectures/ returns 0 results)
  • ✅ Tested notebook execution with aiyagari.md and linear_algebra.md - both build successfully
  • ✅ Confirmed figures are generated and saved properly during build process

Note: Global figsize configuration via myst-nb 1.3.0 configuration was researched but is not readily available in the current version. Figures will use matplotlib defaults unless individually specified.

Fixes #573.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • intro.quantecon.org
    • Triggering command: /usr/share/miniconda/envs/quantecon/bin/python /usr/share/miniconda/envs/quantecon/bin/jb build lectures --path-output ./ -W --keep-going --builder html (dns block)
    • Triggering command: /usr/share/miniconda/envs/quantecon/bin/python /usr/share/miniconda/envs/quantecon/bin/jb build lectures/intro.md --path-output ./ -W --keep-going --builder html (dns block)
    • Triggering command: /usr/share/miniconda/envs/quantecon/bin/python /usr/share/miniconda/envs/quantecon/bin/jb build lectures/aiyagari.md --path-output ./ -W --keep-going --builder html (dns block)
  • python-advanced.quantecon.org
    • Triggering command: /usr/share/miniconda/envs/quantecon/bin/python /usr/share/miniconda/envs/quantecon/bin/jb build lectures --path-output ./ -W --keep-going --builder html (dns block)
    • Triggering command: /usr/share/miniconda/envs/quantecon/bin/python /usr/share/miniconda/envs/quantecon/bin/jb build lectures/aiyagari.md --path-output ./ -W --keep-going --builder html (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
Copilot AI changed the title [WIP] [style] Sanitise lectures for figsize and adjust config via myst-nb [style] Remove local figsize adjustments from all lecture files Aug 28, 2025
Copilot AI requested a review from mmcky August 28, 2025 02:34
@github-actions
Copy link

github-actions bot commented Aug 28, 2025

@github-actions github-actions bot temporarily deployed to pull request August 28, 2025 03:02 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 28, 2025 03:03 Inactive
@mmcky mmcky added the review label Aug 28, 2025
@mmcky mmcky marked this pull request as ready for review August 29, 2025 01:46
@mmcky
Copy link
Contributor

mmcky commented Aug 29, 2025

I have done a visual check of many of these lectures -- I think this change will not have a large impact on fig sizes and I will mention this to the reviewing team to keep an eye out for fig size issues should they come across them when reading a lecture.

@mmcky mmcky merged commit a73ba0f into main Aug 29, 2025
7 checks passed
@mmcky mmcky deleted the copilot/fix-573 branch August 29, 2025 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[style] Sanitise lectures for figsize and adjust config via myst-nb

2 participants