Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clout #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions archeryutils/handicaps/handicap_equations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
- IFAA_field
- Beiter-hit-miss
- Worcester
- Worcester 2-ring)
- Worcester (2-ring)
- Imperial Clout
- WA/Metric Clout

Routine Listings
----------------
Expand Down Expand Up @@ -443,7 +445,7 @@ def arrow_score( # pylint: disable=too-many-branches
elif target.scoring_system == "Beiter_hit_miss":
s_bar = 1.0 - np.exp(-((((tar_dia / 2.0) + arw_rad) / sig_r) ** 2))

elif target.scoring_system in ("Worcester", "IFAA_field_expert"):
elif target.scoring_system in ("Worcester", "IFAA_field_expert", "metric_clout"):
s_bar = 5.0 - sum(
np.exp(-((((n * tar_dia / 10.0) + arw_rad) / sig_r) ** 2))
for n in range(1, 6)
Expand All @@ -456,6 +458,16 @@ def arrow_score( # pylint: disable=too-many-branches
- 4.0 * np.exp(-((((2 * tar_dia / 10.0) + arw_rad) / sig_r) ** 2))
)

elif target.scoring_system == "imperial_clout":
s_bar = (
5.0
- np.exp(-((((tar_dia / 16.0) + arw_rad) / sig_r) ** 2))
- sum(
np.exp(-((((n * tar_dia / 8.0) + arw_rad) / sig_r) ** 2))
for n in range(2, 6)
)
)

else:
raise ValueError(
f"No rule for calculating scoring for face type {target.scoring_system}."
Expand Down
3 changes: 3 additions & 0 deletions archeryutils/handicaps/handicap_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def print_handicap_table(
"Small": "Sm",
"Gents": "G",
"Ladies": "L",
"Imperial": "I.",
"Metric Clout": "M. Clt",
"Clout": "Clt",
}

if not isinstance(hcs, np.ndarray):
Expand Down
10 changes: 10 additions & 0 deletions archeryutils/load_rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def read_json_to_round_dict(json_filelist: Union[str, List[str]]) -> Dict[str, R
):
round_i["indoor"] = False
round_i["location"] = "field"
elif round_i["location"] in (
"c",
"C",
"clout",
"Clout",
):
round_i["indoor"] = False
round_i["location"] = "clout"
else:
warnings.warn(
f"Location not recognised for round {round_i['name']}. "
Expand Down Expand Up @@ -190,8 +198,10 @@ def _make_rounds_dict(json_name: str) -> DotDict:
AGB_outdoor_imperial = _make_rounds_dict("AGB_outdoor_imperial.json")
AGB_outdoor_metric = _make_rounds_dict("AGB_outdoor_metric.json")
AGB_indoor = _make_rounds_dict("AGB_indoor.json")
AGB_clout = _make_rounds_dict("AGB_clout.json")
WA_outdoor = _make_rounds_dict("WA_outdoor.json")
WA_indoor = _make_rounds_dict("WA_indoor.json")
WA_clout = _make_rounds_dict("WA_clout.json")
WA_field = _make_rounds_dict("WA_field.json")
IFAA_field = _make_rounds_dict("IFAA_field.json")
WA_VI = _make_rounds_dict("WA_VI.json")
Expand Down
32 changes: 32 additions & 0 deletions archeryutils/round_data_files/AGB_clout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{"name" : "Imperial Clout (180y)",
"codename" : "imperial_clout_180",
"location" : "clout",
"body" : "WA",
"passes" : [{"n_arrows" : 36, "diameter" : 365.76, "scoring" : "imperial_clout", "distance" : 180, "dist_unit" : "yard"}]
},
{"name" : "Imperial Clout (140y)",
"codename" : "imperial_clout_140",
"location" : "clout",
"body" : "WA",
"passes" : [{"n_arrows" : 36, "diameter" : 365.76, "scoring" : "imperial_clout", "distance" : 140, "dist_unit" : "yard"}]
},
{"name" : "Imperial Clout (120y)",
"codename" : "imperial_clout_120",
"location" : "clout",
"body" : "WA",
"passes" : [{"n_arrows" : 36, "diameter" : 365.76, "scoring" : "imperial_clout", "distance" : 120, "dist_unit" : "yard"}]
},
{"name" : "Imperial Clout (100y)",
"codename" : "imperial_clout_100",
"location" : "clout",
"body" : "AGB",
"passes" : [{"n_arrows" : 36, "diameter" : 365.76, "scoring" : "imperial_clout", "distance" : 100, "dist_unit" : "yard"}]
},
{"name" : "Imperial Clout (80y)",
"codename" : "imperial_clout_80",
"location" : "clout",
"body" : "AGB",
"passes" : [{"n_arrows" : 36, "diameter" : 365.76, "scoring" : "imperial_clout", "distance" : 80, "dist_unit" : "yard"}]
}
]
38 changes: 38 additions & 0 deletions archeryutils/round_data_files/WA_clout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{"name" : "WA Clout (185m)",
"codename" : "wa_clout_185",
"location" : "clout",
"body" : "WA",
"passes" : [{"n_arrows" : 36, "diameter" : 1500, "scoring" : "metric_clout", "distance" : 185, "dist_unit" : "metre"}]
},
{"name" : "WA Clout (165m)",
"codename" : "wa_clout_165",
"location" : "clout",
"body" : "WA",
"passes" : [{"n_arrows" : 36, "diameter" : 1500, "scoring" : "metric_clout", "distance" : 165, "dist_unit" : "metre"}]
},
{"name" : "WA Clout (125m)",
"codename" : "wa_clout_125",
"location" : "clout",
"body" : "WA",
"passes" : [{"n_arrows" : 36, "diameter" : 1500, "scoring" : "metric_clout", "distance" : 125, "dist_unit" : "metre"}]
},
{"name" : "Metric Clout (110m)",
"codename" : "metric_clout_110",
"location" : "clout",
"body" : "AGB",
"passes" : [{"n_arrows" : 36, "diameter" : 1500, "scoring" : "metric_clout", "distance" : 110, "dist_unit" : "metre"}]
},
{"name" : "Metric Clout (90m)",
"codename" : "wa_clout_90",
"location" : "clout",
"body" : "AGB",
"passes" : [{"n_arrows" : 36, "diameter" : 1500, "scoring" : "metric_clout", "distance" : 90, "dist_unit" : "metre"}]
},
{"name" : "Metric Clout (75m)",
"codename" : "wa_clout_75",
"location" : "clout",
"body" : "AGB",
"passes" : [{"n_arrows" : 36, "diameter" : 1500, "scoring" : "metric_clout", "distance" : 75, "dist_unit" : "metre"}]
}
]
4 changes: 4 additions & 0 deletions archeryutils/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def __init__(
"Beiter_hit_miss",
"Worcester",
"Worcester_2_ring",
"imperial_clout",
"metric_clout",
]

if scoring_system not in systems:
Expand Down Expand Up @@ -120,6 +122,8 @@ def max_score(self) -> float:
"IFAA_field_expert",
"Worcester",
"Worcester_2_ring",
"imperial_clout",
"metric_clout",
):
return 5.0
if self.scoring_system in ("Beiter_hit_miss"):
Expand Down