Skip to content

Commit 2498a0f

Browse files
sbryngelsonclaude
andcommitted
Fix Python 3.10+ compatibility and packaging issues
- Replace deprecated matplotlib.cm.get_cmap() with matplotlib.colormaps[] (deprecated since matplotlib 3.7, removal pending) - Drop imageio.v2 shim in renderer.py; use top-level imageio instead (v2 is a backwards-compat shim; top-level API is stable) - Add requires-python = ">=3.10" to pyproject.toml - Bump dash>=1.12.0 to dash>=2.0 (callback_context semantics changed in 2.0) - Remove duplicate typos entry in pyproject.toml Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 667ca10 commit 2498a0f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

toolchain/mfc/viz/renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import numpy as np
1515

16-
import imageio.v2 as imageio
16+
import imageio
1717

1818
import matplotlib
1919
matplotlib.use('Agg')

toolchain/mfc/viz/tui.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def render(self): # pylint: disable=too-many-branches,too-many-locals,too-many-
110110
return super().render()
111111

112112
# 2D: pure-Rich heatmap with vertical colorbar.
113-
import matplotlib.cm as mcm # pylint: disable=import-outside-toplevel
113+
import matplotlib # pylint: disable=import-outside-toplevel
114114
import matplotlib.colors as mcolors # pylint: disable=import-outside-toplevel
115115

116116
# Content area = widget size minus 1-char border on each side.
@@ -132,7 +132,7 @@ def render(self): # pylint: disable=too-many-branches,too-many-locals,too-many-
132132
vmax = vmin + 1e-10
133133
self._last_vmin = vmin
134134
self._last_vmax = vmax
135-
cmap = mcm.get_cmap(self._cmap_name)
135+
cmap = matplotlib.colormaps[self._cmap_name]
136136
if self._log_scale and vmin > 0:
137137
norm = mcolors.LogNorm(vmin=vmin, vmax=vmax)
138138
else:

toolchain/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ build-backend = "hatchling.build"
55
[project]
66
name = "mfc"
77
dynamic = ["version"]
8+
requires-python = ">=3.10"
89
dependencies = [
910
# General
1011
"rich",
1112
"wheel",
12-
"typos",
1313
"PyYAML",
1414
"argparse",
1515
"dataclasses",
@@ -53,7 +53,7 @@ dependencies = [
5353
# Frontier Profiling
5454
"astunparse==1.6.2",
5555
"colorlover",
56-
"dash>=1.12.0",
56+
"dash>=2.0",
5757
"pymongo",
5858
"tabulate",
5959
"tqdm",

0 commit comments

Comments
 (0)