Skip to content

Commit

Permalink
fix version parse (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski authored Aug 15, 2024
1 parent 9470d28 commit a9b9c66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/iminuit/minuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2141,11 +2141,12 @@ def draw_mncontour(
from matplotlib import pyplot as plt
from matplotlib.path import Path
from matplotlib.contour import ContourSet
from packaging.version import Version

ix, xname = self._normalize_key(x)
iy, yname = self._normalize_key(y)

mpl_version = tuple(map(int, mpl_version_string.split(".")))
mpl_version = Version(mpl_version_string)

cls = [replace_none(x, 0.68) for x in mutil._iterate(cl)]

Expand All @@ -2162,7 +2163,7 @@ def draw_mncontour(
experimental=experimental,
)
n_lineto = len(pts) - 2
if mpl_version < (3, 5):
if (mpl_version.major, mpl_version.minor) < (3, 5):
n_lineto -= 1 # pragma: no cover
c_val.append(cl)
c_pts.append([pts]) # level can have more than one contour in mpl
Expand Down

0 comments on commit a9b9c66

Please sign in to comment.