Skip to content

Commit

Permalink
Add 11-zone (Lancaster) scoring and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatkinson1000 committed Mar 23, 2024
1 parent 347e105 commit bd9765c
Show file tree
Hide file tree
Showing 3 changed files with 31 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
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 bd9765c

Please sign in to comment.