-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenerate_NPIs.py
31 lines (26 loc) · 1.09 KB
/
Generate_NPIs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import argparse
import logging
from covid_model_parametrization import npis
from covid_model_parametrization.utils import utils
utils.config_logger()
logger = logging.getLogger(__name__)
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("country_iso3", help="Country ISO3")
parser.add_argument('-u', '--update-npi-list', action='store_true',
help='Update the NPI list with the local ACAPS data file')
parser.add_argument('-d', '--download-acaps', action='store_true',
help='Download the latest ACAPS data')
parser.add_argument('-f', '--create-final-list', action='store_true',
help='Create the final list of NPIs')
return parser.parse_args()
if __name__ == '__main__':
args = parse_args()
try:
npis.npis(args.country_iso3.upper(), args.update_npi_list, args.create_final_list,
download_acaps_arg=args.download_acaps)
except Exception as err:
logger.error(
f"Cannot generate NPI file, check log for details"
)
raise err