Skip to content
Open
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: 2 additions & 0 deletions examples/biorbd/live_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
The user can interact with the model by changing the joint angles using sliders.
"""

from fontTools.feaLib import variableScalar

from pyorerun import LiveModelAnimation
from pyorerun import BiorbdModel

Expand Down
1 change: 0 additions & 1 deletion pyorerun/model_interfaces/pinocchio_model_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ def muscle_strips(self, q: np.ndarray) -> list[list[np.ndarray]]:
f_name for f_name in self._frame_list_names if muscle_name == f_name.split("-")[0]
] # assume muscle frames are named like "muscleName-1", "muscleName-2", etc.
muscle_strip = []
print(f"Muscle {muscle_name} frames: {muscle_frames}")
for i in range(len(muscle_frames)):
f1_id = self.model.getFrameId(muscle_frames[i])
frame_location = self.data.oMf[f1_id].translation
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
from matplotlib import colormaps
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 = 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 Colormap instance or str, 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 = 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 Colormap instance or the name of the colormap (str).")
return colormap

def check_dimensions(self):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"ezc3d", # Now needed, but imported for our custom PyoMarkers.from_c3d()
# "ezc3d", # Now needed, but imported for our custom PyoMarkers.from_c3d()
"numpy",
"rerun-sdk==0.30.2",
"trimesh",
Expand Down
Loading