QuantEcon / QuantEcon/lecture-python-intro
laffer_adaptive: `import matplotlib` is unused (missed by #798)
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 65
- Forks
- 32
- Ø Merge
- 4 T. 14 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
lectures/laffer_adaptive.md imports matplotlib but never uses it. The only matplotlib-prefixed reference in the lecture is the matplotlib.pyplot and matplotlib.ticker imports themselves — nothing calls matplotlib.<anything>.
The import block currently reads:
| line | import | used? |
|---|---|---|
| 170 | from collections import namedtuple |
yes |
| 171 | import numpy as np |
yes |
| 172 | import matplotlib.pyplot as plt |
yes |
| 173 | from matplotlib.ticker import MaxNLocator |
yes |
| 174 | import matplotlib |
no |
| 175 | from scipy.optimize import root, fsolve |
yes |
This was missed by #798, which removed the unused get_cmap and to_rgba imports from this same block and left import matplotlib one line below them. Dropping line 174 finishes that cleanup.
How it surfaced
Copilot review flagged it on the Chinese edition's sync PR for #798 — QuantEcon/lecture-intro.zh-cn#268. It is not being fixed there: the line is inherited from this repo, so patching it in a translation edition would create drift from source on non-localisation grounds and would likely be reintroduced by the next resync. Fixing it here lets it flow down through the normal sync instead.
(For the record, the Chinese edition separately carries import matplotlib as mpl, which is used — it registers the CJK font. That one is a legitimate localisation addition and is unaffected.)
Happy to send a one-line PR if useful.
🤖 Generated with Claude Code
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Öffne laffer_adaptive.md in Open lectures/ und überprüfe den Importblock um die Zeilen 170–175. Entferne den ungenutzten Import matplotlib in Zeile 174. Bestätige anschließend, dass die verbleibenden Importe matplotlib.pyplot und matplotlib.ticker weiterhin verwendet werden und dass die Quellvorlesung den ungenutzten Import nicht mehr enthält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- matplotlib, numpy, python
- Bereich
- documentation
- Issue-Typ
- Refactoring
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 90/100