Gowerlabs / lumomat

MATLAB tools and SNIRF export for LUMO
https://www.gowerlabs.co.uk/lumo
MIT License
10 stars 2 forks source link

Unable to resolve variables under the toml Packages #6

Closed HBaghdadi1995 closed 2 years ago

HBaghdadi1995 commented 2 years ago

Brief

When calling LumoData on any .lumo file, the script would stop at line 284 with the error error parsing metadata file ... Unable to resolve the name toml.read.

Setup

Steps to Recreate

  1. Open Matlab & set lumomat as current directory. +lumofile & +lumofile/+toml should automatically be included as part of the directory, make sure to not include anything else.
  2. Type in data = LumoData({Absolute File Directory}) & Hit run.
  3. The script will crash on line 284.

Possible Solutions

  1. Move the ./+lumofile/+toml/ directory to ./+toml/
  2. Replace all instances of toml. with lumofile.toml., including the ones in ./+toml/

I prefer Solution 1, since it's less likely to cause issues when porting over newer versions of ./toml/, & contains less modification of 3rd party packages.

samuelpowell commented 2 years ago

After altering my path I can recreate, thank you @HBaghdadi1995.

Solution 1 is a bad idea because it exposes the package to the MATLAB path, which is why this bug existed in the first place. In this instance it is trivial to resolve by calling only the decode method and prefixing this with the package namespace as required. PR inbound.

This would also be caught by CI but cannot enable until we have generated some appropriate public sample data for this purpose.