Rename folder matlab_tools -> +simnibsMATLAB#607
Draft
SeSodesa wants to merge 17 commits intosimnibs:masterfrom
Draft
Rename folder matlab_tools -> +simnibsMATLAB#607SeSodesa wants to merge 17 commits intosimnibs:masterfrom
SeSodesa wants to merge 17 commits intosimnibs:masterfrom
Conversation
This turns the folder into a namespace called simnibsMATLAB. Since the
actual MATLAB code in this renamed folder was not modified yet, some
functions and scripts might be broken after this change. Functions,
scripts and classes will need to be fully qualified for things to work:
output = simnibsMATLAB.subNameSpace.somFunction(inputs) ;
This is if the function is in the folder +simnibsMATLAB/+subNameSpace/.
…ction calls Also remove extra whitespace from end of file, just because my editor is configured to do that...
…on calls Also automatic whitespace removal from end of file and lines.
Again, unnecessary whitespace was also automatically removed, so check the Git diffs with --ignore-all-space flag set.
Also removed extra whitespace.
…on calls Also unnecessary whitespace removal.
Also superfluous whitespace removal.
…iangle_sizes call
This is to make it compatible with MATLAB's namespaces. Added properties with beginnings of MATLAB property validation such that the code generates an empty gifti object when the constructor is given no arguments. However, it is unclear how to test this properly. Ispecially interesting is the struct branch of the constructor, where the given struct contains the fields 'metadata', 'label' and 'data'. It seems that the original behaviour would have resulted in infinite recursion (without testing). Now the object is just returned as-is. You will want to disable whitespace diffs when reviewing this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This turns the folder
matlab_toolsinto a MATLAB namespace calledsimnibsMATLAB. In the code itself, function, script and class constructor calls are fully qualified for things to work:This is if the function is in the location
+simnibsMATLAB/+subNameSpace/someFunction.m.TODO:
matlab_toolsto+simnibsMATLAB.+simnibsMATLAB/@gifticlass folder, as the folder does not actually contain a proper class definition using theclassdefkeyword in the filegifti.m, but only functions. See instructions here: https://www.mathworks.com/help/matlab/matlab_oop/organizing-classes-in-folders.html.gifticlass is also problematic, as the call(s) tothis = class(this,'simnibsMATLAB.gifti')causes a redefinition of the class object on the fly, resulting in an error. The class should have clearly defined properties, some of which should be set as empty values of their respective types if not needed.Closes #606.
NOTE: when reviewing the changes, turn off whitespace diffs, because my editor is set to remove trailing whitespace and such unneeded things from all code files.