The folks at MathWorks have added the concept of packages into MATLAB, in the release R2019b. This makes it possible to access functions and classes either via fully qualified names
package.subpackage.{functionName,ClassName}
or by importing a function or a class at the start of a function. This means one does not need to pollute their MATLAB path in order to use code from a Git repository.
I propose that in a future release, the folder structure of TreeQSM be transformed to use MATLAB packages, as that would make it possible to set the project as a Git submodule in another MATLAB project, and access the functionality therein, again without polluting the MATLAB path. This would mean renaming each src/folder/subfolder/ → +folder/+subfolder/ in the project root.
With this, one could do
git submodule add <TreeQSM HTTPS URL> +TreeQSM
in their own project and then access a function fn in MATLAB with
results = TreeQSM.folder.subfolder.fn ( args, kwargs ) ;
This would be very helpful. The downside is that each existing function in TreeQSM would also need to be modified to either import or use the qualified names from the new package structure.
The folks at MathWorks have added the concept of packages into MATLAB, in the release R2019b. This makes it possible to access functions and classes either via fully qualified names
package.subpackage.{functionName,ClassName}or by importing a function or a class at the start of a function. This means one does not need to pollute their MATLAB path in order to use code from a Git repository.
I propose that in a future release, the folder structure of
TreeQSMbe transformed to use MATLAB packages, as that would make it possible to set the project as a Git submodule in another MATLAB project, and access the functionality therein, again without polluting the MATLAB path. This would mean renaming eachsrc/folder/subfolder/→+folder/+subfolder/in the project root.With this, one could do
in their own project and then access a function
fnin MATLAB withThis would be very helpful. The downside is that each existing function in
TreeQSMwould also need to be modified to either import or use the qualified names from the new package structure.