AllenInstitute / AllenSDK

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

Inconsistent datasets from `EcephysSession.presentationwise_spike_times method` #2634

Open vigji opened 1 year ago

vigji commented 1 year ago

Describe the bug The dataset instantiated by the EcephysSession.presentationwise_spike_times when there are not spikes that get included has different structure from when there are spikes (different column names). This is a very minor bug but can still give some issues when looping over datasets and concatenating the results, and it should be a trivial fix.

To Reproduce

from allensdk.brain_observatory.ecephys.ecephys_project_cache import EcephysProjectCache
cache = EcephysProjectCache.from_warehouse(manifest="/.../manifest.json")
session = cache.get_session_data(<any_session>)

# Look at columns of:
session.presentationwise_spike_times(unit_ids=[])
# compare columns with:
session.presentationwise_spike_times(unit_ids=[session.units.index[0]])

Expected behavior The same data frame structure should be observed.

Actual Behavior Columns are inconsistently named.

Do you want to work on this issue? Happy to submit a PR, although this basically look like a typo!

morriscb commented 1 year ago

Hey @vigji, thanks for finding this. If you can open the PR to fix this issue that would be great!