From ac978c5db9c6a55d6debb287a6b6b623aed29402 Mon Sep 17 00:00:00 2001 From: Jack Atkinson Date: Mon, 15 Jul 2024 17:26:15 +0100 Subject: [PATCH] Apply formatting and fix test values after bugfix. --- archeryutils/classifications/__init__.py | 4 +- .../classifications/tests/test_agb_indoor.py | 51 +++++-------- .../classifications/tests/test_agb_outdoor.py | 72 ++++++++----------- 3 files changed, 52 insertions(+), 75 deletions(-) diff --git a/archeryutils/classifications/__init__.py b/archeryutils/classifications/__init__.py index e7e2a84..9d49ecd 100644 --- a/archeryutils/classifications/__init__.py +++ b/archeryutils/classifications/__init__.py @@ -5,18 +5,18 @@ calculate_agb_field_classification, ) from .agb_indoor_classifications import ( + agb_indoor_classification_fraction, agb_indoor_classification_scores, calculate_agb_indoor_classification, - agb_indoor_classification_fraction, ) from .agb_old_indoor_classifications import ( agb_old_indoor_classification_scores, calculate_agb_old_indoor_classification, ) from .agb_outdoor_classifications import ( + agb_outdoor_classification_fraction, agb_outdoor_classification_scores, calculate_agb_outdoor_classification, - agb_outdoor_classification_fraction, ) __all__ = [ diff --git a/archeryutils/classifications/tests/test_agb_indoor.py b/archeryutils/classifications/tests/test_agb_indoor.py index 2aa5079..199be9a 100644 --- a/archeryutils/classifications/tests/test_agb_indoor.py +++ b/archeryutils/classifications/tests/test_agb_indoor.py @@ -434,7 +434,7 @@ class TestCalculateAgbIndoorClassificationFraction: 450, "adult", "compound", - 0.7661562067030987, + 0.847856946666746, ), ( "wa18", @@ -443,13 +443,6 @@ class TestCalculateAgbIndoorClassificationFraction: "barebow", 0.5975078167952219, ), - ( - "wa18", - 450, - "adult", - "compound", - 0.7661562067030987, - ), ( "portsmouth", 538, @@ -468,14 +461,12 @@ def test_agb_indoor_classification_fraction( # noqa: PLR0913 Too many arguments frac_expected: float, ) -> None: """Check that classification fraction is as expected.""" - frac_returned = ( - au.classifications.agb_indoor_classifications.classification_fraction( - roundname=roundname, - score=score, - bowstyle=bowstyle, - gender="male", - age_group=age_group, - ) + frac_returned = class_funcs.agb_indoor_classification_fraction( + roundname=roundname, + score=score, + bowstyle=bowstyle, + gender="male", + age_group=age_group, ) assert frac_returned == frac_expected @@ -522,14 +513,12 @@ def test_agb_indoor_classification_fraction_low( # noqa: PLR0913 many args frac_expected: float, ) -> None: """Check that classification fraction below lowest classification is 0,0.""" - frac_returned = ( - au.classifications.agb_indoor_classifications.classification_fraction( - roundname=roundname, - score=score, - bowstyle=bowstyle, - gender="male", - age_group=age_group, - ) + frac_returned = class_funcs.agb_indoor_classification_fraction( + roundname=roundname, + score=score, + bowstyle=bowstyle, + gender="male", + age_group=age_group, ) assert frac_returned == frac_expected @@ -576,14 +565,12 @@ def test_agb_indoor_classification_fraction_high( # noqa: PLR0913 Too many args frac_expected: float, ) -> None: """Check that classification fraction above highest classification is 1,0.""" - frac_returned = ( - au.classifications.agb_indoor_classifications.classification_fraction( - roundname=roundname, - score=score, - bowstyle=bowstyle, - gender="male", - age_group=age_group, - ) + frac_returned = class_funcs.agb_indoor_classification_fraction( + roundname=roundname, + score=score, + bowstyle=bowstyle, + gender="male", + age_group=age_group, ) assert frac_returned == frac_expected diff --git a/archeryutils/classifications/tests/test_agb_outdoor.py b/archeryutils/classifications/tests/test_agb_outdoor.py index 3b304c0..a99f689 100644 --- a/archeryutils/classifications/tests/test_agb_outdoor.py +++ b/archeryutils/classifications/tests/test_agb_outdoor.py @@ -613,14 +613,12 @@ def test_agb_outdoor_classification_fraction( # noqa: PLR0913 many args frac_expected: float, ) -> None: """Check that classification fraction is as expected.""" - frac_returned = ( - au.classifications.agb_outdoor_classifications.classification_fraction( - roundname=roundname, - score=score, - bowstyle=bowstyle, - gender="male", - age_group=age_group, - ) + frac_returned = class_funcs.agb_outdoor_classification_fraction( + roundname=roundname, + score=score, + bowstyle=bowstyle, + gender="male", + age_group=age_group, ) assert frac_returned == frac_expected @@ -667,14 +665,12 @@ def test_agb_outdoor_classification_fraction_low( # noqa: PLR0913 many args frac_expected: float, ) -> None: """Check that classification fraction below lowest classification is 0,0.""" - frac_returned = ( - au.classifications.agb_outdoor_classifications.classification_fraction( - roundname=roundname, - score=score, - bowstyle=bowstyle, - gender="male", - age_group=age_group, - ) + frac_returned = class_funcs.agb_outdoor_classification_fraction( + roundname=roundname, + score=score, + bowstyle=bowstyle, + gender="male", + age_group=age_group, ) assert frac_returned == frac_expected @@ -721,14 +717,12 @@ def test_agb_outdoor_classification_fraction_high( # noqa: PLR0913 many args frac_expected: float, ) -> None: """Check that classification fraction above highest classification is 1,0.""" - frac_returned = ( - au.classifications.agb_outdoor_classifications.classification_fraction( - roundname=roundname, - score=score, - bowstyle=bowstyle, - gender="male", - age_group=age_group, - ) + frac_returned = class_funcs.agb_outdoor_classification_fraction( + roundname=roundname, + score=score, + bowstyle=bowstyle, + gender="male", + age_group=age_group, ) assert frac_returned == frac_expected @@ -737,26 +731,22 @@ def test_agb_outdoor_classification_fraction_restrict( self, ) -> None: """Check that classification fraction functions with restrict.""" - frac_restricted = ( - au.classifications.agb_outdoor_classifications.classification_fraction( - score=620, - roundname="national", - bowstyle="recurve", - gender="male", - age_group="adult", - ) + frac_restricted = class_funcs.agb_outdoor_classification_fraction( + score=620, + roundname="national", + bowstyle="recurve", + gender="male", + age_group="adult", ) assert frac_restricted == 1.0 - frac_unrestricted = ( - au.classifications.agb_outdoor_classifications.classification_fraction( - score=620, - roundname="national", - bowstyle="recurve", - gender="male", - age_group="adult", - restrict=False, - ) + frac_unrestricted = class_funcs.agb_outdoor_classification_fraction( + score=620, + roundname="national", + bowstyle="recurve", + gender="male", + age_group="adult", + restrict=False, ) assert frac_unrestricted == 0.4541258975704667