[bugfix] some bugfixes/tweaks

This commit is contained in:
Marcel Paffrath 2023-02-16 15:49:07 +01:00
parent 5632bab07b
commit a6c792b271
5 changed files with 13 additions and 11 deletions

View File

@ -7,7 +7,7 @@ stations_blacklist: ["TEST", "EREA"] # exclude these stations
networks_blacklist: [] # exclude these networks
interval: 60 # Perform checks every x seconds
n_track: 300 # wait n_track * intervals before performing an action (i.e. send mail/end highlight status)
timespan: 1 # Check data of the recent x days
timespan: 3 # Check data of the recent x days
verbosity: 0 # verbosity flag
track_changes: True # tracks all changes since GUI startup by text highlighting (GUI only)
warn_count: False # show number of warnings and errors in table
@ -125,7 +125,7 @@ add_links:
# E-mail notifications
EMAIL:
mailserver: "localhost"
addresses: ["marcel.paffrath@rub.de",]# "kasper.fischer@rub.de"] # list of mail addresses for info mails
addresses: ["marcel.paffrath@rub.de", "kasper.fischer@rub.de"] # list of mail addresses for info mails
sender: "webmaster@geophysik.ruhr-uni-bochum.de" # mail sender
stations_blacklist: ['GR33'] # do not send emails for specific stations
networks_blacklist: [] # do not send emails for specific network

View File

@ -1,2 +0,0 @@
{"1Y.GR01": "230V",
"1Y.GR03": "charger"}

View File

@ -69,7 +69,7 @@ def get_nwst_id(trace):
def fancy_timestr(dt, thresh=600, modif='+'):
if dt > timedelta(seconds=thresh):
if isinstance(dt, timedelta) and dt > timedelta(seconds=thresh):
value = f'{modif} ' + str(dt) + f' {modif}'
else:
value = str(dt)
@ -643,7 +643,7 @@ class StationQC(object):
if n_errors is None:
n_errors = self.parameters.get('n_track')
# +1 to check whether n_errors +1 was no error (error is new)
# +1 to check whether n_errors + 1 was no error (error is new)
n_errors += 1
# simulate an error specified in json file (dictionary: {nwst_id: key} )
@ -657,6 +657,9 @@ class StationQC(object):
# if first entry was no error but all others are, return True (-> new Fail n_track times)
if not previous_errors[0] and all(previous_errors[1:]):
return True
# special case: n_errors set to 1 (+1) to check for upcoming error (refresh plot etc.), but not on startup
if not previous_errors[0] and n_errors == 2:
return True
# in case previous_errors exists, last item is error but not all items are error, error still active
elif previous_errors and previous_errors[-1] and not all(previous_errors):
return 'active'

View File

@ -47,6 +47,7 @@ def get_color_mpl(key):
def get_time_delay_color(dt, dt_thresh):
""" Set color of time delay after thresholds specified in self.dt_thresh """
if isinstance(dt, type(dt_thresh[0])):
if dt < dt_thresh[0]:
return get_color('OK')
elif dt_thresh[0] <= dt < dt_thresh[1]:

View File

@ -55,7 +55,7 @@ def html_footer():
def add_html_image(img_data, img_format='png'):
return f"""<br>\n<img src="data:image/{img_format};base64, {b64encode(img_data).decode('ascii')}">"""
return f"""<br>\n<img width="100%" src="data:image/{img_format};base64, {b64encode(img_data).decode('ascii')}">"""
def get_html_row(items, html_key='td'):