Skip to content

Commit 6f71019

Browse files
Ananya JoshiAnanya Joshi
Ananya Joshi
authored and
Ananya Joshi
committed
additional PR feedback
1 parent c31bdc4 commit 6f71019

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

_delphi_utils_python/delphi_utils/flash_eval/eval_day.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ def flash_eval(lag, day, input_df, signal, params, logger=None):
226226
Ouput:
227227
None
228228
"""
229+
print("RF")
229230
if not logger:
230231
logger = get_structured_logger(
231232
name=signal,

_delphi_utils_python/delphi_utils/flash_eval/run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
when the module is run with `python -m delphi_utils.flash_eval`.
66
"""
77
from datetime import date
8+
from collections import defaultdict
89
import pandas as pd
910
from .. import read_params
1011
from .eval_day import flash_eval
@@ -20,13 +21,13 @@ def run_module():
2021
signals = params["flash"]["signals"]
2122
for signal in signals:
2223
export_files = read_filenames(params["common"]["export_dir"])
23-
days = {}
24+
days = defaultdict(list)
2425
#Concat the data from recent files at nation, state, and county resolution per day.
2526
for (x, _) in export_files:
2627
if signal in x and pd.Series([y in x for y in ['state', 'county', 'nation']]).any():
2728
day = pd.to_datetime(x.split('_')[0], format="%Y%m%d", errors='raise')
28-
days[day] = pd.concat([days.get(day, pd.DataFrame()),
29-
load_csv(f"{params['common']['export_dir']}/{x}")])
29+
days[day].append(load_csv(f"{params['common']['export_dir']}/{x}"))
30+
days[day] = pd.concat(days[day])
3031
for day, input_df in days.items():
3132
input_df = input_df[['geo_id', 'val']].set_index('geo_id').T
3233
input_df.index = [day]

0 commit comments

Comments
 (0)