NPLinker / nplinker-webapp

Apache License 2.0
2 stars 2 forks source link

Fix scoring methods running when not using Docker #1

Closed gcroci2 closed 1 month ago

gcroci2 commented 2 years ago

Running the webapp without Docker following the guide in the readme, and configuring the .toml file to download data from POP (using root = "platform:MSV000079284") leads to an error when I try to select either spectra or BGCs data from the webapp UX. In particular, when I click "Show scores for selected spectra" (same for clicking "Show scores for selected BGCs") this error appears on the console:

2022-08-04 10:25:42,388 error handling message
 message: Message 'PATCH-DOC' content: {'events': [{'kind': 'MessageSent', 'msg_type': 'bokeh_event', 'msg_data': {'event_name': 'button_click', 'event_values': {}}}], 'references': []}
 error: ValueError("invalid literal for int() with base 10: '-'")
Traceback (most recent call last):
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/server/protocol_handler.py", line 97, in handle
    work = await handler(message, connection)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/server/session.py", line 95, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/server/session.py", line 289, in _handle_patch
    message.apply_to_document(self.document, self)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/protocol/messages/patch_doc.py", line 115, in apply_to_document
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.content, setter))
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/protocol/messages/patch_doc.py", line 115, in <lambda>
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.content, setter))
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/document.py", line 391, in apply_json_patch
    DocumentPatchedEvent.handle_json(self, event_json, references, setter)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/events.py", line 259, in handle_json
    handler(doc, event_json, references, setter)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/events.py", line 300, in _handle_json
    cb(event_json["msg_data"])
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 355, in trigger_json_event
    model._trigger_event(event)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/util/callback_manager.py", line 119, in _trigger_event
    self.document.callbacks.notify_event(cast(Model, self), event, invoke)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 247, in notify_event
    invoke_with_curdoc(doc, callback_invoker)
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/document/callbacks.py", line 408, in invoke_with_curdoc
    return f()
  File "/Users/giuliacrocioni/miniforge3/envs/nplinker_webapp/lib/python3.10/site-packages/bokeh/util/callback_manager.py", line 113, in invoke
    cast(EventCallbackWithoutEvent, callback)()
  File "/Users/giuliacrocioni/Desktop/docs/eScience/projects/NPLinker/nplinker-webapp/nplinker/main.py", line 1130, in tables_score_met_callback
    visible_gcfs = list(
ValueError: invalid literal for int() with base 10: '-'
gcroci2 commented 2 years ago

The first row of the tables shouldn't be selected since it contains - values and it's not a meaningful data point. Probably it is generated during the parsing of the PoDP data. If selected, the webapp source code throws this error. Will be fixed by #2

gcroci2 commented 1 month ago

We will develop a new dashboard from scratch.