Skip to content

Commit

Permalink
Enforce full face for indoor classification scores.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatkinson1000 committed Aug 2, 2023
1 parent d6a9991 commit c0a71b8
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions archeryutils/classifications/classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,9 +998,10 @@ def calculate_AGB_old_indoor_classification(
hc_params = hc_eq.HcParams()

# Get scores required on this round for each classification
# Enforce full size face
class_scores = [
hc_eq.score_for_round(
all_indoor_rounds[roundname],
all_indoor_rounds[strip_spots(roundname)],
group_data["class_HC"][i],
hc_scheme,
hc_params,
Expand Down Expand Up @@ -1109,6 +1110,28 @@ def AGB_old_indoor_classification_scores(
return int_class_scores


def strip_spots(
roundname: str,
) -> str:
"""
Calculate AGB indoor classification from score.
Parameters
----------
roundname : str
name of round shot as given by 'codename' in json
Returns
-------
roundname : str
name of round shot as given by 'codename' in json
"""
roundname = roundname.replace("_triple", "")
roundname = roundname.replace("_5_centre", "")
return roundname


def calculate_AGB_indoor_classification(
roundname: str,
score: float,
Expand Down Expand Up @@ -1169,9 +1192,11 @@ def calculate_AGB_indoor_classification(
hc_params = hc_eq.HcParams()

# Get scores required on this round for each classification
print(roundname)
print(strip_spots(roundname))
class_scores = [
hc_eq.score_for_round(
all_indoor_rounds[roundname],
all_indoor_rounds[strip_spots(roundname)],
group_data["class_HC"][i],
hc_scheme,
hc_params,
Expand Down Expand Up @@ -1257,9 +1282,10 @@ def AGB_indoor_classification_scores(
hc_params = hc_eq.HcParams()

# Get scores required on this round for each classification
# Enforce full size face
class_scores = [
hc_eq.score_for_round(
all_indoor_rounds[roundname],
all_indoor_rounds[strip_spots(roundname)],
group_data["class_HC"][i],
hc_scheme,
hc_params,
Expand Down

0 comments on commit c0a71b8

Please sign in to comment.