flake8 compliant
This commit is contained in:
+7
-5
@@ -30,6 +30,7 @@ BasicAuth(app, AUTH_DICT)
|
||||
# connect to database
|
||||
collection, db, client = connect()
|
||||
|
||||
|
||||
# define callbacks
|
||||
@app.callback(
|
||||
Output("alert-element", "is_open"),
|
||||
@@ -44,6 +45,7 @@ def show_alert(
|
||||
logging.info(f"updated alert message: {msg}")
|
||||
return True, msg
|
||||
|
||||
|
||||
@app.callback(
|
||||
Output("alert-message", "data"),
|
||||
Output("vis-com-name", "data"),
|
||||
@@ -73,7 +75,7 @@ def cycle_visual_communication_data(
|
||||
annotation_values
|
||||
]
|
||||
# check if next-button clicked
|
||||
if n_clicks == 0:
|
||||
if n_clicks == 0:
|
||||
logging.info("stopping early: next-button has not yet been clicked")
|
||||
return response
|
||||
# check if visual communication name is set
|
||||
@@ -102,13 +104,13 @@ def cycle_visual_communication_data(
|
||||
in annotation_values
|
||||
]
|
||||
annotations = {
|
||||
key: value
|
||||
for key, value
|
||||
key: value
|
||||
for key, value
|
||||
in zip(annotation_keys, annotation_values)
|
||||
}
|
||||
# instantiate ModelOutputs object
|
||||
annotations = ModelOutputs.from_annotations(**annotations)
|
||||
# save data to
|
||||
# save data to database
|
||||
upsert_annotations(
|
||||
collection=collection,
|
||||
vis_com_name=vis_com_name,
|
||||
@@ -137,7 +139,7 @@ def cycle_visual_communication_data(
|
||||
# reset annotations
|
||||
annotation_values = [None for elem in annotation_values]
|
||||
except NoDocumentFoundException:
|
||||
msg = f"no unannotated data in database"
|
||||
msg = "no unannotated data in database"
|
||||
logging.warning(msg)
|
||||
response[0] = msg
|
||||
return tuple(response)
|
||||
|
||||
Reference in New Issue
Block a user