Open brendanjohnharris opened 10 months ago
This occurs even when directly reading the nwb file using pynwb, without importing behavior_ecephys_session
. The following also fails:
import allensdk
import pynwb
from allensdk.brain_observatory.ecephys import ecephys_project_cache
with pynwb.NWBHDF5IO('ecephys_session_1152811536.nwb', "r", load_namespaces=True) as read_io:
nwbfile = read_io.read()
nwbfile
Seems to be an issue with the allensdk nwb_api. The following fails also:
import allensdk
import pynwb
from allensdk.brain_observatory.nwb.nwb_api import NwbApi
with pynwb.NWBHDF5IO('ecephys_session_1152811536.nwb', "r", load_namespaces=True) as read_io:
nwbfile = read_io.read()
nwbfile
In particular, the conflicting namespace loaded as below:
import allensdk
import pynwb
namespace_path = './allensdk/brain_observatory/nwb/ndx-aibs-behavior-ophys.namespace.yaml'
pynwb.load_namespaces(str(namespace_path))
with pynwb.NWBHDF5IO('ecephys_session_1152811536.nwb', "r", load_namespaces=True) as read_io:
nwbfile = read_io.read()
nwbfile
Describe the bug Importing both
allensdk.brain_observatory.ecephys.ecephys_project_cache
andallensdk.brain_observatory.ecephys.behavior_ecephys_session
seems to break reading from NWB filesTo Reproduce Using a sample Neuropixels Visual Behavior nwb file, this runs as expected:
But this fails:
Expected behavior
BehaviourEcephysSession
can be constructed from an NWB file.Actual Behavior The following error:
Environment (please complete the following information):