Skip to content

Commit a0bab02

Browse files
committed
added load email option
1 parent 16dde53 commit a0bab02

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/acquisition/quidel/quidel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def measurement_to_ts(m,index,startweek=None,endweek=None):
8080
return res
8181

8282
class QuidelData:
83-
def __init__(self, raw_path):
83+
def __init__(self, raw_path, load_email=True):
8484
self.data_path = raw_path
8585
self.excel_uptodate_path = join(raw_path,'excel/uptodate')
8686
self.excel_history_path = join(raw_path,'excel/history')
@@ -104,7 +104,8 @@ def __init__(self, raw_path):
104104
]
105105
self.fields_to_keep = ['fac_id','fluA','fluB','fluAll']
106106
self.dims_to_keep = [self.fields.index(x) for x in self.fields_to_keep]
107-
self.retrieve_excels()
107+
if load_email:
108+
self.retrieve_excels()
108109
self.prepare_csv()
109110

110111
def retrieve_excels(self):

src/acquisition/quidel/quidel_update.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
LOCATIONS = ['hhs%d'%i for i in range(1,11)]
5151
DATAPATH = '/home/automation/quidel_data'
5252

53-
def update(locations, first=None, last=None, force_update=False):
53+
def update(locations, first=None, last=None, force_update=False, load_email=True):
5454
# download and prepare data first
55-
qd = quidel.QuidelData(DATAPATH)
55+
qd = quidel.QuidelData(DATAPATH,load_email)
5656
if not qd.need_update and not force_update:
5757
print('Data not updated, nothing needs change.')
5858
return
@@ -126,10 +126,12 @@ def main():
126126
parser.add_argument('--first', '-f', default=None, type=int, help='first epiweek override')
127127
parser.add_argument('--last', '-l', default=None, type=int, help='last epiweek override')
128128
parser.add_argument('--force_update', '-u', action='store_true', help='force update db values')
129+
parser.add_argument('--skip_email', '-s', action='store_true', help='skip email downloading step')
129130
args = parser.parse_args()
130131

131132
# sanity check
132-
first, last, force_update = args.first, args.last, args.force_update
133+
first, last, force_update, skip_email = args.first, args.last, args.force_update, args.skip_email
134+
load_email = not skip_email
133135
if first is not None:
134136
flu.check_epiweek(first)
135137
if last is not None:
@@ -144,7 +146,7 @@ def main():
144146
locations = args.location.lower().split(',')
145147

146148
# run the update
147-
update(locations, first, last, force_update)
149+
update(locations, first, last, force_update, load_email)
148150

149151

150152
if __name__ == '__main__':

0 commit comments

Comments
 (0)