diff --git a/.github/workflows/isblacked.yml b/.github/workflows/isblacked.yml index 6b1fa8b..e9b40db 100644 --- a/.github/workflows/isblacked.yml +++ b/.github/workflows/isblacked.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v1 with: - python-version: '3.10' + python-version: '3.14' - name: Install Black run: pip install black - name: Run black --check . diff --git a/pyorerun/pyoemg.py b/pyorerun/pyoemg.py index 40bea6a..e820d06 100644 --- a/pyorerun/pyoemg.py +++ b/pyorerun/pyoemg.py @@ -5,7 +5,7 @@ from typing import Optional, List import numpy as np -from matplotlib.cm import get_cmap +import matplotlib as mpl from matplotlib.colors import ListedColormap @@ -20,7 +20,7 @@ def __init__( time: Optional[np.ndarray] = None, muscle_names: Optional[List[str]] = None, mvc: Optional[np.ndarray] = None, - colormap: Optional[ListedColormap] | str = get_cmap("magma"), + colormap: Optional[ListedColormap] | str = mpl.colormaps["magma"], attrs: Optional[dict] = None, ): """ @@ -37,7 +37,7 @@ def __init__( Names/labels of the emg/muscles mvc : np.ndarray The maximal voluntary contraction values for each muscle. If None, the default is the maximal value across all frames for each muscle independently. - colormap: matplotlib.cm.get_cmap() instance, optional + colormap: matplotlib.colormaps instance, optional The colormap to use when displaying the emg data. If None, the default is "magma". attrs : dict Metadata attributes (e.g., units) @@ -100,9 +100,9 @@ def initialize_colormap(colormap: Optional[ListedColormap | str] = None) -> List """Check that the colormap provided is correct""" if colormap is not None: if isinstance(colormap, str): - colormap = get_cmap(colormap) + colormap = mpl.colormaps[colormap] if not isinstance(colormap, ListedColormap): - raise TypeError("colormap must be a matplotlib.cm.get_cmap instance or the name of the colormap (str).") + raise TypeError("colormap must be a matplotlib.colormaps instance or the name of the colormap (str).") return colormap def check_dimensions(self):