Skip to content

Commit

Permalink
typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHall2020 committed Dec 17, 2024
1 parent dba0a1e commit b195f5e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions archeryutils/classifications/agb_field_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GroupData(TypedDict):
classes_long: list[str]
class_HC: npt.NDArray[np.float64]
max_distance: int
min_dists: npt.NDArray[np.float64]
min_dists: npt.NDArray[np.int64]


def _make_agb_field_classification_dict() -> dict[str, GroupData]:
Expand Down Expand Up @@ -104,7 +104,7 @@ def _make_agb_field_classification_dict() -> dict[str, GroupData]:
bowstyle["datum_field"]
+ delta_hc_age_gender
+ (np.arange(len(agb_classes_field)) - 2) * bowstyle["classStep_field"]
)
).astype(np.float64)

groupdata: GroupData = {
"classes": agb_classes_field,
Expand All @@ -122,7 +122,7 @@ def _make_agb_field_classification_dict() -> dict[str, GroupData]:
def _assign_dists(
bowstyle: str,
age: cls_funcs.AGBAgeData,
) -> list[int]:
) -> tuple[npt.NDArray[np.int64], int]:
"""
Assign appropriate minimum distance required for a category and classification.
Expand Down Expand Up @@ -162,7 +162,7 @@ def _assign_dists(

n_classes: int = 9 # [EMB, GMB, MB, B1, B2, B3, A1, A2, A3]

min_dists = np.empty(n_classes)
min_dists = np.zeros(n_classes, dtype=np.int64)
min_dists[0:6] = min_d
min_dists[6:9] = np.maximum(min_d - 10 * np.arange(1, 4), 30)

Expand Down
2 changes: 1 addition & 1 deletion archeryutils/classifications/agb_indoor_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _make_agb_indoor_classification_dict() -> dict[str, GroupData]:
bowstyle["datum_in"]
+ delta_hc_age_gender
+ (np.arange(len(agb_classes_in)) - 1) * bowstyle["classStep_in"]
)
).astype(np.float64)

groupdata: GroupData = {
"classes": agb_classes_in,
Expand Down
6 changes: 3 additions & 3 deletions archeryutils/classifications/agb_outdoor_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GroupData(TypedDict):
max_distance: list[int]
classes_long: list[str]
class_HC: npt.NDArray[np.float64]
min_dists: npt.NDArray[np.float64]
min_dists: npt.NDArray[np.int64]
prestige_rounds: list[str]


Expand Down Expand Up @@ -103,7 +103,7 @@ def _make_agb_outdoor_classification_dict() -> dict[str, GroupData]:
bowstyle["datum_out"]
+ delta_hc_age_gender
+ (np.arange(len(agb_classes_out)) - 2) * bowstyle["classStep_out"]
)
).astype(np.float64)

# get minimum distances to be shot for all classifications in the category
min_dists = _assign_min_dist(
Expand Down Expand Up @@ -136,7 +136,7 @@ def _assign_min_dist(
gender: str,
age_group: str,
max_dists: list[int],
) -> npt.NDArray[int]:
) -> npt.NDArray[np.int64]:
"""
Assign appropriate minimum distance required for a category and classification.
Expand Down

0 comments on commit b195f5e

Please sign in to comment.