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

can't load NWB file from a directory outside of main matnwb directory #362

Closed
cechava opened this issue Dec 9, 2021 · 2 comments · Fixed by #363
Closed

can't load NWB file from a directory outside of main matnwb directory #362

cechava opened this issue Dec 9, 2021 · 2 comments · Fixed by #363

Comments

@cechava
Copy link
Collaborator

cechava commented Dec 9, 2021

trying to read in a file from outside of matnwb file produces the following error:

>> readFile = nwbRead('test_export.nwb');
28  if any(saveDirMask)
Error using save
Cannot create 'core.mat' because 'namespaces' does not
exist.

Error in spec.saveCache (line 10)
save(cachePath, '-struct', 'NamespaceInfo');

Error in nwbRead>generateSpec (line 123)
    spec.saveCache(Namespace, saveDir);

Error in nwbRead (line 54)
        generateSpec(filename, h5info(filename,
        specLocation), 'savedir', saveDir);

I verified that the namespaces folder is in my MATLAB search path (abridged below for readability)

>> path

		MATLABPATH

	/Users/cesar/Repositories/matnwb/external_packages/datenum8601
	/Users/cesar/Repositories/matnwb
	/Users/cesar/Repositories/matnwb/.git
	/Users/cesar/Repositories/matnwb/.git/hooks
	/Users/cesar/Repositories/matnwb/.git/info
	/Users/cesar/Repositories/matnwb/.git/logs
	/Users/cesar/Repositories/matnwb/.git/logs/refs
	/Users/cesar/Repositories/matnwb/.git/logs/refs/heads
	/Users/cesar/Repositories/matnwb/.git/logs/refs/remotes
	/Users/cesar/Repositories/matnwb/.git/logs/refs/remotes/origin
	/Users/cesar/Repositories/matnwb/.git/objects
	/Users/cesar/Repositories/matnwb/.git/objects/00
	/Users/cesar/Repositories/matnwb/.git/objects/02
	/Users/cesar/Repositories/matnwb/.git/objects/04
	/Users/cesar/Repositories/matnwb/.git/objects/05
	/Users/cesar/Repositories/matnwb/.git/objects/06
	/Users/cesar/Repositories/matnwb/.git/objects/07
....
	/Users/cesar/Repositories/matnwb/.git/objects/info
	/Users/cesar/Repositories/matnwb/.git/objects/pack
	/Users/cesar/Repositories/matnwb/.git/refs
	/Users/cesar/Repositories/matnwb/.git/refs/heads
	/Users/cesar/Repositories/matnwb/.git/refs/remotes
	/Users/cesar/Repositories/matnwb/.git/refs/remotes/origin
	/Users/cesar/Repositories/matnwb/.git/refs/tags
	/Users/cesar/Repositories/matnwb/doc
	/Users/cesar/Repositories/matnwb/external_packages
	/Users/cesar/Repositories/matnwb/external_packages/fastsearch
	/Users/cesar/Repositories/matnwb/installer
	/Users/cesar/Repositories/matnwb/jar
	/Users/cesar/Repositories/matnwb/namespaces
	/Users/cesar/Repositories/matnwb/nwb-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.0.2
	/Users/cesar/Repositories/matnwb/nwb-schema/2.0.2/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.1.0
	/Users/cesar/Repositories/matnwb/nwb-schema/2.1.0/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.0
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.0/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.0/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.0/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.1
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.1/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.1/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.1/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.2
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.2/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.2/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.2/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.3
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.3/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.3/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.3/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.4
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.4/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.4/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.4/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.5
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.5/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.5/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.2.5/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.3.0
	/Users/cesar/Repositories/matnwb/nwb-schema/2.3.0/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.3.0/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.3.0/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/nwb-schema/2.4.0
	/Users/cesar/Repositories/matnwb/nwb-schema/2.4.0/core
	/Users/cesar/Repositories/matnwb/nwb-schema/2.4.0/hdmf-common-schema
	/Users/cesar/Repositories/matnwb/nwb-schema/2.4.0/hdmf-common-schema/common
	/Users/cesar/Repositories/matnwb/tutorials
	/Users/cesar/Repositories/matnwb/tutorials/html
	/Users/cesar/Repositories/matnwb/utilities
	/Users/cesar/Repositories/matnwb/utilities/maintenance
	/Users/cesar/Documents/MATLAB
....
@cechava
Copy link
Collaborator Author

cechava commented Dec 9, 2021

Probably a result from one of the recent merges since this used to work without problem.

@lawrence-mbf
Copy link
Collaborator

Can't quite reproduce it but I do have a fix for nwbRead not using your core namespace directory. MatNWB usage should only require adding the root matnwb directory to path.

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

Successfully merging a pull request may close this issue.

2 participants