Repository: jatkinson1000/archeryutils

Issue:
Accept "English Longbow" as well as "Longbow" for field archery purposes.
As title suggests.

There is some ambiguity in WA rules whereby a "Longbow" is closer to what AGB would term "Flatbow".

We have a flatbow category, so to be clear implement longbow also as english longbow as it is described in the rules.

This will also need updates to archerycalculator.

Hints from issue comments:

Solution patch:
diff --git a/archeryutils/classifications/classification_utils.py b/archeryutils/classifications/classification_utils.py
index 40df749..05afe93 100644
--- a/archeryutils/classifications/classification_utils.py
+++ b/archeryutils/classifications/classification_utils.py
@@ -232,6 +232,10 @@ def get_groupname(bowstyle: str, gender: str, age_group: str) -> str:
     groupname : str
         single, lower case str id for this category
     """
+    # Guard against English Longbow as a synonym for Longbow
+    if bowstyle.lower() == "english longbow":
+        bowstyle = "longbow"
+
     groupname = (
         f"{age_group.lower().replace(' ', '')}_"
         f"{gender.lower()}_"


Test patch:
diff --git a/archeryutils/classifications/tests/test_agb_field.py b/archeryutils/classifications/tests/test_agb_field.py
index f21e067..77f83c5 100644
--- a/archeryutils/classifications/tests/test_agb_field.py
+++ b/archeryutils/classifications/tests/test_agb_field.py
@@ -141,6 +141,11 @@ def test_agb_field_classification_scores_genders(
                 "longbow",
                 [201, 188, 171, 155, 137, 121],
             ),
+            (
+                "wa_field_24_blue_marked",
+                "english longbow",
+                [201, 188, 171, 155, 137, 121],
+            ),
         ],
     )
     def test_agb_field_classification_scores_bowstyles(
@@ -261,6 +266,13 @@ class TestCalculateAgbFieldClassification:
                 "longbow",
                 "unclassified",
             ),
+            (
+                "wa_field_24_blue_marked",
+                1,
+                "Under 12",
+                "english longbow",
+                "unclassified",
+            ),
         ],
     )
     def test_calculate_agb_field_classification(
diff --git a/archeryutils/classifications/tests/test_agb_indoor.py b/archeryutils/classifications/tests/test_agb_indoor.py
index dcd344e..3f1c7f9 100644
--- a/archeryutils/classifications/tests/test_agb_indoor.py
+++ b/archeryutils/classifications/tests/test_agb_indoor.py
@@ -129,6 +129,10 @@ def test_agb_indoor_classification_scores_genders(
                 "longbow",
                 [127, 178, 240, 306, 369, 423, 466, 501],
             ),
+            (
+                "english longbow",
+                [127, 178, 240, 306, 369, 423, 466, 501],
+            ),
         ],
     )
     def test_agb_indoor_classification_scores_bowstyles(
@@ -333,7 +337,7 @@ class TestCalculateAgbIndoorClassification:
             (
                 1,
                 "Under 12",
-                "longbow",
+                "english longbow",
                 "UC",
             ),
         ],
diff --git a/archeryutils/classifications/tests/test_agb_outdoor.py b/archeryutils/classifications/tests/test_agb_outdoor.py
index 6e45d21..13e992d 100644
--- a/archeryutils/classifications/tests/test_agb_outdoor.py
+++ b/archeryutils/classifications/tests/test_agb_outdoor.py
@@ -168,6 +168,12 @@ def test_agb_outdoor_classification_scores_genders(
                 "female",
                 [64, 94, 136, 195, 274, 373, 493, 625, 761],
             ),
+            (
+                "wa1440_70",
+                "english longbow",
+                "female",
+                [64, 94, 136, 195, 274, 373, 493, 625, 761],
+            ),
         ],
     )
     def test_agb_outdoor_classification_scores_bowstyles(
@@ -386,6 +392,13 @@ class TestCalculateAgbOutdoorClassification:
                 "longbow",
                 "UC",
             ),
+            (
+                "metric_v",
+                250,
+                "Under 12",
+                "longbow",
+                "A1",
+            ),
         ],
     )
     def test_calculate_agb_outdoor_classification(
diff --git a/archeryutils/classifications/tests/test_classification_utils.py b/archeryutils/classifications/tests/test_classification_utils.py
index 784b1ad..e85c384 100644
--- a/archeryutils/classifications/tests/test_classification_utils.py
+++ b/archeryutils/classifications/tests/test_classification_utils.py
@@ -10,12 +10,13 @@ class TestStringUtils:
 
     @pytest.mark.parametrize(
         "bowstyle,age_group,gender,groupname_expected",
-        # Check all systems, different distances, negative and large handicaps.
         [
             ("barebow", "adult", "male", "adult_male_barebow"),
             ("Barebow", "Adult", "Male", "adult_male_barebow"),
             ("Barebow", "Under 18", "Male", "under18_male_barebow"),
             ("RECURVE", "UnDeR 18", "femaLe", "under18_female_recurve"),
+            # Check English Longbow becomes Longbow
+            ("English Longbow", "adult", "femaLe", "adult_female_longbow"),
         ],
     )
     def test_get_groupname(
@@ -36,7 +37,6 @@ def test_get_groupname(
 
     @pytest.mark.parametrize(
         "roundname,strippedname_expected",
-        # Check all systems, different distances, negative and large handicaps.
         [
             ("portsmouth", "portsmouth"),
             ("portsmouth_triple", "portsmouth"),