From e8005b6c16a7d3125fe941da6b9f81e03766f573 Mon Sep 17 00:00:00 2001 From: Steve C Date: Sat, 24 Feb 2024 16:59:15 -0500 Subject: [PATCH] formatting! --- neofoodclub/__init__.py | 3 +-- neofoodclub/arenas.py | 4 ++-- neofoodclub/bets.py | 16 ++++++++------- neofoodclub/chance.py | 1 + neofoodclub/modifier.py | 9 +++++---- neofoodclub/neofoodclub.pyi | 14 +++++++++++-- neofoodclub/nfc.py | 39 ++++++++++++++++++++++++------------- neofoodclub/odds.py | 5 +++-- neofoodclub/odds_change.py | 4 ++-- neofoodclub/pirates.py | 2 ++ setup.py | 2 +- tests/test_bet_functions.py | 20 +++++++++---------- tests/test_bets_gambit.py | 2 +- tests/test_bets_tenbet.py | 2 +- tests/test_math.py | 2 +- tests/test_modifiers.py | 2 +- tests/test_neofoodclub.py | 2 +- tests/test_utils.py | 6 +++--- 18 files changed, 81 insertions(+), 54 deletions(-) diff --git a/neofoodclub/__init__.py b/neofoodclub/__init__.py index 2f3e894..8795e9f 100644 --- a/neofoodclub/__init__.py +++ b/neofoodclub/__init__.py @@ -4,14 +4,13 @@ __copyright__ = "Copyright 2021-present diceroll123" __version__ = "0.0.1a" -from .neofoodclub import * - from .arenas import * from .bets import * from .chance import * from .errors import * from .models import * from .modifier import * +from .neofoodclub import * from .nfc import * from .odds import * from .odds_change import * diff --git a/neofoodclub/arenas.py b/neofoodclub/arenas.py index 8004b79..3db92c0 100644 --- a/neofoodclub/arenas.py +++ b/neofoodclub/arenas.py @@ -32,7 +32,7 @@ class Arena: ) def __init__( - self, *, nfc: NeoFoodClub, arena_id: int, pirate_ids: Sequence[int] + self, *, nfc: NeoFoodClub, arena_id: int, pirate_ids: Sequence[int], ) -> None: self.nfc: NeoFoodClub = nfc self._id = arena_id @@ -130,7 +130,7 @@ def get_pirate_by_id(self, pirate_id: int, /) -> Pirate: if p.id == pirate_id: return p raise ValueError( - f"Could not find pirate with ID {pirate_id}. Only 1 through 20 are valid." + f"Could not find pirate with ID {pirate_id}. Only 1 through 20 are valid.", ) def get_pirates_by_id(self, *pirate_ids: int) -> tuple[Pirate, ...]: diff --git a/neofoodclub/bets.py b/neofoodclub/bets.py index 525cb64..870f7f8 100644 --- a/neofoodclub/bets.py +++ b/neofoodclub/bets.py @@ -55,7 +55,7 @@ def net_expected(self) -> float: if np.all(self.bet_amounts > -1000): return np.sum( self.bet_amounts * self.nfc._data_dict["ers"][self._indices] - - self.bet_amounts + - self.bet_amounts, ) return 0.0 @@ -87,11 +87,11 @@ def bet_amounts(self) -> npt.NDArray[np.int32]: @bet_amounts.setter def bet_amounts( - self, val: Sequence[int | None] | npt.NDArray[np.int32] | None + self, val: Sequence[int | None] | npt.NDArray[np.int32] | None, ) -> None: if val is None: self._bet_amounts: npt.NDArray[np.int32] = np.array( - [-1000] * self._indices.size + [-1000] * self._indices.size, ) return @@ -102,7 +102,7 @@ def bet_amounts( # strictly enforcing amount of values provided if len(val) != self._indices.size: raise InvalidData( - f"Invalid bet amounts provided. Expected length: {self._indices.size}, but received {len(val)}." + f"Invalid bet amounts provided. Expected length: {self._indices.size}, but received {len(val)}.", ) amts: npt.NDArray[np.int32] = np.array([v or Math.BET_AMOUNT_MIN for v in val]) @@ -144,7 +144,7 @@ def __repr__(self) -> str: @classmethod def _from_generator( - cls, *, indices: npt.NDArray[np.int16], nfc: NeoFoodClub + cls, *, indices: npt.NDArray[np.int16], nfc: NeoFoodClub, ) -> Bets: # here is where we will take indices and sort as needed # to avoid confusion with "manually" making bets @@ -160,6 +160,7 @@ def from_binary(cls, *bins: int, nfc: NeoFoodClub) -> Bets: ------ ~neofoodclub.InvalidData Invalid binaries were passed. + """ np_bins = np.array(bins) # duplicate bins are removed here @@ -171,13 +172,13 @@ def from_binary(cls, *bins: int, nfc: NeoFoodClub) -> Bets: if intersection.size == 0: raise InvalidData( - "Bets class requires at least one valid bet binary integer." + "Bets class requires at least one valid bet binary integer.", ) if intersection.size != np_bins.size: diff = np.setxor1d(np_bins, intersection) raise InvalidData( - f"Invalid bet binaries entered: {', '.join([hex(b) for b in diff])}" + f"Invalid bet binaries entered: {', '.join([hex(b) for b in diff])}", ) return cls(nfc=nfc, indices=intersection) @@ -254,6 +255,7 @@ def make_url( include_domain: :class:`bool` Whether or not you want the output URL to include the preferred neofoodclub website's domain. Default = True. + """ return self.nfc.make_url(self, all_data=all_data, include_domain=include_domain) diff --git a/neofoodclub/chance.py b/neofoodclub/chance.py index 9a300ea..5f81c5a 100644 --- a/neofoodclub/chance.py +++ b/neofoodclub/chance.py @@ -17,6 +17,7 @@ class Chance: The sum of the probabilities per Chance where `value` <= this Chance's `value`. tail: :class:`float` The difference of the sum of the probabilities per Chance where `value` < this Chance's `value`, from 1. + """ value: int diff --git a/neofoodclub/modifier.py b/neofoodclub/modifier.py index 1bced19..68fc7a5 100644 --- a/neofoodclub/modifier.py +++ b/neofoodclub/modifier.py @@ -40,6 +40,7 @@ class Modifier: This flag value flips the algorithms upside-down, essentially giving you the Min TER bets instead of Max TER. ALL_MODIFIERS: :class:`int` This value is all of the other flag values, bitwise-or'd together. Only use this if you want true chaos. + """ __slots__ = ( @@ -103,7 +104,7 @@ def time(self) -> datetime.time | None: def time(self, val: datetime.time) -> None: if not isinstance(val, datetime.time): raise TypeError( - f"Expected datetime.time but received {val.__class__.__name__}" + f"Expected datetime.time but received {val.__class__.__name__}", ) self._time = val if self._nfc: @@ -133,18 +134,18 @@ def custom_odds(self) -> dict[int, int]: def custom_odds(self, val: dict[int, int]) -> None: if not isinstance(val, dict): raise TypeError( - f"Expected Dict[int, int] but received {val.__class__.__name__}" + f"Expected Dict[int, int] but received {val.__class__.__name__}", ) for k, v in val.items(): if k not in range(1, 21): raise ValueError( - f"Expected int between 1 and 20 for Pirate ID but received {k}" + f"Expected int between 1 and 20 for Pirate ID but received {k}", ) if v not in range(2, 14): raise ValueError( - f"Expected int between 2 and 13 for Pirate Odds but received {v}" + f"Expected int between 2 and 13 for Pirate Odds but received {v}", ) self._custom_odds = val diff --git a/neofoodclub/neofoodclub.pyi b/neofoodclub/neofoodclub.pyi index 8cf936e..9b36a4e 100644 --- a/neofoodclub/neofoodclub.pyi +++ b/neofoodclub/neofoodclub.pyi @@ -14,7 +14,7 @@ def make_probabilities( ) -> list[list[float]]: ... @staticmethod def make_round_dicts( - stds: Sequence[Sequence[float]], odds: tuple[tuple[int, ...], ...] + stds: Sequence[Sequence[float]], odds: tuple[tuple[int, ...], ...], ) -> tuple[ npt.NDArray[np.int_], npt.NDArray[np.float64], @@ -38,6 +38,7 @@ class Math: The index of the pirate in the arena. Can be 0 to 4. If 0, then there is no pirate. arena: :class:`int` The arena's index. Can be 0 to 4. + """ @staticmethod @@ -52,6 +53,7 @@ class Math: ---------- bets_indices: Sequence[:class:`int`] A sequence of integers from 0 to 4 to represent a bet. + """ @staticmethod @@ -62,6 +64,7 @@ class Math: ---------- bet_binary: :class:`int` An integer representing a bet. + """ @staticmethod @@ -72,6 +75,7 @@ class Math: ---------- bets_hash: :class:`str` The hash of bet amounts. + """ @staticmethod @@ -82,11 +86,12 @@ class Math: ---------- bets_hash: :class:`str` The hash of bet amounts. + """ @staticmethod def bets_indices_to_bet_binaries( - bets_indices: Sequence[Sequence[int]], / + bets_indices: Sequence[Sequence[int]], /, ) -> tuple[int, ...]: """Tuple[:class:`int`, ...]: Returns the bet-binary representations of the bets indices provided. @@ -94,6 +99,7 @@ class Math: ---------- bets_indices: Sequence[Sequence[:class:`int`]] A sequence of a sequence of integers from 0 to 4 to represent a bet. + """ @staticmethod @@ -104,6 +110,7 @@ class Math: ---------- bets_hash: :class:`str` The hash of bet amounts. + """ @staticmethod @@ -116,6 +123,7 @@ class Math: ---------- bet_amounts: Sequence[int] A sequence of bet amount integers. + """ @staticmethod @@ -126,6 +134,7 @@ class Math: ---------- bets_indices: Sequence[Sequence[:class:`int`]] A sequence of a sequence of integers from 0 to 4 to represent a bet. + """ @staticmethod @@ -136,6 +145,7 @@ class Math: ---------- amounts_hash: :class:`str` The hash of bet amounts. + """ @staticmethod def build_chance_objects( diff --git a/neofoodclub/nfc.py b/neofoodclub/nfc.py index 1eae7bf..04157a9 100644 --- a/neofoodclub/nfc.py +++ b/neofoodclub/nfc.py @@ -39,7 +39,7 @@ ) PIRATES_REGEX = re.compile(r"^\[((\[(\d+,){3}\d+\]),){4}(\[(\d+,){3}\d+\])\]$") ODDS_REGEX = re.compile( - r"^\[(\[1,(([2-9]|1[0-3]),){3}([2-9]|1[0-3])\],){4}\[1,(([2-9]|1[0-3]),){3}([2-9]|1[0-3])\]\]$" + r"^\[(\[1,(([2-9]|1[0-3]),){3}([2-9]|1[0-3])\],){4}\[1,(([2-9]|1[0-3]),){3}([2-9]|1[0-3])\]\]$", ) WINNERS_REGEX = re.compile(r"^\[((([1-4],){4}[1-4])|(0,0,0,0,0))\]$") FOODS_REGEX = re.compile(r"^\[((\[(\d+,){9}\d+\]),){4}(\[(\d+,){9}\d+\])\]$") @@ -85,6 +85,7 @@ class NeoFoodClub: cache: :class:`bool` Whether or not to instantly calculate and cache the round's data. Turning this off is useful for when you're just analyzing data and not generating bets. + """ __slots__ = ( @@ -154,7 +155,7 @@ def soft_reset(self) -> None: if self._modifier.time and (dt := self._get_round_time(self._modifier.time)): # start custom odds from opening odds and add from there self._data["customOdds"] = orjson.loads( - orjson.dumps(self._data["openingOdds"]) + orjson.dumps(self._data["openingOdds"]), ) for change in self.changes: if change.timestamp < dt: @@ -265,6 +266,7 @@ def with_modifier(self, modifier: Modifier | None = None, /) -> Self: ---------- modifier: Optional[:class:`Modifier`] The modifier object you'd like to add to this NeoFoodClub object. + """ self.modifier = modifier return self @@ -276,6 +278,7 @@ def to_dict(self, *, keep_custom: bool = False) -> dict[str, Any]: ---------- keep_custom: :class:`bool` Whether or not you'd like to keep the customOdds data key. False by default. + """ # return a deep copy of this round's dict data = orjson.loads(orjson.dumps(self._data)) @@ -418,6 +421,7 @@ def get_win_units(self, bets: Bets, /) -> int: ---------- bets: :class:`Bets` The bets you'd like to find the amount of winning units for. + """ return self._get_winning_odds(bets).sum() @@ -430,6 +434,7 @@ def get_win_np(self, bets: Bets, /) -> int: ---------- bets: :class:`Bets` The bets you'd like to find the amount of winning neopoints for. + """ winning_bins_indices = self._get_winning_bet_indices(bets) @@ -471,8 +476,8 @@ def make_url( include_domain: :class:`bool` Whether or not you want the output URL to include the preferred neofoodclub website's domain. Default = True. - """ + """ use_15 = ( len(bets or []) and 10 < len(bets or []) <= 15 ) or self._modifier._cc_perk @@ -507,7 +512,7 @@ def encode(int_lists: Sequence[Any]) -> str: if self.timestamp: timestamp = self.timestamp.replace( - microsecond=0, tzinfo=datetime.timezone.utc + microsecond=0, tzinfo=datetime.timezone.utc, ).isoformat() params.append(("timestamp", timestamp)) @@ -545,6 +550,7 @@ def from_url( ------ ~neofoodclub.InvalidData The URL provided is invalid. + """ neo_fc = NEO_FC_REGEX.search(url) if neo_fc is None: @@ -612,7 +618,7 @@ def from_url( pirate_lists = orjson.loads(pirate_string) has_proper_ids = set(functools.reduce(operator.iadd, pirate_lists, [])) == set( - range(1, 21) + range(1, 21), ) if not has_proper_ids: raise InvalidData("NeoFoodClub URL parameter `pirates` is invalid.") @@ -686,7 +692,7 @@ def _max_ter_indices(self) -> np.ndarray: def make_max_ter_bets(self) -> Bets: """:class:`Bets`: Creates a Bets object that consists of the highest ERs.""" return Bets._from_generator( - indices=np.argsort(self._max_ter_indices()), nfc=self + indices=np.argsort(self._max_ter_indices()), nfc=self, ) @_require_cache @@ -717,7 +723,7 @@ def make_random_bets(self) -> Bets: @_require_cache def _gambit_indices( - self, *, five_bet: int | None = None, random: bool = False + self, *, five_bet: int | None = None, random: bool = False, ) -> np.ndarray: if five_bet is not None: bins = self._data_dict["bins"] @@ -778,13 +784,13 @@ def make_gambit_bets(self, *, random: bool = False) -> Bets: @_require_cache def make_gambit_bets( - self, *, five_bet: int | None = None, random: bool = False + self, *, five_bet: int | None = None, random: bool = False, ) -> Bets: """:class:`Bets`: Creates a Bets object that consists of the top-unit permutations of a single full-arena bet. """ return Bets._from_generator( - indices=self._gambit_indices(five_bet=five_bet, random=random), nfc=self + indices=self._gambit_indices(five_bet=five_bet, random=random), nfc=self, ) @_require_cache @@ -813,6 +819,7 @@ def make_tenbet_bets(self, pirate_binary: int, /) -> Bets: ------ ~neofoodclub.InvalidData The amount of selected pirates is not between 1 and 3. + """ amount_of_pirates = sum(bool(pirate_binary & mask) for mask in Math.BIT_MASKS) @@ -823,7 +830,7 @@ def make_tenbet_bets(self, pirate_binary: int, /) -> Bets: raise InvalidData("You must pick 3 pirates at most.") return Bets._from_generator( - indices=self._tenbet_indices(pirate_binary), nfc=self + indices=self._tenbet_indices(pirate_binary), nfc=self, ) @_require_cache @@ -852,6 +859,7 @@ def make_bustproof_bets(self) -> Bets: ------ ~neofoodclub.NoPositiveArenas There are no positive arenas, so a bustproof set can not be made. + """ arenas = self.arenas positives = arenas.positives @@ -918,19 +926,19 @@ def make_bets_from_indices(self, indices: Sequence[Sequence[int]], /) -> Bets: @overload def make_bets_from_indices( - self, indices: Sequence[Sequence[int]], /, *, amounts_hash: str | None + self, indices: Sequence[Sequence[int]], /, *, amounts_hash: str | None, ) -> Bets: ... @overload def make_bets_from_indices( - self, indices: Sequence[Sequence[int]], /, *, amounts: Sequence[int] + self, indices: Sequence[Sequence[int]], /, *, amounts: Sequence[int], ) -> Bets: ... @overload def make_bets_from_indices( - self, indices: Sequence[Sequence[int]], /, *, amount: int + self, indices: Sequence[Sequence[int]], /, *, amount: int, ) -> Bets: ... @@ -950,6 +958,7 @@ def make_bets_from_indices( ------ ~neofoodclub.InvalidAmountHash The amount hash contains invalid characters. + """ bets = Bets.from_binary(*Math.bets_indices_to_bet_binaries(indices), nfc=self) if amounts_hash: @@ -969,7 +978,7 @@ def make_bets_from_hash(self, bets_hash: str, /) -> Bets: @overload def make_bets_from_hash( - self, bets_hash: str, /, *, amounts_hash: str | None + self, bets_hash: str, /, *, amounts_hash: str | None, ) -> Bets: ... @@ -999,6 +1008,7 @@ def make_bets_from_hash( The bet hash contains invalid characters. ~neofoodclub.InvalidAmountHash The amount hash contains invalid characters. + """ if not BET_HASH_REGEX.fullmatch(bets_hash): raise InvalidBetHash @@ -1046,6 +1056,7 @@ def make_bets_from_binaries( ------ ~neofoodclub.InvalidAmountHash The amount hash contains invalid characters. + """ bets = Bets.from_binary(*binaries, nfc=self) if amounts_hash: diff --git a/neofoodclub/odds.py b/neofoodclub/odds.py index 9ede2ff..8f0ddfc 100644 --- a/neofoodclub/odds.py +++ b/neofoodclub/odds.py @@ -28,6 +28,7 @@ class Odds: The Chance object with the highest probability value. partial_rate: :class:`float` The sum of probabilities where you'd make a partial return. + """ __slots__ = ( @@ -42,7 +43,7 @@ class Odds: def __init__(self, bets: Bets) -> None: self._odds_values = bets.nfc._data_dict["odds"][bets._indices] self._odds = Math.build_chance_objects( - bets.indices, self._odds_values, bets.nfc._stds + bets.indices, self._odds_values, bets.nfc._stds, ) # highest odds @@ -52,7 +53,7 @@ def __init__(self, bets: Bets) -> None: self.bust: Chance | None = self._odds[0] if self._odds[0].value == 0 else None self.most_likely_winner: Chance = max( - self._odds[1 if self.bust else 0 :], key=lambda o: o.probability + self._odds[1 if self.bust else 0 :], key=lambda o: o.probability, ) amount_of_bets = max(0, min(len(bets), 15)) diff --git a/neofoodclub/odds_change.py b/neofoodclub/odds_change.py index b20581f..3e4d3e4 100644 --- a/neofoodclub/odds_change.py +++ b/neofoodclub/odds_change.py @@ -28,7 +28,7 @@ class OddsChange: ) def __init__( - self, *, index: int, data: OddsChangeDict, round_data: dict[str, Any] + self, *, index: int, data: OddsChangeDict, round_data: dict[str, Any], ) -> None: self._index = index self._data = data # to check against each other @@ -73,7 +73,7 @@ def pirate_index(self) -> int: def pirate(self) -> PartialPirate: """:class:`PartialPirate`: Returns a partial pirate object, which is a convenience object storing the pirate's ID.""" return PartialPirate( - self._round_data["pirates"][self.arena_index][self.pirate_index - 1] + self._round_data["pirates"][self.arena_index][self.pirate_index - 1], ) @property diff --git a/neofoodclub/pirates.py b/neofoodclub/pirates.py index dc9c4a4..99ad29d 100644 --- a/neofoodclub/pirates.py +++ b/neofoodclub/pirates.py @@ -65,6 +65,7 @@ class PartialPirate(PirateMixin): The pirate's name. image: :class:`str` The pirates image. + """ def __init__(self, _id: int) -> None: @@ -87,6 +88,7 @@ class Pirate(PirateMixin): The pirate's name. image: :class:`str` The pirates image. + """ __slots__ = ( diff --git a/setup.py b/setup.py index 7527d2a..2ff6328 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ version = "" with open("neofoodclub/__init__.py") as f: version = re.search( - r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE + r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE, ) if not version: diff --git a/tests/test_bet_functions.py b/tests/test_bet_functions.py index 2cd1537..6a3a9df 100644 --- a/tests/test_bet_functions.py +++ b/tests/test_bet_functions.py @@ -91,7 +91,7 @@ def test_bet_equivalence_with_amount( nfc: NeoFoodClub, ) -> None: mer_from_hash = nfc.make_bets_from_hash( - "eukucjuoycaulucepkyrtukyw", amounts_hash="CXSCXSCXSCXSCXSCXSCXSCXSCXSCXS" + "eukucjuoycaulucepkyrtukyw", amounts_hash="CXSCXSCXSCXSCXSCXSCXSCXSCXSCXS", ) mer_from_indices = nfc.make_bets_from_indices( ( @@ -125,7 +125,7 @@ def test_bet_equivalence_with_amount( ) mer_control = nfc.make_bets_from_hash( - "eukucjuoycaulucepkyrtukyw", amounts=[8000] * 10 + "eukucjuoycaulucepkyrtukyw", amounts=[8000] * 10, ) mer_control_two = nfc.make_bets_from_hash("eukucjuoycaulucepkyrtukyw", amount=8000) @@ -141,13 +141,13 @@ def test_bet_hash_encoding(nfc: NeoFoodClub, crazy_test_hash: str) -> None: def test_bet_indices_encoding( - nfc: NeoFoodClub, crazy_test_indices: Tuple[Tuple[int, ...], ...] + nfc: NeoFoodClub, crazy_test_indices: Tuple[Tuple[int, ...], ...], ) -> None: assert nfc.make_bets_from_indices(crazy_test_indices).indices == crazy_test_indices def test_bet_indices_with_amount( - nfc: NeoFoodClub, crazy_test_indices: Tuple[Tuple[int, ...], ...] + nfc: NeoFoodClub, crazy_test_indices: Tuple[Tuple[int, ...], ...], ) -> None: assert ( nfc.make_bets_from_indices(crazy_test_indices, amount=8000).indices @@ -156,7 +156,7 @@ def test_bet_indices_with_amount( def test_bet_binaries_encoding( - nfc: NeoFoodClub, crazy_test_binaries: Tuple[int, ...] + nfc: NeoFoodClub, crazy_test_binaries: Tuple[int, ...], ) -> None: assert ( tuple(nfc.make_bets_from_binaries(*crazy_test_binaries)) == crazy_test_binaries @@ -164,7 +164,7 @@ def test_bet_binaries_encoding( def test_bet_binaries_with_amount( - nfc: NeoFoodClub, crazy_test_binaries: Tuple[int, ...] + nfc: NeoFoodClub, crazy_test_binaries: Tuple[int, ...], ) -> None: assert ( tuple(nfc.make_bets_from_binaries(*crazy_test_binaries, amount=8000)) @@ -181,7 +181,7 @@ def test_expected_ratio_equality(crazy_bets: Bets) -> None: def test_net_expected_equality_with_amount( - nfc_with_bet_amount: NeoFoodClub, crazy_test_hash: str + nfc_with_bet_amount: NeoFoodClub, crazy_test_hash: str, ) -> None: # There's a discrepancy between what the website says vs what this says. # When it comes to expected ratio and net expected, the inconsistent @@ -199,7 +199,7 @@ def test_net_expected_equality_with_amount( ], ) def test_bets_from_binary_error( - nfc: NeoFoodClub, bet_binaries: Tuple[int, ...] + nfc: NeoFoodClub, bet_binaries: Tuple[int, ...], ) -> None: with pytest.raises(InvalidData): Bets.from_binary(*bet_binaries, nfc=nfc) @@ -336,7 +336,7 @@ def test_bet_get_win_np(nfc: NeoFoodClub) -> None: ], ) def test_indices_to_bet_hash( - bet_hash: str, bet_indices: Sequence[Sequence[int]] + bet_hash: str, bet_indices: Sequence[Sequence[int]], ) -> None: assert Math.bets_hash_value(bet_indices) == bet_hash @@ -345,7 +345,7 @@ def test_bet_with_trailing_none_in_amounts( nfc: NeoFoodClub, ) -> None: nine_bets = nfc.make_bets_from_hash( - "abaakaebapkddapudaaqkbaaa", amounts_hash="EmxCoKCoKCglDKUCYqEXkByWBpqzGO" + "abaakaebapkddapudaaqkbaaa", amounts_hash="EmxCoKCoKCglDKUCYqEXkByWBpqzGO", ) assert len(nine_bets) == 9 assert len(nine_bets.bet_amounts) == 9 diff --git a/tests/test_bets_gambit.py b/tests/test_bets_gambit.py index 5755959..1c1add3 100644 --- a/tests/test_bets_gambit.py +++ b/tests/test_bets_gambit.py @@ -49,7 +49,7 @@ def test_random_gambit_bets(nfc: NeoFoodClub) -> None: ], ) def test_gambit_bets_equivalence( - nfc: NeoFoodClub, five_bet: int, bets_hash: str + nfc: NeoFoodClub, five_bet: int, bets_hash: str, ) -> None: bets = nfc.make_gambit_bets(five_bet=five_bet) assert bets.bets_hash == bets_hash diff --git a/tests/test_bets_tenbet.py b/tests/test_bets_tenbet.py index b1ac51c..106687e 100644 --- a/tests/test_bets_tenbet.py +++ b/tests/test_bets_tenbet.py @@ -14,7 +14,7 @@ def test_tenbet_generation_three_pirates(nfc: NeoFoodClub, pirate_binary: int) - @pytest.mark.parametrize("pirate_binary", [0x0, 0x8888, 0x88888]) def test_tenbet_generation_zero_and_five_pirates( - nfc: NeoFoodClub, pirate_binary: int + nfc: NeoFoodClub, pirate_binary: int, ) -> None: with pytest.raises(InvalidData): nfc.make_tenbet_bets(pirate_binary) diff --git a/tests/test_math.py b/tests/test_math.py index 7d89d39..4e8522f 100644 --- a/tests/test_math.py +++ b/tests/test_math.py @@ -91,7 +91,7 @@ def test_make_probabilities() -> None: (1, 11, 13, 2, 2), (1, 2, 13, 13, 11), (1, 5, 11, 7, 2), - ) + ), ) assert len(probs) == 5 diff --git a/tests/test_modifiers.py b/tests/test_modifiers.py index 4e1f32e..7b0b004 100644 --- a/tests/test_modifiers.py +++ b/tests/test_modifiers.py @@ -161,7 +161,7 @@ def test_modifier_time_rollback_changes(nfc: NeoFoodClub) -> None: def test_modifier_time_rollforward_changes(nfc: NeoFoodClub) -> None: new_nfc = nfc.copy() new_nfc.modifier = Modifier( - custom_time=datetime.time(hour=23, minute=47, second=20) + custom_time=datetime.time(hour=23, minute=47, second=20), ) assert new_nfc.custom_odds == new_nfc.current_odds diff --git a/tests/test_neofoodclub.py b/tests/test_neofoodclub.py index 8807a94..0d0f1e3 100644 --- a/tests/test_neofoodclub.py +++ b/tests/test_neofoodclub.py @@ -122,7 +122,7 @@ def test_cc_perk(nfc: NeoFoodClub, nfc_from_url: NeoFoodClub) -> None: ], ) def test_get_win_units( - nfc: NeoFoodClub, nfc_from_url: NeoFoodClub, bet_hash: str, winnings: int + nfc: NeoFoodClub, nfc_from_url: NeoFoodClub, bet_hash: str, winnings: int, ) -> None: bets = nfc.make_bets_from_hash(bet_hash) assert nfc.get_win_units(bets) == winnings diff --git a/tests/test_utils.py b/tests/test_utils.py index 6dc245c..791d866 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -84,7 +84,7 @@ def test_bets_stats_table_with_net_expected(nfc: NeoFoodClub) -> None: def test_dst_offset_fall_back() -> None: # starting at America/New_York because I live there and I hate timezone math offset = utils.get_dst_offset( - datetime.datetime(2023, 11, 5, 8, 0, 0, 0, tzinfo=tz.gettz("America/New_York")) + datetime.datetime(2023, 11, 5, 8, 0, 0, 0, tzinfo=tz.gettz("America/New_York")), ) assert offset == datetime.timedelta(hours=-1) @@ -92,7 +92,7 @@ def test_dst_offset_fall_back() -> None: def test_dst_offset_spring_forward() -> None: # starting at America/New_York because I live there and I hate timezone math offset = utils.get_dst_offset( - datetime.datetime(2024, 3, 10, 8, 0, 0, 0, tzinfo=tz.gettz("America/New_York")) + datetime.datetime(2024, 3, 10, 8, 0, 0, 0, tzinfo=tz.gettz("America/New_York")), ) assert offset == datetime.timedelta(hours=1) @@ -100,6 +100,6 @@ def test_dst_offset_spring_forward() -> None: def test_dst_offset_no_dst() -> None: # starting at America/New_York because I live there and I hate timezone math offset = utils.get_dst_offset( - datetime.datetime(2024, 1, 1, 8, 0, 0, 0, tzinfo=tz.gettz("America/New_York")) + datetime.datetime(2024, 1, 1, 8, 0, 0, 0, tzinfo=tz.gettz("America/New_York")), ) assert offset == datetime.timedelta(hours=0)