Skip to content

Commit

Permalink
Add guard against compound limited and tests to check.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatkinson1000 committed Nov 16, 2024
1 parent 965dfed commit 2f4d9ae
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion archeryutils/classifications/agb_indoor_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def agb_indoor_classification_scores(
# deal with reduced categories:
if bowstyle.lower() in ("flatbow", "traditional", "asiatic"):
bowstyle = "Barebow"
elif bowstyle.lower() == "compound barebow":
elif bowstyle.lower() in ("compound barebow", "compound limited"):
bowstyle = "Compound"

# enforce compound scoring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def agb_outdoor_classification_scores(
"""
if bowstyle.lower() in ("traditional", "flatbow", "asiatic"):
bowstyle = "Barebow"
elif bowstyle.lower() == "compound barebow":
elif bowstyle.lower() in ("compound barebow", "compound longbow"):
bowstyle = "Compound"

groupname = cls_funcs.get_groupname(bowstyle, gender, age_group)
Expand Down
10 changes: 9 additions & 1 deletion archeryutils/classifications/tests/test_agb_indoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,22 @@ def test_agb_indoor_classification_scores_bowstyles(
"asiatic",
[331, 387, 433, 472, 503, 528, 549, 565],
),
(
"compound limited",
[472, 508, 532, 549, 560, 571, 583, 594],
),
(
"compound barebow",
[472, 508, 532, 549, 560, 571, 583, 594],
),
],
)
def test_agb_indoor_classification_scores_nonbowstyles(
self,
bowstyle: str,
scores_expected: list[int],
) -> None:
"""Check that barebow scores returned for valid but non-indoor styles."""
"""Check that appropriate scores returned for valid but non-indoor styles."""
scores = class_funcs.agb_indoor_classification_scores(
roundname="portsmouth",
bowstyle=bowstyle,
Expand Down
16 changes: 14 additions & 2 deletions archeryutils/classifications/tests/test_agb_outdoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ def test_agb_outdoor_classification_scores_bowstyles(
"female",
[252, 338, 441, 558, 682, 806, 921, 1023, 1108],
),
(
"wa1440_70",
"compound barebow",
"female",
[870, 988, 1086, 1167, 1233, 1286, 1330, 1364, 1392],
),
(
"wa1440_70",
"compound limited",
"female",
[870, 988, 1086, 1167, 1233, 1286, 1330, 1364, 1392],
),
],
)
def test_agb_outdoor_classification_scores_nonbowstyles(
Expand All @@ -223,7 +235,7 @@ def test_agb_outdoor_classification_scores_nonbowstyles(
gender: str,
scores_expected: list[int],
) -> None:
"""Check that barebow scores returned for valid but non-outdoor bowstyles."""
"""Check that appropriate scores returned for valid non-outdoor bowstyles."""
scores = class_funcs.agb_outdoor_classification_scores(
roundname=roundname,
bowstyle=bowstyle,
Expand All @@ -242,7 +254,7 @@ def test_agb_outdoor_classification_scores_nonbowstyles(
),
],
)
def test_agb_outdoor_classification_scores_triple_faces(
def test_agb_outdoor_classification_scores_small_faces(
self,
roundname: str,
scores_expected: list[int],
Expand Down

0 comments on commit 2f4d9ae

Please sign in to comment.