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

Update formatting to satisfy latest checks. #106

Merged
merged 2 commits into from
Dec 15, 2024
Merged
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
6 changes: 3 additions & 3 deletions archeryutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from archeryutils.utils import versions

__all__ = [
"classifications",
"handicaps",
"Pass",
"Round",
"Quantity",
"Round",
"Target",
"classifications",
"handicaps",
"versions",
]
10 changes: 5 additions & 5 deletions archeryutils/classifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
)

__all__ = [
"calculate_agb_outdoor_classification",
"agb_outdoor_classification_scores",
"calculate_agb_indoor_classification",
"agb_field_classification_scores",
"agb_indoor_classification_scores",
"calculate_agb_old_indoor_classification",
"agb_old_indoor_classification_scores",
"agb_field_classification_scores",
"agb_outdoor_classification_scores",
"calculate_agb_field_classification",
"calculate_agb_indoor_classification",
"calculate_agb_old_indoor_classification",
"calculate_agb_outdoor_classification",
"calculate_old_agb_field_classification",
"old_agb_field_classification_scores",
]
6 changes: 3 additions & 3 deletions archeryutils/classifications/agb_old_field_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ def calculate_old_agb_field_classification(
class_scores = dict(
zip(group_data["classes"], group_data["class_scores"], strict=True)
)
for item in class_scores:
if class_scores[item] > score:
for classification, classification_score in class_scores.items():
if classification_score > score:
continue
else:
return item
return classification

# if lower than 3rd class score return "UC"
return "unclassified"
Expand Down
14 changes: 7 additions & 7 deletions archeryutils/handicaps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

__all__ = [
"FloatArray",
"HandicapAA",
"HandicapAA2",
"HandicapAGB",
"HandicapAGBold",
"HandicapScheme",
"HandicapTable",
"handicap_scheme",
"arrow_score",
"handicap_from_score",
"handicap_scheme",
"score_for_passes",
"score_for_round",
"handicap_from_score",
"HandicapScheme",
"HandicapAGB",
"HandicapAGBold",
"HandicapAA",
"HandicapAA2",
]
6 changes: 4 additions & 2 deletions archeryutils/handicaps/handicap_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import itertools as itr
import warnings
from abc import ABC, abstractmethod
from typing import Optional, TypeVar, Union, overload
from typing import Optional, TypeVar, Union, cast, overload

import numpy as np
import numpy.typing as npt
Expand Down Expand Up @@ -161,7 +161,9 @@ def sigma_r(self, handicap: FloatArray, dist: float) -> FloatArray:
"""
sig_t = self.sigma_t(handicap, dist)
sig_r = dist * sig_t
return sig_r

# Perform a cast to return to satisfy typechecker
return cast(FloatArray, sig_r)

def arrow_score(
self,
Expand Down
2 changes: 1 addition & 1 deletion archeryutils/handicaps/handicap_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def _clean_repeated(
self.table = np.flip(self.table, axis=0)

for irow, row in enumerate(self.table[:-1, :]):
for jscore in range(len(row)):
for jscore in range(len(np.asarray(row))):
if self.table[irow, jscore] == self.table[irow + 1, jscore]:
if self.int_prec:
self.table[irow, jscore] = _FILL
Expand Down
2 changes: 1 addition & 1 deletion archeryutils/length.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from collections.abc import Collection, Set
from typing import TypeVar, Union

__all__ = [
__all__ = [ # noqa: RUF022 - Non-alphabetical sort is more logical here
"yard",
"metre",
"inch",
Expand Down
Loading