Update app.py
Browse files
app.py
CHANGED
|
@@ -715,6 +715,12 @@ def server(input, output, session):
|
|
| 715 |
# Use modified data if available
|
| 716 |
if modified_data() is not None:
|
| 717 |
df = pl.from_pandas(modified_data())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 718 |
else:
|
| 719 |
# Get input parameters
|
| 720 |
p.set(0.3, "Gathering data...")
|
|
@@ -753,14 +759,18 @@ def server(input, output, session):
|
|
| 753 |
prop_percent=(pl.col('is_pitch') / pl.col('is_pitch').sum()).over("pitch_type"),
|
| 754 |
prop=pl.col('is_pitch').sum().over("pitch_type")
|
| 755 |
)
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
except TypeError:
|
| 759 |
-
print("NONE")
|
| 760 |
if df is None:
|
| 761 |
fig = plt.figure(figsize=(10, 10))
|
| 762 |
fig.text(x=0.1, y=0.9, s='No Statcast Data For This Pitcher', fontsize=24, ha='left')
|
| 763 |
return fig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 764 |
# return None
|
| 765 |
|
| 766 |
if df is None:
|
|
|
|
| 715 |
# Use modified data if available
|
| 716 |
if modified_data() is not None:
|
| 717 |
df = pl.from_pandas(modified_data())
|
| 718 |
+
|
| 719 |
+
if df is None:
|
| 720 |
+
fig = plt.figure(figsize=(10, 10))
|
| 721 |
+
fig.text(x=0.1, y=0.9, s='No Statcast Data For This Pitcher', fontsize=24, ha='left')
|
| 722 |
+
return fig
|
| 723 |
+
|
| 724 |
else:
|
| 725 |
# Get input parameters
|
| 726 |
p.set(0.3, "Gathering data...")
|
|
|
|
| 759 |
prop_percent=(pl.col('is_pitch') / pl.col('is_pitch').sum()).over("pitch_type"),
|
| 760 |
prop=pl.col('is_pitch').sum().over("pitch_type")
|
| 761 |
)
|
| 762 |
+
|
|
|
|
|
|
|
|
|
|
| 763 |
if df is None:
|
| 764 |
fig = plt.figure(figsize=(10, 10))
|
| 765 |
fig.text(x=0.1, y=0.9, s='No Statcast Data For This Pitcher', fontsize=24, ha='left')
|
| 766 |
return fig
|
| 767 |
+
|
| 768 |
+
except TypeError:
|
| 769 |
+
print("NONE")
|
| 770 |
+
# if df is None:
|
| 771 |
+
fig = plt.figure(figsize=(10, 10))
|
| 772 |
+
fig.text(x=0.1, y=0.9, s='No Statcast Data For This Pitcher', fontsize=24, ha='left')
|
| 773 |
+
return fig
|
| 774 |
# return None
|
| 775 |
|
| 776 |
if df is None:
|