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

fixes issue with loading trials from BehaviorEcephysSession.from_nwb #2701

Closed aamster closed 11 months ago

aamster commented 11 months ago

Fixes #2490

This issue was thought to be fixed. However there was a regression that wasn't tested. We only tested for the from_json API.

Testing

Added unit test and manually tested with

from pynwb import NWBHDF5IO
from allensdk.brain_observatory.ecephys.behavior_ecephys_session import (
BehaviorEcephysSession)

path=r"/allen/programs/mindscope/workgroups/np-behavior/vbn_data_release/vbn_s3_cache/visual-behavior-neuropixels-0.4.0/behavior_ecephys_sessions/1044594870/ecephys_session_1044594870.nwb"

with NWBHDF5IO(path, 'r', load_namespaces=True) as nwb_io:
    session = BehaviorEcephysSession.from_nwb(nwbfile=nwb_io.read())

session.get_rolling_performance_df()