From c14d5112641a8d0e07dbdd7aa51cd419f819ce28 Mon Sep 17 00:00:00 2001 From: Samuel Mok <131749029+utsmok@users.noreply.github.com> Date: Tue, 21 May 2024 15:21:30 +0200 Subject: [PATCH] Fix deprecated matplotlib import in metrics.py Fixes breaking change -- get_cmap cannot be imported from matplotlib.cm, as it was removed from matplotlib.cm as a standalone function as can be seen in the history of matplotlibs' cm module here: https://github.com/matplotlib/matplotlib/commit/7f23ee15f80c279100f5909ca1d681c575aeb23b as suggested I changed the import to use matplot.pyplot instead. If this is not changed polyfuzz will raise an ImportError during importing. --- polyfuzz/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polyfuzz/metrics.py b/polyfuzz/metrics.py index 95eadb2..6e648f1 100644 --- a/polyfuzz/metrics.py +++ b/polyfuzz/metrics.py @@ -5,7 +5,7 @@ import matplotlib.pyplot as plt from typing import Tuple, List, Mapping from matplotlib import gridspec -from matplotlib.cm import get_cmap +from matplotlib.pyplot import get_cmap from matplotlib.lines import Line2D