AllenInstitute / AllenSDK

code for reading and processing Allen Institute for Brain Science data
https://allensdk.readthedocs.io/en/latest/
Other
335 stars 149 forks source link

'probe_channel_number' should replace 'local_index' in ecephys_session, line 1244 (_build_mean_waveforms) #2573

Closed ryan-gorzek closed 1 year ago

ryan-gorzek commented 1 year ago

Running this code (from the ecephys_session example notebook):

units_of_interest = high_snr_unit_ids[:35]

waveforms = {uid: session.mean_waveforms[uid] for uid in units_of_interest} peak_channels = {uid: session.units.loc[uid, 'peak_channel_id'] for uid in units_of_interest}

plot_mean_waveforms(waveforms, units_of_interest, peak_channels) plt.show()

Results in KeyError: 'local_index', tracing back to line 1244 of /allensdk/brain_observatory/ecephys/ecephys_session.py.

I dug around a bit and from my understanding, 'local_index' was replaced by 'probe_channel_number' in some instances. I changed this instance of 'local_index' to 'probe_channel_number' in my local copy and was able to plot the mean waveforms without any error being thrown.

danielsf commented 1 year ago

Thanks for the proactive diagnosis @gorzek-ryan

Whoever fixes this on main is probably going to need to support both local_index and probe_channel_number, since we will still have legacy data out there that uses local_index.

See discussion in

https://github.com/AllenInstitute/AllenSDK/pull/2444

morriscb commented 1 year ago

Duplicated by #2594

morriscb commented 1 year ago

Work completed and bug should now be fixed for upcoming release candidate.