Skip to content

Commit 9740899

Browse files
committed
adding logging for comparing processing time
1 parent 4ec46df commit 9740899

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doctor_visits/delphi_doctor_visits/update_sensor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# standard packages
1212
from datetime import timedelta
1313
from multiprocessing import Pool, cpu_count
14+
from pathlib import Path
1415

1516
# third party
1617
import numpy as np
@@ -86,14 +87,16 @@ def update_sensor(
8687
# as of 2020-05-11, input file expected to have 10 columns
8788
# id cols: ServiceDate, PatCountyFIPS, PatAgeGroup, Pat HRR ID/Pat HRR Name
8889
# value cols: Denominator, Covid_like, Flu_like, Flu1, Mixed
90+
filename = Path(filepath).name
8991
data = pd.read_csv(
9092
filepath,
9193
dtype=Config.DTYPES,
9294
)
95+
logger.info(f"Starting processing {filename} ")
9396
data.rename(columns=Config.DEVIANT_COLS_MAP, inplace=True)
9497
data = data[Config.FILT_COLS]
9598
data[Config.DATE_COL] = data[Config.DATE_COL].apply(pd.to_datetime)
96-
99+
logger.info(f"finished processing {filename} ")
97100
assert (
98101
np.sum(data.duplicated(subset=Config.ID_COLS)) == 0
99102
), "Duplicated data! Check the input file"

0 commit comments

Comments
 (0)