From 8890dd46d0a49352c1c5b6edd05b22ed4cb965e8 Mon Sep 17 00:00:00 2001 From: James Toplis Date: Tue, 17 Nov 2026 10:09:48 +0100 Subject: [PATCH 1/3] fix(pyoemg): matplotlib update --- pyorerun/pyoemg.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyorerun/pyoemg.py b/pyorerun/pyoemg.py index 40bea6a..a703078 100644 --- a/pyorerun/pyoemg.py +++ b/pyorerun/pyoemg.py @@ -5,10 +5,9 @@ from typing import Optional, List import numpy as np -from matplotlib.cm import get_cmap +import matplotlib as mpl from matplotlib.colors import ListedColormap - class PyoMuscles: """ A class to handle emg data. @@ -20,7 +19,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 +36,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 +99,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): From efeb60da881fe4a6a45e843045d905730232bd89 Mon Sep 17 00:00:00 2001 From: James Toplis Date: Tue, 17 Nov 2026 14:38:51 +0100 Subject: [PATCH 2/3] update(black) --- .github/workflows/isblacked.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 . From d43e33d977dc0c9c5427accda61b217c5a6cb9b1 Mon Sep 17 00:00:00 2001 From: James Toplis Date: Tue, 17 Nov 2026 14:42:43 +0100 Subject: [PATCH 3/3] linting(black) --- pyorerun/pyoemg.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyorerun/pyoemg.py b/pyorerun/pyoemg.py index a703078..e820d06 100644 --- a/pyorerun/pyoemg.py +++ b/pyorerun/pyoemg.py @@ -8,6 +8,7 @@ import matplotlib as mpl from matplotlib.colors import ListedColormap + class PyoMuscles: """ A class to handle emg data.