Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,9 +36,13 @@ offense_format = {'8+ For': '{:.2%}', '8+ For L5': '{:.2%}', '8+ For L10': '{:.2
|
|
| 36 |
defense_format = {'8+ Allowed': '{:.2%}', '8+ Allowed L5': '{:.2%}', '8+ Allowed L10': '{:.2%}', 'Trending 8+ Allowed': '{:.2%}'}
|
| 37 |
R2_format = {'R2_to_Opp_szn': '{:.2%}', 'R2_to_Opp_sample': '{:.2%}', 'R2_to_Opp L5': '{:.2%}', 'R2_to_Opp L10': '{:.2%}', 'R2_to_Opp_Trend': '{:.2%}'}
|
| 38 |
|
|
|
|
| 39 |
data_hold = 'https://docs.google.com/spreadsheets/d/1f42Ergav8K1VsOLOK9MUn7DM_MLMvv4GR2Fy7EfnZTc/edit#gid=500994479'
|
| 40 |
|
| 41 |
-
@st.
|
|
|
|
|
|
|
|
|
|
| 42 |
def load_time():
|
| 43 |
sh = gc.open_by_url(data_hold)
|
| 44 |
worksheet = sh.worksheet('Timestamp')
|
|
@@ -48,7 +52,7 @@ def load_time():
|
|
| 48 |
|
| 49 |
return t_stamp
|
| 50 |
|
| 51 |
-
@st.
|
| 52 |
def load_table(URL, specific_tab):
|
| 53 |
sh = gc.open_by_url(URL)
|
| 54 |
worksheet = sh.worksheet(specific_tab)
|
|
@@ -56,7 +60,7 @@ def load_table(URL, specific_tab):
|
|
| 56 |
|
| 57 |
return load_display
|
| 58 |
|
| 59 |
-
@st.
|
| 60 |
def True_AVG_Splits_load():
|
| 61 |
|
| 62 |
sh = gc.open_by_url(data_hold)
|
|
@@ -68,7 +72,7 @@ def True_AVG_Splits_load():
|
|
| 68 |
|
| 69 |
return pitcher_stats
|
| 70 |
|
| 71 |
-
@st.
|
| 72 |
def HWSr_Splits_load():
|
| 73 |
|
| 74 |
sh = gc.open_by_url(data_hold)
|
|
@@ -80,7 +84,7 @@ def HWSr_Splits_load():
|
|
| 80 |
|
| 81 |
return pitcher_stats
|
| 82 |
|
| 83 |
-
@st.
|
| 84 |
def SP_Slate_Stats_load():
|
| 85 |
|
| 86 |
sh = gc.open_by_url(data_hold)
|
|
@@ -92,7 +96,7 @@ def SP_Slate_Stats_load():
|
|
| 92 |
|
| 93 |
return pitcher_stats
|
| 94 |
|
| 95 |
-
@st.
|
| 96 |
def RHH_load():
|
| 97 |
|
| 98 |
sh = gc.open_by_url(data_hold)
|
|
@@ -105,7 +109,7 @@ def RHH_load():
|
|
| 105 |
|
| 106 |
return pitcher_stats
|
| 107 |
|
| 108 |
-
@st.
|
| 109 |
def LHH_load():
|
| 110 |
|
| 111 |
sh = gc.open_by_url(data_hold)
|
|
@@ -118,7 +122,7 @@ def LHH_load():
|
|
| 118 |
|
| 119 |
return pitcher_stats
|
| 120 |
|
| 121 |
-
@st.
|
| 122 |
def Full_Stats_load():
|
| 123 |
|
| 124 |
sh = gc.open_by_url(data_hold)
|
|
@@ -132,7 +136,7 @@ def Full_Stats_load():
|
|
| 132 |
|
| 133 |
return pitcher_stats
|
| 134 |
|
| 135 |
-
@st.
|
| 136 |
def Full_RHH_load():
|
| 137 |
|
| 138 |
sh = gc.open_by_url(data_hold)
|
|
@@ -146,7 +150,7 @@ def Full_RHH_load():
|
|
| 146 |
|
| 147 |
return pitcher_stats
|
| 148 |
|
| 149 |
-
@st.
|
| 150 |
def Full_LHH_load():
|
| 151 |
|
| 152 |
sh = gc.open_by_url(data_hold)
|
|
@@ -160,7 +164,7 @@ def Full_LHH_load():
|
|
| 160 |
|
| 161 |
return pitcher_stats
|
| 162 |
|
| 163 |
-
@st.
|
| 164 |
def Bullpen_Data_load():
|
| 165 |
|
| 166 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 36 |
defense_format = {'8+ Allowed': '{:.2%}', '8+ Allowed L5': '{:.2%}', '8+ Allowed L10': '{:.2%}', 'Trending 8+ Allowed': '{:.2%}'}
|
| 37 |
R2_format = {'R2_to_Opp_szn': '{:.2%}', 'R2_to_Opp_sample': '{:.2%}', 'R2_to_Opp L5': '{:.2%}', 'R2_to_Opp L10': '{:.2%}', 'R2_to_Opp_Trend': '{:.2%}'}
|
| 38 |
|
| 39 |
+
@st.cache_resource
|
| 40 |
data_hold = 'https://docs.google.com/spreadsheets/d/1f42Ergav8K1VsOLOK9MUn7DM_MLMvv4GR2Fy7EfnZTc/edit#gid=500994479'
|
| 41 |
|
| 42 |
+
@st.cache_resource
|
| 43 |
+
sh = gc.open_by_url(data_hold)
|
| 44 |
+
|
| 45 |
+
@st.cache_resource(ttl = 299)
|
| 46 |
def load_time():
|
| 47 |
sh = gc.open_by_url(data_hold)
|
| 48 |
worksheet = sh.worksheet('Timestamp')
|
|
|
|
| 52 |
|
| 53 |
return t_stamp
|
| 54 |
|
| 55 |
+
@st.cache_resource(ttl = 299)
|
| 56 |
def load_table(URL, specific_tab):
|
| 57 |
sh = gc.open_by_url(URL)
|
| 58 |
worksheet = sh.worksheet(specific_tab)
|
|
|
|
| 60 |
|
| 61 |
return load_display
|
| 62 |
|
| 63 |
+
@st.cache_resource(ttl = 299)
|
| 64 |
def True_AVG_Splits_load():
|
| 65 |
|
| 66 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 72 |
|
| 73 |
return pitcher_stats
|
| 74 |
|
| 75 |
+
@st.cache_resource(ttl = 299)
|
| 76 |
def HWSr_Splits_load():
|
| 77 |
|
| 78 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 84 |
|
| 85 |
return pitcher_stats
|
| 86 |
|
| 87 |
+
@st.cache_resource(ttl = 299)
|
| 88 |
def SP_Slate_Stats_load():
|
| 89 |
|
| 90 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 96 |
|
| 97 |
return pitcher_stats
|
| 98 |
|
| 99 |
+
@st.cache_resource(ttl = 299)
|
| 100 |
def RHH_load():
|
| 101 |
|
| 102 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 109 |
|
| 110 |
return pitcher_stats
|
| 111 |
|
| 112 |
+
@st.cache_resource(ttl = 299)
|
| 113 |
def LHH_load():
|
| 114 |
|
| 115 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 122 |
|
| 123 |
return pitcher_stats
|
| 124 |
|
| 125 |
+
@st.cache_resource(ttl = 299)
|
| 126 |
def Full_Stats_load():
|
| 127 |
|
| 128 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 136 |
|
| 137 |
return pitcher_stats
|
| 138 |
|
| 139 |
+
@st.cache_resource(ttl = 299)
|
| 140 |
def Full_RHH_load():
|
| 141 |
|
| 142 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 150 |
|
| 151 |
return pitcher_stats
|
| 152 |
|
| 153 |
+
@st.cache_resource(ttl = 299)
|
| 154 |
def Full_LHH_load():
|
| 155 |
|
| 156 |
sh = gc.open_by_url(data_hold)
|
|
|
|
| 164 |
|
| 165 |
return pitcher_stats
|
| 166 |
|
| 167 |
+
@st.cache_resource(ttl = 299)
|
| 168 |
def Bullpen_Data_load():
|
| 169 |
|
| 170 |
sh = gc.open_by_url(data_hold)
|