1414from delphi_utils import get_structured_logger
1515
1616# first party
17- from .download_ftp_files import download_covid , download_cli
18- from .load_data import load_combined_data , load_cli_data
17+ from .download_ftp_files import download_counts
18+ from .load_data import load_combined_data , load_cli_data , load_flu_data
1919from .update_sensor import CHCSensorUpdater
2020
2121
@@ -26,10 +26,7 @@ def retrieve_files(params, filedate, logger):
2626
2727 ## download recent files from FTP server
2828 logger .info ("downloading recent files through SFTP" )
29- if "covid" in params ["indicator" ]["types" ]:
30- download_covid (filedate , params ["indicator" ]["input_cache_dir" ], params ["indicator" ]["ftp_conn" ])
31- if "cli" in params ["indicator" ]["types" ]:
32- download_cli (filedate , params ["indicator" ]["input_cache_dir" ], params ["indicator" ]["ftp_conn" ])
29+ download_counts (filedate , params ["indicator" ]["input_cache_dir" ], params ["indicator" ]["ftp_conn" ])
3330
3431 denom_file = "%s/%s_Counts_Products_Denom.dat.gz" % (params ["indicator" ]["input_cache_dir" ],filedate )
3532 covid_file = "%s/%s_Counts_Products_Covid.dat.gz" % (params ["indicator" ]["input_cache_dir" ],filedate )
@@ -53,6 +50,8 @@ def retrieve_files(params, filedate, logger):
5350 file_dict ["mixed" ] = mixed_file
5451 file_dict ["flu_like" ] = flu_like_file
5552 file_dict ["covid_like" ] = covid_like_file
53+ if "flu" in params ["indicator" ]["types" ]:
54+ file_dict ["flu" ] = flu_file
5655 return file_dict
5756
5857
@@ -75,6 +74,9 @@ def make_asserts(params):
7574 files ["flu_like" ] is not None and \
7675 files ["covid_like" ] is not None ,\
7776 "files must be all present or all absent"
77+ if "flu" in params ["indicator" ]["types" ]:
78+ assert (files ["denom" ] is None ) == (files ["flu" ] is None ), \
79+ "exactly one of denom and flu files are provided"
7880
7981
8082def run_module (params : Dict [str , Dict [str , Any ]]):
@@ -182,6 +184,9 @@ def run_module(params: Dict[str, Dict[str, Any]]):
182184 elif numtype == "cli" :
183185 data = load_cli_data (file_dict ["denom" ],file_dict ["flu" ],file_dict ["mixed" ],
184186 file_dict ["flu_like" ],file_dict ["covid_like" ],dropdate_dt ,"fips" )
187+ elif numtype == "flu" :
188+ data = load_flu_data (file_dict ["denom" ],file_dict ["flu" ],
189+ dropdate_dt ,"fips" )
185190 more_stats = su_inst .update_sensor (
186191 data ,
187192 params ["common" ]["export_dir" ],
0 commit comments