From 19cecc6cdf826e44b5faa13dffdb5d0d19d56b62 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Mon, 20 Jul 2026 12:31:06 +1000 Subject: [PATCH] FIX: remove unused get_cmap and to_rgba imports in laffer_adaptive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `matplotlib.cm.get_cmap` was removed in newer matplotlib releases, so importing it raises `ImportError` at import time and kills the whole notebook on its first cell: ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' Neither `get_cmap` nor `to_rgba` is referenced anywhere in the lecture — the only occurrence of each is its own import line — so both are dropped rather than migrated to `matplotlib.colormaps[...]`. This mirrors the fix in QuantEcon/lecture-python-intro#798, where the same dead imports broke the notebook once anaconda 2026.07 shipped the matplotlib that drops `get_cmap`. This repo runs under pyodide rather than the conda env, so it was not covered by that sweep, but it carries the identical imports and will break on the same matplotlib bump. Co-Authored-By: Claude Opus 4.8 (1M context) --- lectures/laffer_adaptive.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/lectures/laffer_adaptive.md b/lectures/laffer_adaptive.md index 64c444f..55e3942 100644 --- a/lectures/laffer_adaptive.md +++ b/lectures/laffer_adaptive.md @@ -170,8 +170,6 @@ from collections import namedtuple import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator -from matplotlib.cm import get_cmap -from matplotlib.colors import to_rgba import matplotlib from scipy.optimize import root, fsolve ```