Skip to content

Commit

Permalink
Merge pull request #88 from jatkinson1000/lancaster
Browse files Browse the repository at this point in the history
Lancaster Scoring
  • Loading branch information
jatkinson1000 authored Mar 25, 2024
2 parents 347e105 + 1498c3d commit cd4dc92
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions archeryutils/handicaps/tests/test_handicaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def test_different_handicap_systems(
("10_zone_6_ring", 7.397557278),
("10_zone_5_ring", 7.059965360),
("10_zone_5_ring_compound", 6.993772436),
("11_zone", 7.574675221),
("11_zone_5_ring", 7.087430458),
("WA_field", 4.115600784),
("IFAA_field", 4.265744101),
("IFAA_field_expert", 4.021942762),
Expand Down
17 changes: 17 additions & 0 deletions archeryutils/round_data_files/Miscellaneous.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@
"passes" : [{"n_arrows" : 36, "diameter" : 80, "scoring" : "10_zone", "distance" : 30, "dist_unit" : "metre"}]
},

{"name" : "Lancaster",
"codename" : "lancaster",
"location" : "indoor",
"body" : "custom",
"passes" : [{"n_arrows" : 30, "diameter" : 40, "scoring" : "11_zone", "distance" : 18, "dist_unit" : "metre"},
{"n_arrows" : 30, "diameter" : 40, "scoring" : "11_zone", "distance" : 18, "dist_unit" : "metre"}
]
},
{"name" : "Lancaster Triple",
"codename" : "lancaster_triple",
"location" : "indoor",
"body" : "custom",
"passes" : [{"n_arrows" : 30, "diameter" : 40, "scoring" : "11_zone_5_ring", "distance" : 18, "dist_unit" : "metre"},
{"n_arrows" : 30, "diameter" : 40, "scoring" : "11_zone_5_ring", "distance" : 18, "dist_unit" : "metre"}
]
},

{"name" : "252 100",
"codename" : "c_252_100",
"location" : "outdoor",
Expand Down
8 changes: 8 additions & 0 deletions archeryutils/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"10_zone_6_ring",
"10_zone_5_ring",
"10_zone_5_ring_compound",
"11_zone",
"11_zone_5_ring",
"WA_field",
"IFAA_field",
"IFAA_field_expert",
Expand Down Expand Up @@ -381,6 +383,7 @@ def gen_face_spec(system: ScoringSystem, diameter: float) -> FaceSpec:
"10_zone_6_ring": 4,
"10_zone_5_ring": 5,
"10_zone_5_ring_compound": 5,
"11_zone_5_ring": 5,
"Worcester_2_ring": 3,
}

Expand All @@ -396,6 +399,11 @@ def gen_face_spec(system: ScoringSystem, diameter: float) -> FaceSpec:
_rnd6(n * diameter / 10): 11 - n for n in range(2, 11 - missing)
}

elif system in ("11_zone", "11_zone_5_ring"):
spec = {_rnd6(diameter / 20): 11} | {
_rnd6(n * diameter / 10): 11 - n for n in range(1, 11 - missing)
}

elif system == "WA_field":
spec = {_rnd6(diameter / 10): 6} | {
_rnd6(n * diameter / 5): 6 - n for n in range(1, 6)
Expand Down
21 changes: 21 additions & 0 deletions archeryutils/tests/test_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ def test_default_location(self) -> None:
("10_zone_6_ring", 10),
("10_zone_5_ring", 10),
("10_zone_5_ring_compound", 10),
("11_zone", 11),
("11_zone_5_ring", 11),
("WA_field", 6),
("IFAA_field", 5),
("IFAA_field_expert", 5),
Expand All @@ -193,6 +195,8 @@ def test_max_score(
("10_zone_6_ring", 5),
("10_zone_5_ring", 6),
("10_zone_5_ring_compound", 6),
("11_zone", 1),
("11_zone_5_ring", 6),
("WA_field", 1),
("IFAA_field", 3),
("IFAA_field_expert", 1),
Expand Down Expand Up @@ -240,6 +244,23 @@ def test_min_score(
0.8: 1,
},
),
(
"11_zone",
40,
{
0.02: 11,
0.04: 10,
0.08: 9,
0.12: 8,
0.16: 7,
0.20: 6,
0.24: 5,
0.28: 4,
0.32: 3,
0.36: 2,
0.40: 1,
},
),
(
"WA_field",
80,
Expand Down

0 comments on commit cd4dc92

Please sign in to comment.