-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor for lazy loading #189
base: master
Are you sure you want to change the base?
Refactor for lazy loading #189
Conversation
Hi @JoeZiminski, Happy to see this is useful for python-neo, and thank you for all this work! This looks good to me but I will try to get @adamltaylor to also have a look as there might be wavesurfer metadata things I am not aware of. Could you also change the readme file to add the information in the PR description so that users will know about this new lazy loading ability even if they don't use python-neo (I will be happy if you point them to your repo as well). Thanks again, |
Thanks @boazmohar! That's great to hear, sure I'd be happy to update the readme file. I also had a metadata question, I saw the |
Sorry for the radio silence. Will look at this this week. |
Hi @JoeZiminski, Sorry for the delay, I am trying to see if we can dedicate some internal Janelia funds to get more eyes on this and get this over the finish line. Will update hopefully by the end of the week. Please @ me if I forget... Thanks! |
Thanks @boazmohar, in fact thinking about this, it might take a little more work on my end. I had based this around SpikeInterface's API but to work directory with NEO it make need a couple more adjustments. @samuelgarcia this is a PR I wrote to rework PyWavesurfer to better work with Neo API. If you have a change could you take a quick look and make any recomedations on how it could be improved? Maybe it is more focused on the |
Hi @JoeZiminski, we have been able to get some of @adamltaylor's time towards the end of the month. |
Yeah so I looked at this a bit and probably the main issue is that it should support lazy-loading of digital traces, in addition to analog. I don't think the current test suite covers reading of digital traces, so that's another issue. I can address this, just not for a few weeks. |
But thank you so much for all the great work you put in on this, @JoeZiminski ! |
Hi @JoeZiminski. |
Would be great to have this. |
Hi @adamltaylor and @boazmohar,
Hope things are good! Further to the discussion on incorporating PyWaveSurfer into python-neo PR 1040, it would be great if you would be happy to support a version of PyWaveSurfer that can operate in a lazy manner (i.e. only read and the data from the h5py file when it is requested).
Towards this, this PR proposes refactored version of PyWaveSurfer done in such a way that it supports lazy loading. It would be great to hear your thoughts on this and if you would be happy to support the package in this form. This refactors the existing code into a 'PyWaveSurferData' class that holds a reference to the open
.h5
file, and reads the header information. However, the data is not read into thedata_file_as_dict
dictionary by default. Instead, aget_traces()
function is introduced that allows dynamic retrieval of sections of sweep data.However, for backwards compatability a
load_all_data()
on the class and generalloadDataFile()
function are provided, to fill thedata_file_as_dict
in it's entireity up front. So, while under the hood aget_traces()
method is exposed, day-to-day the package can be used as it previously was. Also introduced are some new tests for theget_traces()
method.If you are interested, it would be great to get your feedback, I have some additional questions I can follow up with if so. After these changes it would not be difficult to incorpoate PyWaveSurfer into python-neo, which essentially would wrap the
get_traces()
method.Best Wishes,
Joe