From 2ef68915d115375798819957593662acfbd8a10f Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sun, 20 Oct 2024 22:55:59 -0500 Subject: [PATCH] Add Montreal to franchise list Fix precision bug in mround --- creation_helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/creation_helpers.py b/creation_helpers.py index d1102ed..72c55ec 100644 --- a/creation_helpers.py +++ b/creation_helpers.py @@ -435,6 +435,7 @@ CLUB_LIST = { 'MIA': 'Miami Marlins', 'MIL': 'Milwaukee Brewers', 'MIN': 'Minnesota Twins', + 'MON': 'Montreal Expos', 'NYM': 'New York Mets', 'NYY': 'New York Yankees', 'OAK': 'Oakland Athletics', @@ -464,14 +465,15 @@ FRANCHISE_LIST = { 'CLE': 'Cleveland Guardians', 'COL': 'Colorado Rockies', 'DET': 'Detroit Tigers', + 'FLA': 'Miami Marlins', 'HOU': 'Houston Astros', 'KCR': 'Kansas City Royals', 'LAA': 'Los Angeles Angels', 'LAD': 'Los Angeles Dodgers', - 'FLA': 'Miami Marlins', 'MIA': 'Miami Marlins', 'MIL': 'Milwaukee Brewers', 'MIN': 'Minnesota Twins', + 'MON': 'Washington Nationals', 'NYM': 'New York Mets', 'NYY': 'New York Yankees', 'OAK': 'Oakland Athletics', @@ -570,7 +572,7 @@ def get_pitching_peripherals(season: int): def mround(x, prec=2, base=.05): - return float(round(Decimal(str(x)) / Decimal(str(base))) * Decimal(str(base))) + return float(round(Decimal(str(x)) / Decimal(str(base)) * Decimal(str(base)), prec)) # return round(base * round(float(x) / base), prec)