Skip to content

Change folder structure to use MATLAB packages #20

Description

@SeSodesa

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions