kinemotion 0.45.1__py3-none-any.whl → 0.47.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of kinemotion might be problematic. Click here for more details.

@@ -7,6 +7,7 @@ from numpy.typing import NDArray
7
7
 
8
8
  from ..core.formatting import format_float_metric, format_int_metric
9
9
  from ..core.smoothing import compute_acceleration_from_derivative
10
+ from ..core.timing import NULL_TIMER, Timer
10
11
  from .analysis import (
11
12
  ContactState,
12
13
  detect_drop_start,
@@ -433,6 +434,7 @@ def calculate_drop_jump_metrics(
433
434
  smoothing_window: int = 5,
434
435
  polyorder: int = 2,
435
436
  use_curvature: bool = True,
437
+ timer: Timer | None = None,
436
438
  ) -> DropJumpMetrics:
437
439
  """
438
440
  Calculate drop-jump metrics from contact states and positions.
@@ -450,16 +452,19 @@ def calculate_drop_jump_metrics(
450
452
  (must be odd)
451
453
  polyorder: Polynomial order for Savitzky-Golay filter (default: 2)
452
454
  use_curvature: Whether to use curvature analysis for refining transitions
455
+ timer: Optional Timer for measuring operations
453
456
 
454
457
  Returns:
455
458
  DropJumpMetrics object with calculated values
456
459
  """
460
+ timer = timer or NULL_TIMER
457
461
  metrics = DropJumpMetrics()
458
462
 
459
463
  # Determine drop start frame
460
- drop_start_frame_value = _determine_drop_start_frame(
461
- drop_start_frame, foot_y_positions, fps, smoothing_window
462
- )
464
+ with timer.measure("dj_detect_drop_start"):
465
+ drop_start_frame_value = _determine_drop_start_frame(
466
+ drop_start_frame, foot_y_positions, fps, smoothing_window
467
+ )
463
468
 
464
469
  # Store drop start frame in metrics
465
470
  metrics.drop_start_frame = (
@@ -467,15 +472,16 @@ def calculate_drop_jump_metrics(
467
472
  )
468
473
 
469
474
  # Find contact phases
470
- phases = find_contact_phases(contact_states)
471
- interpolated_phases = find_interpolated_phase_transitions_with_curvature(
472
- foot_y_positions,
473
- contact_states,
474
- velocity_threshold,
475
- smoothing_window,
476
- polyorder,
477
- use_curvature,
478
- )
475
+ with timer.measure("dj_find_phases"):
476
+ phases = find_contact_phases(contact_states)
477
+ interpolated_phases = find_interpolated_phase_transitions_with_curvature(
478
+ foot_y_positions,
479
+ contact_states,
480
+ velocity_threshold,
481
+ smoothing_window,
482
+ polyorder,
483
+ use_curvature,
484
+ )
479
485
 
480
486
  if not phases:
481
487
  return metrics
@@ -504,9 +510,10 @@ def calculate_drop_jump_metrics(
504
510
  return metrics
505
511
 
506
512
  # Identify main contact phase
507
- contact_start, contact_end, _ = _identify_main_contact_phase(
508
- phases, ground_phases, air_phases_indexed, foot_y_positions
509
- )
513
+ with timer.measure("dj_identify_contact"):
514
+ contact_start, contact_end, _ = _identify_main_contact_phase(
515
+ phases, ground_phases, air_phases_indexed, foot_y_positions
516
+ )
510
517
 
511
518
  # Store integer frame indices
512
519
  metrics.contact_start_frame = contact_start
@@ -524,15 +531,16 @@ def calculate_drop_jump_metrics(
524
531
  metrics.contact_end_frame_precise = contact_end_frac
525
532
 
526
533
  # Analyze flight phase and calculate jump height
527
- _analyze_flight_phase(
528
- metrics,
529
- phases,
530
- interpolated_phases,
531
- contact_end,
532
- foot_y_positions,
533
- fps,
534
- smoothing_window,
535
- polyorder,
536
- )
534
+ with timer.measure("dj_analyze_flight"):
535
+ _analyze_flight_phase(
536
+ metrics,
537
+ phases,
538
+ interpolated_phases,
539
+ contact_end,
540
+ foot_y_positions,
541
+ fps,
542
+ smoothing_window,
543
+ polyorder,
544
+ )
537
545
 
538
546
  return metrics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kinemotion
3
- Version: 0.45.1
3
+ Version: 0.47.0
4
4
  Summary: Video-based kinematic analysis for athletic performance
5
5
  Project-URL: Homepage, https://github.com/feniix/kinemotion
6
6
  Project-URL: Repository, https://github.com/feniix/kinemotion
@@ -1,40 +1,40 @@
1
1
  kinemotion/__init__.py,sha256=wPItmyGJUOFM6GPRVhAEvRz0-ErI7e2qiUREYJ9EfPQ,943
2
- kinemotion/api.py,sha256=AWURqiz0SI1BGh6mTlywTOWKFGrXyoZJbmo_t6sRkjQ,32538
2
+ kinemotion/api.py,sha256=K3E5kEQQyPZrEWYaIczJNxxWREWfclIvQYjXcX--9-k,31185
3
3
  kinemotion/cli.py,sha256=cqYV_7URH0JUDy1VQ_EDLv63FmNO4Ns20m6s1XAjiP4,464
4
4
  kinemotion/cmj/__init__.py,sha256=Ynv0-Oco4I3Y1Ubj25m3h9h2XFqeNwpAewXmAYOmwfU,127
5
- kinemotion/cmj/analysis.py,sha256=qtULzp9uYzm5M0_Qu5YGJpuwjg9fz1VKAg6xg4NJxvM,21639
5
+ kinemotion/cmj/analysis.py,sha256=YDj7HpSCzrsw6mPtE3phDfYuAWQV0w-CCiLiQjkh3Mg,22196
6
6
  kinemotion/cmj/cli.py,sha256=HpZgLWoLjcgsfOZu6EQ_26tg6QwTgFjR-Ly8WCBg24c,9904
7
7
  kinemotion/cmj/debug_overlay.py,sha256=fXmWoHhqMLGo4vTtB6Ezs3yLUDOLw63zLIgU2gFlJQU,15892
8
8
  kinemotion/cmj/joint_angles.py,sha256=HmheIEiKcQz39cRezk4h-htorOhGNPsqKIR9RsAEKts,9960
9
9
  kinemotion/cmj/kinematics.py,sha256=Lq9m9MNQxnXv31VhKmXVrlM7rRkhi8PxW50N_CC8_8Y,11860
10
10
  kinemotion/cmj/metrics_validator.py,sha256=V_fmlczYH06SBtwqESv-IfGi3wDsIy3RQbd7VwOyNo0,31359
11
11
  kinemotion/cmj/validation_bounds.py,sha256=9ZTo68fl3ooyWjXXyTMRLpK9tFANa_rQf3oHhq7iQGE,11995
12
- kinemotion/core/__init__.py,sha256=GTLnE_gGIk7HC51epWUXVuNxcvS5lf7UL6qeWRlgMV0,1352
12
+ kinemotion/core/__init__.py,sha256=rBIEx9sW6E-nyVdWmoVGJYhfPikLukoDp7lxKri7RTQ,1543
13
13
  kinemotion/core/auto_tuning.py,sha256=wtCUMOhBChVJNXfEeku3GCMW4qED6MF-O_mv2sPTiVQ,11324
14
14
  kinemotion/core/cli_utils.py,sha256=sQPbT6XWWau-sm9yuN5c3eS5xNzoQGGXwSz6hQXtRvM,1859
15
- kinemotion/core/debug_overlay_utils.py,sha256=Eu4GXm8VeaDhU7voDjPJ4JvR-7ypT1mYmCz0d-M39N4,9027
15
+ kinemotion/core/debug_overlay_utils.py,sha256=-goE3w4gBij99y1U4ckU5iaQPS0SupcHplT04DDWzUo,8579
16
16
  kinemotion/core/determinism.py,sha256=NwVrHqJiVxxFHTBPVy8aDBJH2SLIcYIpdGFp7glblB8,2515
17
17
  kinemotion/core/experimental.py,sha256=IK05AF4aZS15ke85hF3TWCqRIXU1AlD_XKzFz735Ua8,3640
18
18
  kinemotion/core/filtering.py,sha256=GsC9BB71V07LJJHgS2lsaxUAtJsupcUiwtZFDgODh8c,11417
19
19
  kinemotion/core/formatting.py,sha256=G_3eqgOtym9RFOZVEwCxye4A2cyrmgvtQ214vIshowU,2480
20
20
  kinemotion/core/metadata.py,sha256=bJAVa4nym__zx1hNowSZduMGKBSGOPxTbBQkjm6N0D0,7207
21
- kinemotion/core/pipeline_utils.py,sha256=n6ee90xOYfBGkDCM1_F2rpYVsC3wWyKSTtWpAFz0Fh0,14161
22
- kinemotion/core/pose.py,sha256=Tq4VS0YmMzrprVUsELm6FQczyLhP8UKurM9ccYn1LLU,8959
21
+ kinemotion/core/pipeline_utils.py,sha256=0u7o-UFZX6cOu3NaWpFmEy5ejS0WUKggZ1HSdeZXhoA,14964
22
+ kinemotion/core/pose.py,sha256=z1OGuwnc-NdK6Aoc9UYCyPBzomw4eInexOWonZbsEoA,9057
23
23
  kinemotion/core/quality.py,sha256=dPGQp08y8DdEUbUdjTThnUOUsALgF0D2sdz50cm6wLI,13098
24
- kinemotion/core/smoothing.py,sha256=GAfC-jxu1eqNyDjsUXqUBicKx9um5hrk49wz1FxfRNM,15219
25
- kinemotion/core/timing.py,sha256=bdRg1g7J0-eWB3oj7tEF5Ucp_tiad1IxsM14edAZQu4,1484
24
+ kinemotion/core/smoothing.py,sha256=FZmv3rumn0mYKU2y3JPKz46EvD8TVmQ6_GsN_Vp3BdU,15650
25
+ kinemotion/core/timing.py,sha256=mXwFTEYcB2cfAqQZAlucPN8cqPbVs7as2qjVMPToBdw,12024
26
26
  kinemotion/core/validation.py,sha256=LmKfSl4Ayw3DgwKD9IrhsPdzp5ia4drLsHA2UuU1SCM,6310
27
- kinemotion/core/video_io.py,sha256=HyLwn22fKe37j18853YYYrQi0JQWAwxpepPLNkuZKnQ,8586
27
+ kinemotion/core/video_io.py,sha256=vCwpWnlW2y29l48dFXokdehQn42w_IQvayxbVTjpXqQ,7863
28
28
  kinemotion/dropjump/__init__.py,sha256=tC3H3BrCg8Oj-db-Vrtx4PH_llR1Ppkd5jwaOjhQcLg,862
29
- kinemotion/dropjump/analysis.py,sha256=MjxO-vps0nz_hXlnGk7cgq3jFenJYzsM0VVpHwnHXsM,27935
29
+ kinemotion/dropjump/analysis.py,sha256=p7nnCe7V6vnhQKZVYk--_nhsTvVa_WY-A3zXmyplsew,28211
30
30
  kinemotion/dropjump/cli.py,sha256=eLIA0rnx60vqD__PinB1-5nQ8_xQUhCGplwsB0u9MgU,15824
31
- kinemotion/dropjump/debug_overlay.py,sha256=9nlnDYB_ZJO4dC1uMhDa4UOYGMBsDpyPQD3WbJjbwpM,6130
32
- kinemotion/dropjump/kinematics.py,sha256=kH-XM66wlOCYMpjvyb6_Qh5ZebyOfFZ47rmhgE1Tww4,19404
31
+ kinemotion/dropjump/debug_overlay.py,sha256=8XVuDyZ3nuNoCYkxcUWC7wyEoHyBxx77Sb--B1KiYWw,5974
32
+ kinemotion/dropjump/kinematics.py,sha256=PATlGaClutGKJslL-LRIXHmTsvb-xEB8PUIMScU_K4c,19849
33
33
  kinemotion/dropjump/metrics_validator.py,sha256=CrTlGup8q2kyPXtA6HNwm7_yq0AsBaDllG7RVZdXmYA,9342
34
34
  kinemotion/dropjump/validation_bounds.py,sha256=5b4I3CKPybuvrbn-nP5yCcGF_sH4Vtyw3a5AWWvWnBk,4645
35
35
  kinemotion/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- kinemotion-0.45.1.dist-info/METADATA,sha256=MwXnUwq8AHXBwGJkLbfzc956Bwr15ZfANbyaCMCstDQ,26020
37
- kinemotion-0.45.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
38
- kinemotion-0.45.1.dist-info/entry_points.txt,sha256=zaqnAnjLvcdrk1Qvj5nvXZCZ2gp0prS7it1zTJygcIY,50
39
- kinemotion-0.45.1.dist-info/licenses/LICENSE,sha256=KZajvqsHw0NoOHOi2q0FZ4NBe9HdV6oey-IPYAtHXfg,1088
40
- kinemotion-0.45.1.dist-info/RECORD,,
36
+ kinemotion-0.47.0.dist-info/METADATA,sha256=Kz7ptLupptK9uFRaatqfcVBvsaN_N6vqf0zKFitX1-o,26020
37
+ kinemotion-0.47.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
38
+ kinemotion-0.47.0.dist-info/entry_points.txt,sha256=zaqnAnjLvcdrk1Qvj5nvXZCZ2gp0prS7it1zTJygcIY,50
39
+ kinemotion-0.47.0.dist-info/licenses/LICENSE,sha256=KZajvqsHw0NoOHOi2q0FZ4NBe9HdV6oey-IPYAtHXfg,1088
40
+ kinemotion-0.47.0.dist-info/RECORD,,