Skip to content
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

Error reading NWB file while session cache is instantiated in workspace #2693

Open
slcalgin opened this issue Jun 26, 2023 · 0 comments
Open
Labels

Comments

@slcalgin
Copy link

slcalgin commented Jun 26, 2023

Hi there,
I'm working on a script that downloads data from Neuropixels dataset using the EcephysProjectCache. Below is how I download the data from sessions - no problem here, just for reference:

self.cache = EcephysProjectCache.from_warehouse(manifest=manifest_path)
self.session = self.cache.get_session_data(self.session_id)

In this script I want to be able to use the API to access data, but also want to be able to read and write to the NWB file. However, when I go to open the NWB file:

with NWBHDF5IO(nwbfilepath, mode="r+", load_namespaces=True) as io:
     io.read(path_to_nwb)

I get the following error: OSError: Unable to open file (file is already open for read-only).

I have confirmed that the file is not open elsewhere in my code or device. I'm assuming that the session cache has the file open in the backend somewhere in order to access the data. But I'm not sure why this is necessary if the NWBFile object is already stored within the session object (session.api.nwbfile). Would this be correct? Do you know of a way to workaround this?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant