matnwb icon indicating copy to clipboard operation
matnwb copied to clipboard

Create +types / namespaces folders in Matlab's temporary folder

Open jens-k opened this issue 5 years ago • 2 comments
trafficstars

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

jens-k avatar May 15 '20 11:05 jens-k

There's some doc on this here: https://www.mathworks.com/help/matlab/import_export/creating-temporary-files.html

jens-k avatar May 15 '20 11:05 jens-k

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.

lawrence-mbf avatar May 15 '20 17:05 lawrence-mbf