Skip to content

Commit

Permalink
Apply formatting and fix test values after bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatkinson1000 committed Jul 15, 2024
1 parent 3d8c6e6 commit ac978c5
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 75 deletions.
4 changes: 2 additions & 2 deletions archeryutils/classifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand Down
51 changes: 19 additions & 32 deletions archeryutils/classifications/tests/test_agb_indoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class TestCalculateAgbIndoorClassificationFraction:
450,
"adult",
"compound",
0.7661562067030987,
0.847856946666746,
),
(
"wa18",
Expand All @@ -443,13 +443,6 @@ class TestCalculateAgbIndoorClassificationFraction:
"barebow",
0.5975078167952219,
),
(
"wa18",
450,
"adult",
"compound",
0.7661562067030987,
),
(
"portsmouth",
538,
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
72 changes: 31 additions & 41 deletions archeryutils/classifications/tests/test_agb_outdoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit ac978c5

Please sign in to comment.