repwise 2.1.0__tar.gz → 2.1.1__tar.gz

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.
Files changed (62) hide show
  1. {repwise-2.1.0/src/repwise.egg-info → repwise-2.1.1}/PKG-INFO +1 -1
  2. {repwise-2.1.0 → repwise-2.1.1}/pyproject.toml +1 -1
  3. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/__init__.py +1 -1
  4. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/domain/progression.py +23 -5
  5. {repwise-2.1.0 → repwise-2.1.1/src/repwise.egg-info}/PKG-INFO +1 -1
  6. {repwise-2.1.0 → repwise-2.1.1}/tests/test_progression.py +75 -0
  7. {repwise-2.1.0 → repwise-2.1.1}/LICENSE +0 -0
  8. {repwise-2.1.0 → repwise-2.1.1}/README.md +0 -0
  9. {repwise-2.1.0 → repwise-2.1.1}/setup.cfg +0 -0
  10. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/__main__.py +0 -0
  11. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/__init__.py +0 -0
  12. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/checking.py +0 -0
  13. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/fetch.py +0 -0
  14. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/importing.py +0 -0
  15. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/listing.py +0 -0
  16. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/logout.py +0 -0
  17. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/report.py +0 -0
  18. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/app/update.py +0 -0
  19. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/checker.py +0 -0
  20. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/cli/__init__.py +0 -0
  21. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/cli/completion.py +0 -0
  22. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/cli/parser.py +0 -0
  23. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/config.py +0 -0
  24. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/domain/__init__.py +0 -0
  25. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/domain/effort.py +0 -0
  26. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/domain/matching.py +0 -0
  27. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/domain/models.py +0 -0
  28. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/dumps.py +0 -0
  29. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/errors.py +0 -0
  30. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/garmin/__init__.py +0 -0
  31. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/garmin/catalog.py +0 -0
  32. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/garmin/client.py +0 -0
  33. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/garmin/payloads.py +0 -0
  34. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/importer.py +0 -0
  35. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/log.py +0 -0
  36. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/planner.py +0 -0
  37. {repwise-2.1.0 → repwise-2.1.1}/src/repwise/yamlio.py +0 -0
  38. {repwise-2.1.0 → repwise-2.1.1}/src/repwise.egg-info/SOURCES.txt +0 -0
  39. {repwise-2.1.0 → repwise-2.1.1}/src/repwise.egg-info/dependency_links.txt +0 -0
  40. {repwise-2.1.0 → repwise-2.1.1}/src/repwise.egg-info/entry_points.txt +0 -0
  41. {repwise-2.1.0 → repwise-2.1.1}/src/repwise.egg-info/requires.txt +0 -0
  42. {repwise-2.1.0 → repwise-2.1.1}/src/repwise.egg-info/top_level.txt +0 -0
  43. {repwise-2.1.0 → repwise-2.1.1}/tests/test_catalog.py +0 -0
  44. {repwise-2.1.0 → repwise-2.1.1}/tests/test_checker.py +0 -0
  45. {repwise-2.1.0 → repwise-2.1.1}/tests/test_checking.py +0 -0
  46. {repwise-2.1.0 → repwise-2.1.1}/tests/test_cli.py +0 -0
  47. {repwise-2.1.0 → repwise-2.1.1}/tests/test_client.py +0 -0
  48. {repwise-2.1.0 → repwise-2.1.1}/tests/test_completion.py +0 -0
  49. {repwise-2.1.0 → repwise-2.1.1}/tests/test_config.py +0 -0
  50. {repwise-2.1.0 → repwise-2.1.1}/tests/test_dumps.py +0 -0
  51. {repwise-2.1.0 → repwise-2.1.1}/tests/test_effort.py +0 -0
  52. {repwise-2.1.0 → repwise-2.1.1}/tests/test_fetch.py +0 -0
  53. {repwise-2.1.0 → repwise-2.1.1}/tests/test_importer.py +0 -0
  54. {repwise-2.1.0 → repwise-2.1.1}/tests/test_log.py +0 -0
  55. {repwise-2.1.0 → repwise-2.1.1}/tests/test_logout.py +0 -0
  56. {repwise-2.1.0 → repwise-2.1.1}/tests/test_main.py +0 -0
  57. {repwise-2.1.0 → repwise-2.1.1}/tests/test_matching.py +0 -0
  58. {repwise-2.1.0 → repwise-2.1.1}/tests/test_models.py +0 -0
  59. {repwise-2.1.0 → repwise-2.1.1}/tests/test_payloads.py +0 -0
  60. {repwise-2.1.0 → repwise-2.1.1}/tests/test_planner.py +0 -0
  61. {repwise-2.1.0 → repwise-2.1.1}/tests/test_report.py +0 -0
  62. {repwise-2.1.0 → repwise-2.1.1}/tests/test_update.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: repwise
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Advance Garmin strength workout targets using double progression
5
5
  Author-email: Adam Żmuda <adam@zmuda.pro>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "repwise"
7
- version = "2.1.0"
7
+ version = "2.1.1"
8
8
  description = "Advance Garmin strength workout targets using double progression"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1,4 +1,4 @@
1
1
  """Advance Garmin strength workout targets using double progression."""
2
2
 
3
3
  __all__ = ["__version__"]
4
- __version__ = "2.1.0"
4
+ __version__ = "2.1.1"
@@ -414,6 +414,24 @@ def next_target(
414
414
  # of them does count.
415
415
  floor = min(at_weight)
416
416
 
417
+ # A set carried at a *heavier* load, for at least the reps the working sets
418
+ # managed, counts as one of them: harder than asked is not worse than
419
+ # asked, and a session split across two loads is still a whole session.
420
+ # Without this the set count is taken from one load alone, and three sets
421
+ # done as two at 20 kg and one at 30 kg read as an abandoned session rather
422
+ # than a finished one.
423
+ #
424
+ # What it contributes is its own rep count, which is a lower bound on what
425
+ # it would have managed at the lighter load, so this can only ever add sets
426
+ # to the tally - never flatter the reps. A set that came up short at the
427
+ # heavier load counts for nothing, which is what keeps a failed top set
428
+ # from reading as a completed session.
429
+ counted = at_weight + [
430
+ entry.reps
431
+ for entry in performed
432
+ if entry.weight > weight and entry.reps >= floor
433
+ ]
434
+
417
435
  # Rule 5: a load is only worth keeping once it can be carried for at least
418
436
  # the bottom of the range. Falling short of rep_low means the jump was too
419
437
  # big -- the 3 kg dumbbells were taken, so you grabbed the 4 kg ones --
@@ -427,21 +445,21 @@ def next_target(
427
445
  f"{spec.rep_low}-{spec.rep_high} range",
428
446
  )
429
447
 
430
- # Too few sets at that load to judge progression, so bank the load and
448
+ # Too few sets that counted to judge progression, so bank the load and
431
449
  # repeat. Rule 4 still applies when the load itself did not change. The
432
450
  # ramp does not survive this: half a session cannot say which sets levelled.
433
- if len(at_weight) < spec.sets:
451
+ if len(counted) < spec.sets:
434
452
  reps = floor if rebased else current.reps
435
453
  return (
436
454
  Target(reps, weight),
437
- f"only {len(at_weight)} of {spec.sets} sets logged, consolidate",
455
+ f"only {len(counted)} of {spec.sets} sets logged, consolidate",
438
456
  )
439
457
 
440
458
  # Rule 4: every prescribed set must meet what was asked of it to count as a
441
459
  # match. Only meaningful while the load is unchanged.
442
- if not rebased and not hit(spec, current, at_weight):
460
+ if not rebased and not hit(spec, current, counted):
443
461
  if streak >= STALLED_AFTER:
444
- return _deload(spec, current, weight, at_weight)
462
+ return _deload(spec, current, weight, counted)
445
463
  return current, _missed(spec, current, floor)
446
464
 
447
465
  return _advance(spec, current, weight, floor, streak)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: repwise
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Advance Garmin strength workout targets using double progression
5
5
  Author-email: Adam Żmuda <adam@zmuda.pro>
6
6
  License-Expression: MIT
@@ -737,3 +737,78 @@ def test_a_session_at_the_cap_rebases_off_an_impossible_target():
737
737
  """The way back from a target already past the ceiling: lift what you have."""
738
738
  target, why = next_target(HOME_PRESS, Target(10, 12.5), [P(12, 10.0)] * 3)
739
739
  assert target.weight == 10.0, why
740
+
741
+
742
+ # --- a session split across two loads --------------------------------------
743
+ #
744
+ # The set count and the rep count ask different questions. Counting only the
745
+ # sets at the working weight answers the second and gets the first wrong: a
746
+ # whole session done at two loads reads as an abandoned one.
747
+
748
+ CALF_RAISE = spec(
749
+ name="Seated Calf Raise",
750
+ garmin_name="SEATED_CALF_RAISE",
751
+ garmin_category="CALF_RAISE",
752
+ rep_low=12,
753
+ rep_high=18,
754
+ sets=3,
755
+ load="dumbbell",
756
+ weight_step=2.5,
757
+ min_weight=2.5,
758
+ )
759
+
760
+
761
+ def test_a_heavier_set_counts_toward_the_prescribed_sets():
762
+ """Two at 20 kg and one at 30 is three sets, not two."""
763
+ target, why = next_target(
764
+ CALF_RAISE, Target(17, 20.0), [P(17, 20.0), P(17, 20.0), P(17, 30.0)]
765
+ )
766
+ assert target == Target(18, 20.0), why
767
+ assert "consolidate" not in why
768
+
769
+
770
+ def test_a_heavier_set_moves_the_reps_and_not_the_load():
771
+ """One set at 30 kg is a third of the session; rule 5's business."""
772
+ target, _ = next_target(
773
+ CALF_RAISE, Target(17, 20.0), [P(17, 20.0), P(17, 20.0), P(17, 30.0)]
774
+ )
775
+ assert target.weight == 20.0
776
+
777
+
778
+ def test_a_heavier_set_that_came_up_short_counts_for_nothing():
779
+ """A failed top set must not read as a completed session."""
780
+ _, why = next_target(
781
+ CALF_RAISE, Target(17, 20.0), [P(17, 20.0), P(17, 20.0), P(5, 30.0)]
782
+ )
783
+ assert "only 2 of 3 sets logged, consolidate" in why
784
+
785
+
786
+ def test_a_genuinely_short_session_still_consolidates():
787
+ """The guard the heavier set slips past is still there for real misses."""
788
+ _, why = next_target(CALF_RAISE, Target(17, 20.0), [P(17, 20.0), P(17, 20.0)])
789
+ assert "only 2 of 3 sets logged, consolidate" in why
790
+
791
+
792
+ def test_a_lighter_set_does_not_count():
793
+ """Easier than asked is not the same as harder than asked."""
794
+ _, why = next_target(
795
+ CALF_RAISE, Target(17, 20.0), [P(17, 20.0), P(17, 20.0), P(17, 10.0)]
796
+ )
797
+ assert "only 2 of 3 sets logged, consolidate" in why
798
+
799
+
800
+ def test_a_heavier_set_can_complete_an_uneven_target():
801
+ """18,17,18 against `17+2` is what was asked, whichever load carried it."""
802
+ target, why = next_target(
803
+ CALF_RAISE, Target(17, 20.0, lead=2), [P(18, 20.0), P(17, 20.0), P(18, 30.0)]
804
+ )
805
+ assert "missed" not in why, why
806
+ assert target == Target(18, 20.0), why
807
+
808
+
809
+ def test_the_heavier_set_never_flatters_the_reps():
810
+ """It contributes its own count, so it cannot lift the floor off a weak set."""
811
+ target, why = next_target(
812
+ CALF_RAISE, Target(15, 20.0), [P(15, 20.0), P(15, 20.0), P(18, 30.0)]
813
+ )
814
+ assert target == Target(16, 20.0), why
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes