Skip to content

Commit 4a98cdc

Browse files
committed
blacked
1 parent 87f2c66 commit 4a98cdc

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

biobuddy/components/real/model_dynamics.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,7 @@ def inverse_kinematics(
360360
viz_scaled_model.options.show_gravity = True
361361
viz_scaled_model.options.show_marker_labels = False
362362
viz_scaled_model.options.show_center_of_mass_labels = False
363-
viz.add_animated_model(
364-
viz_scaled_model, optimal_q, tracked_markers=pyomarkers
365-
)
363+
viz.add_animated_model(viz_scaled_model, optimal_q, tracked_markers=pyomarkers)
366364
viz.rerun_by_frame("Model output")
367365

368366
return optimal_q

biobuddy/model_modifiers/joint_center_tool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def _check_c3d_functional_trial_file(self):
118118
for marker_name in self.parent_marker_names + self.child_marker_names:
119119
std += self.c3d_data.std_marker_position(marker_name)
120120
if len(std) == 0:
121-
raise RuntimeError(f"There are no markers in the current functional trial setup. Please review the `parent_marker_names` and `child_marker_names`.")
121+
raise RuntimeError(
122+
f"There are no markers in the current functional trial setup. Please review the `parent_marker_names` and `child_marker_names`."
123+
)
122124
if all(np.array(std) < 0.01):
123125
raise RuntimeError(
124126
f"The markers {self.parent_marker_names + self.child_marker_names} are not moving in the functional trial (markers std = {std}). "

biobuddy/model_modifiers/scale_tool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ def find_static_pose(
602602

603603
model_marker_names = model_to_use.marker_names
604604
marker_indices = [experimental_marker_names.index(m) for m in model_marker_names]
605-
pyomarkers = pyorerun.Pyomarkers(data=marker_positions[:, marker_indices, :], channels=model_marker_names, show_labels=False)
605+
pyomarkers = pyorerun.Pyomarkers(
606+
data=marker_positions[:, marker_indices, :], channels=model_marker_names, show_labels=False
607+
)
606608
viz.add_xp_markers(name=experimental_marker_names, markers=pyomarkers, show_tracked_marker_labels=False)
607609
viz.rerun_by_frame("Model output")
608610

examples/replace_joint_centers_functionally.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ def main(visualization):
167167
# Add the experimental markers from the static trial
168168
static_exp_markers = C3dData(static_filepath, first_frame=500, last_frame=510)
169169
static_marker_positions = static_exp_markers.get_position(scaled_model.marker_names)
170-
pyomarkers = pyorerun.Pyomarkers(data=static_marker_positions, channels=scaled_model.marker_names, show_labels=False)
170+
pyomarkers = pyorerun.Pyomarkers(
171+
data=static_marker_positions, channels=scaled_model.marker_names, show_labels=False
172+
)
171173

172174
# SCoRE model
173175
viz_scaled_model = pyorerun.BiorbdModel(score_biomod_filepath)

tests/test_scaling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from test_utils import remove_temporary_biomods
1616
from biobuddy import BiomechanicalModelReal, MuscleType, MuscleStateType, ScaleTool, C3dData
1717

18+
1819
def convert_c3d_to_trc(c3d_filepath):
1920
"""
2021
This function reads the c3d static file and converts it into a trc file that will be used to scale the model in OpenSim.

0 commit comments

Comments
 (0)