diff --git a/archeryutils/classifications/__init__.py b/archeryutils/classifications/__init__.py index a150593..a68a35f 100644 --- a/archeryutils/classifications/__init__.py +++ b/archeryutils/classifications/__init__.py @@ -9,8 +9,8 @@ calculate_agb_indoor_classification, ) from .agb_old_field_classifications import ( - calculate_old_agb_field_classification, - old_agb_field_classification_scores, + agb_old_field_classification_scores, + calculate_agb_old_field_classification, ) from .agb_old_indoor_classifications import ( agb_old_indoor_classification_scores, @@ -24,12 +24,12 @@ __all__ = [ "agb_field_classification_scores", "agb_indoor_classification_scores", + "agb_old_field_classification_scores", "agb_old_indoor_classification_scores", "agb_outdoor_classification_scores", "calculate_agb_field_classification", "calculate_agb_indoor_classification", + "calculate_agb_old_field_classification", "calculate_agb_old_indoor_classification", "calculate_agb_outdoor_classification", - "calculate_old_agb_field_classification", - "old_agb_field_classification_scores", ] diff --git a/archeryutils/classifications/agb_old_field_classifications.py b/archeryutils/classifications/agb_old_field_classifications.py index 1e38126..ec2eff8 100644 --- a/archeryutils/classifications/agb_old_field_classifications.py +++ b/archeryutils/classifications/agb_old_field_classifications.py @@ -34,9 +34,9 @@ class GroupData(TypedDict): class_scores: list[int] -def _make_old_agb_field_classification_dict() -> dict[str, GroupData]: +def _make_agb_old_field_classification_dict() -> dict[str, GroupData]: """ - Generate AGB outdoor classification data. + Generate old (pre-2025) AGB field classification data. Generate a dictionary of dictionaries providing handicaps for each classification band. @@ -112,16 +112,16 @@ def _make_old_agb_field_classification_dict() -> dict[str, GroupData]: return classification_dict -old_agb_field_classifications = _make_old_agb_field_classification_dict() +old_agb_field_classifications = _make_agb_old_field_classification_dict() -del _make_old_agb_field_classification_dict +del _make_agb_old_field_classification_dict -def calculate_old_agb_field_classification( +def calculate_agb_old_field_classification( roundname: str, score: float, bowstyle: str, gender: str, age_group: str ) -> str: """ - Calculate AGB field classification from score. + Calculate old (pre-2025) AGB field classification from score. Subroutine to calculate a classification from a score given suitable inputs. @@ -156,7 +156,7 @@ def calculate_old_agb_field_classification( Examples -------- >>> from archeryutils import classifications as class_func - >>> class_func.calculate_agb_field_classification( + >>> class_func.calculate_agb_old_field_classification( ... 247, ... "wa_field_24_red_marked", ... "recurve", @@ -220,14 +220,14 @@ def calculate_old_agb_field_classification( return "unclassified" -def old_agb_field_classification_scores( +def agb_old_field_classification_scores( roundname: str, # noqa: ARG001 - Unused argument for consistency with other classification schemes bowstyle: str, gender: str, age_group: str, ) -> list[int]: """ - Calculate AGB field classification scores for category. + Calculate old (pre-2025) AGB field classification scores for category. Subroutine to calculate classification scores for a specific category and round. Appropriate ArcheryGB age groups and classifications. @@ -256,7 +256,7 @@ def old_agb_field_classification_scores( Examples -------- >>> from archeryutils import classifications as class_func - >>> class_func.agb_field_classification_scores( + >>> class_func.agb_old_field_classification_scores( ... "wa_field_24_red_marked", ... "recurve", ... "male", diff --git a/archeryutils/classifications/tests/test_agb_field.py b/archeryutils/classifications/tests/test_agb_field.py index d66c52d..04b3de6 100644 --- a/archeryutils/classifications/tests/test_agb_field.py +++ b/archeryutils/classifications/tests/test_agb_field.py @@ -1,4 +1,4 @@ -"""Tests for old field classification functions.""" +"""Tests for field classification functions.""" import pytest diff --git a/archeryutils/classifications/tests/test_agb_old_field.py b/archeryutils/classifications/tests/test_agb_old_field.py index c05071c..aefdee8 100644 --- a/archeryutils/classifications/tests/test_agb_old_field.py +++ b/archeryutils/classifications/tests/test_agb_old_field.py @@ -1,4 +1,4 @@ -"""Tests for old agb field classification functions.""" +"""Tests for old (pre-2025) agb field classification functions.""" import pytest @@ -12,7 +12,7 @@ ) -class TestOldAgbFieldClassificationScores: +class TestAgbOldFieldClassificationScores: """Tests for the field classification scores function.""" @pytest.mark.parametrize( @@ -45,14 +45,14 @@ class TestOldAgbFieldClassificationScores: ), ], ) - def test_old_agb_field_classification_scores_ages( + def test_agb_old_field_classification_scores_ages( self, roundname: str, age_group: str, scores_expected: list[int], ) -> None: """Check that field classification returns expected value for a case.""" - scores = class_funcs.old_agb_field_classification_scores( + scores = class_funcs.agb_old_field_classification_scores( roundname=roundname, bowstyle="barebow", gender="male", @@ -90,7 +90,7 @@ def test_old_agb_field_classification_scores_ages( ), ], ) - def test_old_agb_field_classification_scores_genders( + def test_agb_old_field_classification_scores_genders( self, roundname: str, gender: str, @@ -98,7 +98,7 @@ def test_old_agb_field_classification_scores_genders( scores_expected: list[int], ) -> None: """Check that field classification returns expected value for a case.""" - scores = class_funcs.old_agb_field_classification_scores( + scores = class_funcs.agb_old_field_classification_scores( roundname=roundname, bowstyle="barebow", gender=gender, @@ -148,14 +148,14 @@ def test_old_agb_field_classification_scores_genders( ), ], ) - def test_old_agb_field_classification_scores_bowstyles( + def test_agb_old_field_classification_scores_bowstyles( self, roundname: str, bowstyle: str, scores_expected: list[int], ) -> None: """Check that field classification returns expected value for a case.""" - scores = class_funcs.old_agb_field_classification_scores( + scores = class_funcs.agb_old_field_classification_scores( roundname=roundname, bowstyle=bowstyle, gender="male", @@ -188,7 +188,7 @@ def test_old_agb_field_classification_scores_bowstyles( ), ], ) - def test_old_agb_field_classification_scores_invalid( + def test_agb_old_field_classification_scores_invalid( self, roundname: str, bowstyle: str, @@ -203,7 +203,7 @@ def test_old_agb_field_classification_scores_invalid( f"{gender.lower()}_{bowstyle.lower()}" ), ): - _ = class_funcs.old_agb_field_classification_scores( + _ = class_funcs.agb_old_field_classification_scores( roundname=roundname, bowstyle=bowstyle, gender=gender, @@ -275,7 +275,7 @@ class TestCalculateOldAgbFieldClassification: ), ], ) - def test_calculate_old_agb_field_classification( + def test_calculate_agb_old_field_classification( self, roundname: str, score: float, @@ -285,7 +285,7 @@ def test_calculate_old_agb_field_classification( ) -> None: """Check that field classification returns expected value for a few cases.""" # pylint: disable=too-many-arguments - class_returned = class_funcs.calculate_old_agb_field_classification( + class_returned = class_funcs.calculate_agb_old_field_classification( roundname=roundname, score=score, bowstyle=bowstyle, @@ -312,7 +312,7 @@ def test_calculate_old_agb_field_classification( ), ], ) - def test_calculate_old_agb_field_classification_invalid_rounds( + def test_calculate_agb_old_field_classification_invalid_rounds( self, roundname: str, score: float, @@ -320,7 +320,7 @@ def test_calculate_old_agb_field_classification_invalid_rounds( class_expected: str, ) -> None: """Check field classification returns unclassified for inappropriate rounds.""" - class_returned = class_funcs.calculate_old_agb_field_classification( + class_returned = class_funcs.calculate_agb_old_field_classification( roundname=roundname, score=score, bowstyle=bowstyle, @@ -351,7 +351,7 @@ def test_calculate_old_agb_field_classification_invalid_rounds( ), ], ) - def test_calculate_old_agb_field_classification_invalid_scores( + def test_calculate_agb_old_field_classification_invalid_scores( self, roundname: str, score: float, @@ -364,7 +364,7 @@ def test_calculate_old_agb_field_classification_invalid_scores( f"Should be in range 0-{ALL_AGBFIELD_ROUNDS[roundname].max_score()}." ), ): - _ = class_funcs.calculate_old_agb_field_classification( + _ = class_funcs.calculate_agb_old_field_classification( score=score, roundname=roundname, bowstyle="barebow",