Restore missing 'import matplotlib as mpl' in mix_model font block#174
Merged
Conversation
The CJK font-configuration block uses mpl.font_manager but the import line was dropped, so the lecture fails execution with NameError under cache rebuilds (found via the 2026-07-18 execution reports; same residual class as QuantEcon/action-translation#107). mix_model was triaged I18N_ONLY in the resync wave so no wave PR covers it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for astonishing-narwhal-a8fc64 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR restores the missing import matplotlib as mpl line in the CJK font-configuration block of lectures/mix_model.md, fixing a runtime NameError when the lecture notebook is executed.
Changes:
- Add
import matplotlib as mplbefore thempl.font_manager.fontManager.addfont(...)call inlectures/mix_model.md.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CJK font-configuration block in
lectures/mix_model.mdcallsmpl.font_manager.fontManager.addfont(...)but theimport matplotlib as mplline is missing, so the lecture fails execution withNameError: name 'mpl' is not definedwhenever it is re-executed (confirmed in the 2026-07-18 cache-rebuild execution reports).This is the same residual class field-validated in QuantEcon/action-translation#107 (partial font-block drops). mix_model was triaged I18N_ONLY in the resync wave — content-equivalent to source, so no wave PR covers it — which is how a broken font block slipped past: triage checks content equivalence, not executability.
One line restores the import, matching the canonical font block used across the repo.
🤖 Generated with Claude Code