From 2f4d9ae3f2480c637076c69f587bebaf7af509f5 Mon Sep 17 00:00:00 2001 From: Jack Atkinson Date: Sat, 16 Nov 2024 14:48:08 +0000 Subject: [PATCH] Add guard against compound limited and tests to check. --- .../agb_indoor_classifications.py | 2 +- .../agb_outdoor_classifications.py | 2 +- .../classifications/tests/test_agb_indoor.py | 10 +++++++++- .../classifications/tests/test_agb_outdoor.py | 16 ++++++++++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/archeryutils/classifications/agb_indoor_classifications.py b/archeryutils/classifications/agb_indoor_classifications.py index d8af810a..f0920595 100644 --- a/archeryutils/classifications/agb_indoor_classifications.py +++ b/archeryutils/classifications/agb_indoor_classifications.py @@ -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 diff --git a/archeryutils/classifications/agb_outdoor_classifications.py b/archeryutils/classifications/agb_outdoor_classifications.py index 035ba0e0..76ff85e2 100644 --- a/archeryutils/classifications/agb_outdoor_classifications.py +++ b/archeryutils/classifications/agb_outdoor_classifications.py @@ -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) diff --git a/archeryutils/classifications/tests/test_agb_indoor.py b/archeryutils/classifications/tests/test_agb_indoor.py index 3f1c7f99..fddf8e0e 100644 --- a/archeryutils/classifications/tests/test_agb_indoor.py +++ b/archeryutils/classifications/tests/test_agb_indoor.py @@ -165,6 +165,14 @@ 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( @@ -172,7 +180,7 @@ def test_agb_indoor_classification_scores_nonbowstyles( 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, diff --git a/archeryutils/classifications/tests/test_agb_outdoor.py b/archeryutils/classifications/tests/test_agb_outdoor.py index 13e992de..9c6fa10b 100644 --- a/archeryutils/classifications/tests/test_agb_outdoor.py +++ b/archeryutils/classifications/tests/test_agb_outdoor.py @@ -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( @@ -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, @@ -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],