From 18dac062ef80f55eb47dfb17672707a3695a703a Mon Sep 17 00:00:00 2001 From: Marcel Date: Wed, 9 Nov 2022 09:49:27 +0100 Subject: [PATCH] [bugfix] too many under 1V warnings appearing, moved them to "other" --- survBot.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/survBot.py b/survBot.py index dee9015..d25ed72 100755 --- a/survBot.py +++ b/survBot.py @@ -589,13 +589,12 @@ class StationQC(object): if len(under) > 0: # try calculate number of occurences from gaps between indices n_occurrences = len(np.where(np.diff(under) > 1)[0]) + 1 - for key in warn_keys: - self.warn(key=key, - detailed_message=f'Trace {trace.get_id()}: ' - f'Voltage below {pb_ok}V in {len(under)} samples, {n_occurrences} time(s). ' - f'Mean voltage: {np.mean(voltage):.2}' - + self.get_last_occurrence_timestring(trace, under), - status_message='WARN ({})'.format(n_occurrences)) + self.warn(key='other', + detailed_message=f'Trace {trace.get_id()}: ' + f'Voltage below {pb_ok}V in {len(under)} samples, {n_occurrences} time(s). ' + f'Mean voltage: {np.mean(voltage):.2}' + + self.get_last_occurrence_timestring(trace, under), + status_message='under 1V ({})'.format(n_occurrences)) # Get voltage levels for classification voltage_dict = {}