Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Remove one of three filesystem structures #2971

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Lestropie
Copy link
Member

Downstream of #2920.

Follows discussion in #2964.


  1. Currently on dev:

    1. C++ commands must be defined using a single file cmd/cmdname.cpp
    2. For Python commands there are three possible arrangements:
      1. A single file python/mrtrix3/commands/cmdname.py.
      2. A file python/mrtrix3/commands/cmdname/cmdname.py, to facilitate inclusion of other files within a sub-directory specific to that command.
      3. Two files python/mrtrix3/commands/cmdname/usage.py and python/mrtrix3/commands/cmdname/execute.py, which define the relevant entry points.
  2. It is being proposed in Allow splitting C++ commands into separate files #2964 that:

    1. For C++ it should be possible to have either:
      1. A single file cmd/cmdname.cpp.
      2. A file cmd/cmdname/cmdname.cpp, to facilitate inclusion of other files within a sub-directory specific to that command.

My proposal here is: especially if #2964 is implemented, providing support for 2.i.b., then it makes sense to remove support for 1.ii.c..

That way the supported filesystem structure per command will be consistent between the two languages. As shown by the content of this PR, there is little to no sacrifice in doing so; conversely there's the benefit of any communication around permissible filesystem structures likely being simpler.

@Lestropie Lestropie added this to the 3.1.0 updates milestone Aug 20, 2024
@Lestropie Lestropie self-assigned this Aug 20, 2024
@Lestropie Lestropie requested a review from a team August 20, 2024 03:39

This comment was marked as outdated.

For commands where the entry in python/mrtrix3/commands/ is not a standalone .py file but a directory, previously there were two possible filesystem contents. One was for that sub-directory to contain a .py file with the same name as the command, as determined by the name of the python/commands/ sub-directory, and that file is expected to contain functions called uage() and execute(). The second is for such a file to be absent, but for there to instead exist two files called usage.py and execute.py, which would provide those relevant functions. This commit removes support for the latter.
@Lestropie Lestropie force-pushed the python_remove_third_format branch from 5ff0868 to 5e69f18 Compare September 2, 2024 13:33
Copy link

github-actions bot commented Sep 2, 2024

clang-tidy review says "All clean, LGTM! 👍"

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

Successfully merging this pull request may close these issues.

1 participant