Python cmake binwrappers: Split all commands into multiple files #2850
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 is a proposed alternative structure for #2741. I wanted to generate it and then lay it side by side against the current proposal there.
(Browsing the code on this branch might communicate such better than the PR)
Admittedly there's some stuff in here that I have done along the way that is not totally specific to this proposal; that is, even if the core of this proposal is rejected, some of the content here would still be applicable to whatever alternative were to be chosen.
So the main points here:
Both source files specific to an individual command, and the API modules, reside in
python/mrtrix3
.lib/
in the source tree, since they shouldn't be getting included from there directly.mrtrix3
" subdirectory since that will likely give IDEs a bit of assistance.All commands are stored in a sub-directory of
python/mrtrix3
, regardless of whether or not they possess multiple underlying algorithms.On Python: cmake-generated wrappers for executables #2741, some commands are standalone
.py
files, others contain their own subdirectories. This is a bit clumsy both when navigating, and in thecmake
code, as it changes the content that needs to be written to the executable file.The sub-directories for the various commands reside within
python/mrtrix3
, alongside the utility module files.Python: cmake-generated wrappers for executables #2741 currently has these grouped in a sub-directory "
scripts/
"; perhaps if an unnecessary subdirectory can be avoided it might be preferable.Every command has had the code corresponding to the requisite
usage()
andexecute()
functions split between two separate files. Some commands also have additional code separated into their own files.usage.py
" and "execute.py
" is quite strange, particularly when dealing with maintenance on the whole code base; but if just working on one command at a time, it probably doesn't matter.If anything is going to result in this proposal getting rejected, this is probably it.
(PS. I'm aware that merging this against #2678 will be a nightmare... but I'll deal with it)