-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update dependencies to Python 3.8, neo==0.9.0, elephant==0.9.0 #9
Comments
I was working on getting the data loading in SWAN to work with neo 0.9.0, but the new loading routines in neo are obviously different from the old ones. So I was wondering:
|
Yes, the
With the new IO concept you can either load the complete dataset (lazy=False), or you lazy load the data and then select a particular lazy proxy object (ProxySpiketrain) and create a regular spiketrain via it's You are right that ChannelIndex objects were removed in favour of Group and ChannelView objects. Here you can use the new parameter
|
Thanks for the heads-up, @JuliaSprenger. Indeed, the proxyspike train lazy-loading may well be super helpful to speed up SWAN -- maybe even making the not necessary anymore. |
Depending how much you want to invest into the performance optimization potentially also just using the rawio layer of Neo might be interesting to you. Then you can directly access chunks of the data files, without having the nice SpikeTrain Quantity wrapping around it. But I guess as SWAN is only interested in spikes and not continuous signals this might be a bit too much effort for this relatively small amount of data. |
Yes, in principle, most of swan needs the waveforms only except for the rate histograms... It's a good point though -- maybe for other file formats in the future, such as nix, one may want to use the raw signals in case no |
Thanks @JuliaSprenger for the hint. I tried this, and I run into an error with the filename = "i140703-001-03.nev"
blio = BlackrockIO(filename)
block = blio.read_block(lazy=True, create_group_across_segment=True, load_waveforms=True)
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
<ipython-input-9-2e9aa8c5cf42> in <module>
----> 1 blio.read_block(lazy=True, create_group_across_segment=True, load_waveforms=True)
~/miniconda3/envs/swan/lib/python3.9/site-packages/neo/io/basefromrawio.py in read_block(self, block_index, lazy, create_group_across_segment, signal_group_mode, load_waveforms)
154 st_groups = []
155 for c in range(unit_channels.size):
--> 156 group = Group(name='SpikeTrain group {}'.format(i))
157 group.annotate(unit_name=unit_channels[c]['name'])
158 group.annotate(unit_id=unit_channels[c]['id'])
UnboundLocalError: local variable 'i' referenced before assignment Does the data file need to be updated to support the new neo version, somehow? Or do you think this is a bug I should report? |
On a closer look, looks like a bug - the variable |
Yes, indeed, this is a bug. Feel free to either open an issue or submit a PR (ideally including a test with the parameters you used to discover this bug). |
I have fixed the issue in my fork, but I am really not sure how I'd write a meaningful test for this. The errors in the code were syntactical, not logical. Does that still warrant a test? I'll make an issue and a corresponding PR. If you have ideas on how I can write a good test, we could discuss it there! :) |
Swan should be based on the latest releases of the
neo
andelephant
tools. Most problematic would beneo
, as it has undergone a number of breaking changes.The text was updated successfully, but these errors were encountered: