Spaces:
Sleeping
Sleeping
Fix indentation error in process_daily_snow function
Browse filesFixed IndentationError at line 161 where the function body was not properly indented after the function definition.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
app.py
CHANGED
|
@@ -157,16 +157,17 @@ def calculate_total_new_snow(df):
|
|
| 157 |
snow_df['day_group'] = snow_df['datetime'].apply(
|
| 158 |
lambda x: x.date() if x.hour >= 9 else (x - pd.Timedelta(days=1)).date()
|
| 159 |
)
|
|
|
|
| 160 |
def process_daily_snow(group):
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
|
| 171 |
def create_plots(df):
|
| 172 |
"""Create all weather plots including SWE estimates"""
|
|
|
|
| 157 |
snow_df['day_group'] = snow_df['datetime'].apply(
|
| 158 |
lambda x: x.date() if x.hour >= 9 else (x - pd.Timedelta(days=1)).date()
|
| 159 |
)
|
| 160 |
+
|
| 161 |
def process_daily_snow(group):
|
| 162 |
+
"""Sum up ONLY the 3-hour snowfall amounts for each day period"""
|
| 163 |
+
# Sort by time to ensure proper sequence
|
| 164 |
+
group = group.sort_values('datetime')
|
| 165 |
+
|
| 166 |
+
# Sum only the valid 3-hour amounts, treating NaN as 0
|
| 167 |
+
valid_amounts = group['snowfall_3hr'].fillna(0)
|
| 168 |
+
daily_total = valid_amounts.sum()
|
| 169 |
+
|
| 170 |
+
return daily_total
|
| 171 |
|
| 172 |
def create_plots(df):
|
| 173 |
"""Create all weather plots including SWE estimates"""
|