Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LFP large data handling notebook #81

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Conversation

ianthomas23
Copy link
Collaborator

This PR adds a new notebook to illustrate LFP large data handling, from obtaining some realistic data through kerchunking it so that it can be lazily read, to interactively visualising it using Bokeh and Datashader.

@droumis
Copy link
Collaborator

droumis commented Oct 30, 2023

Thank you for putting this together, Ian!

I'm getting an error when trying to interact with the plot (zoom or pan). Do you see this as well?

Traceback
ERROR:bokeh.server.protocol_handler:error handling message
 message: Message 'PATCH-DOC' content: {'events': [{'kind': 'MessageSent', 'msg_type': 'bokeh_event', 'msg_data': {'type': 'event', 'name': 'rangesupdate', 'values': {'type': 'map', 'entries': [['model', {'id': 'p1243'}], ['x0', 65.49145226643604], ['x1', 82.25595374570582], ['y0', 37.11014311125485], ['y1', 71.6022776298967]]}}}]} 
 error: NameError("name 'initialised' is not defined")
Traceback (most recent call last):
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/server/protocol_handler.py", line 97, in handle
    work = await handler(message, connection)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/server/session.py", line 94, in _needs_document_lock_wrapper
    result = func(self, *args, **kwargs)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/server/session.py", line 286, in _handle_patch
    message.apply_to_document(self.document, self)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in apply_to_document
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 443, in invoke_with_curdoc
    return f()
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/protocol/messages/patch_doc.py", line 104, in <lambda>
    invoke_with_curdoc(doc, lambda: doc.apply_json_patch(self.payload, setter=setter))
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/document.py", line 391, in apply_json_patch
    DocumentPatchedEvent.handle_event(self, event, setter)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/events.py", line 245, in handle_event
    event_cls._handle_event(doc, event)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/events.py", line 280, in _handle_event
    cb(event.msg_data)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 390, in trigger_event
    model._trigger_event(event)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/util/callback_manager.py", line 113, in _trigger_event
    self.document.callbacks.notify_event(cast(Model, self), event, invoke)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 260, in notify_event
    invoke_with_curdoc(doc, callback_invoker)
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/document/callbacks.py", line 443, in invoke_with_curdoc
    return f()
  File "/Users/droumis/opt/miniconda3/envs/lfp-large-data/lib/python3.9/site-packages/bokeh/util/callback_manager.py", line 109, in invoke
    cast(EventCallbackWithEvent, callback)(event)
  File "/var/folders/pp/zp63v9q50m79py9t866mvg3h0000gp/T/ipykernel_10647/598667354.py", line 30, in callback
    if not initialised:
NameError: name 'initialised' is not defined
Screen.Recording.2023-10-30.at.1.56.41.PM.mov

@ianthomas23
Copy link
Collaborator Author

Not so far, but I will retry with a fresh environment first thing in the morning.

Looking at it, I'm not sure that the global ... line is now correct. It is bad practice anyway, so I will rewrite it so that it is not needed.

@ianthomas23
Copy link
Collaborator Author

@droumis I've updated it to use a class-based Bokeh doc, it should work fine now.

@droumis
Copy link
Collaborator

droumis commented Oct 31, 2023

This works great now! merging

@droumis droumis merged commit 1a645fb into main Oct 31, 2023
@droumis droumis self-assigned this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants