matnwb
matnwb copied to clipboard
Create +types / namespaces folders in Matlab's temporary folder
When calling nwbRead, there are two folders created in the pwd. This can be unexpected to the user, especially when the function is called somewhere under the hood (e.g., when reading in an NWB file using a third-party software).
As a way to avoid creating folders in somewhat arbitrary locations on the user's computer, they could be created by default in matlabs designated tempdir .
See a short discussion on this here: https://nwb-users.slack.com/archives/C5XKC14L9/p1589498856181700
There's some doc on this here: https://www.mathworks.com/help/matlab/import_export/creating-temporary-files.html
The path to the tempdir in this case must be persistent in the case of MATLAB closing and reopening.
I could include a loadNamespace.m script which needs to be called on MATLAB start with if users wish to re-use that namespace without regenerating files.
Functions NwbFile, nwbRead, generateCore, and generateExtension would also call loadNamespace in the background.