Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/isblacked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
10 changes: 5 additions & 5 deletions pyorerun/pyoemg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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,
):
"""
Expand All @@ -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)
Expand Down Expand Up @@ -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):
Expand Down
Loading