Skip to content

Commit

Permalink
Add outdoor classification tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatkinson1000 committed Aug 27, 2023
1 parent c38edfd commit 671a255
Show file tree
Hide file tree
Showing 3 changed files with 552 additions and 3 deletions.
10 changes: 7 additions & 3 deletions archeryutils/classifications/agb_outdoor_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,12 @@ def calculate_agb_outdoor_classification(
ArcheryGB 2023 Rules of Shooting
ArcheryGB Shooting Administrative Procedures - SAP7 (2023)
"""
if bowstyle.lower() in ("traditional", "flatbow", "asiatic"):
bowstyle = "Barebow"
# Check score is valid
if score < 0 or score > ALL_OUTDOOR_ROUNDS[roundname].max_score():
raise ValueError(
f"Invalid score of {score} for a {roundname}. "
f"Should be in range 0-{ALL_OUTDOOR_ROUNDS[roundname].max_score()}."
)

# Get scores required on this round for each classification
# Enforcing full size face and compound scoring (for compounds)
Expand Down Expand Up @@ -377,7 +381,7 @@ def agb_outdoor_classification_scores(
# Get scores required on this round for each classification
class_scores = [
hc_eq.score_for_round(
ALL_OUTDOOR_ROUNDS[roundname],
ALL_OUTDOOR_ROUNDS[cls_funcs.strip_spots(roundname)],
group_data["class_HC"][i],
"AGB",
hc_params,
Expand Down
1 change: 1 addition & 0 deletions archeryutils/classifications/classification_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def strip_spots(
"""
roundname = roundname.replace("_triple", "")
roundname = roundname.replace("_5_centre", "")
roundname = roundname.replace("_small", "")
return roundname


Expand Down
Loading

0 comments on commit 671a255

Please sign in to comment.