|
4 | 4 | from typing import Union
|
5 | 5 |
|
6 | 6 | import numpy as np
|
| 7 | +from packaging import Version |
7 | 8 |
|
8 | 9 | from ..datbase import DataInterface, DataListInterface, DataType
|
9 | 10 | from ..mbase import BaseModel, ModelInterface
|
@@ -1726,12 +1727,12 @@ def export_contours(
|
1726 | 1727 | # (possibly disconnected) components. Before
|
1727 | 1728 | # 3.8, iterating over ContourSet.collections
|
1728 | 1729 | # and enumerating from get_paths() suffices,
|
1729 |
| - # but post-3.8 we have to walk the segmments |
| 1730 | + # but post-3.8, we have to walk the segments |
1730 | 1731 | # to distinguish disconnected components.
|
1731 |
| - mpl_ver = version("matplotlib") |
| 1732 | + mpl_ver = Version(version("matplotlib")) |
1732 | 1733 |
|
1733 | 1734 | for ctr in contours:
|
1734 |
| - if mpl_ver < "3.8.0": |
| 1735 | + if mpl_ver < Version("3.8.0"): |
1735 | 1736 | levels = ctr.levels
|
1736 | 1737 | for i, c in enumerate(ctr.collections):
|
1737 | 1738 | paths = c.get_paths()
|
@@ -1831,12 +1832,12 @@ def export_contourf(
|
1831 | 1832 | # (possibly disconnected) components. Before
|
1832 | 1833 | # 3.8, iterating over ContourSet.collections
|
1833 | 1834 | # and enumerating from get_paths() suffices,
|
1834 |
| - # but post-3.8 we have to walk the segmments |
| 1835 | + # but post-3.8, we have to walk the segments |
1835 | 1836 | # to distinguish disconnected components.
|
1836 |
| - mpl_ver = version("matplotlib") |
| 1837 | + mpl_ver = Version(version("matplotlib")) |
1837 | 1838 |
|
1838 | 1839 | for ctr in contours:
|
1839 |
| - if mpl_ver < "3.8.0": |
| 1840 | + if mpl_ver < Version("3.8.0"): |
1840 | 1841 | levels = ctr.levels
|
1841 | 1842 | for idx, col in enumerate(ctr.collections):
|
1842 | 1843 | for contour_path in col.get_paths():
|
|
0 commit comments