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 CLI changes for Windows image piping #2969

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from

Commits on Sep 5, 2024

  1. Python CLI changes for Windows image piping

    - More extensive use of pathlib.Path throughout API modules.
    - When running in a Windows environment, explicitly invoke cygwin.exe to translate piped image filesystem paths between Posix and Windows formats. While this is not necessary if piping an image from one Python command to another, it is necessary for compatibility in piping between Python and C++ commands.
    - Move helper function responsible for creating modified pathlib.Path class that quote-escapes when used in an f-string out of app.Parser and into app, since it may be useful outside of the context of command-line parsing.
    - Add intermediate classes for CLI input filesystem paths for centralising the checking of user-specified input paths, similarly to what had already been done for output user-specified paths.
    - dwinormalise group: Dynamically delete more images from the scratch directory as they are used.
    - fsl.eddy_binary(): Make full use of pathlib.Path functionalities.
    - mrtrix3.path.wait_for(): In addition to pathlib.Path adoption, includes duplication of fixes in 9ad39a8 and e866aa4 for simplicity of testing.
    - mrtrix3.utils.load_keyval(): Yield a dictionary of strings / lists of strings for multi-line keys. Do not split lines; that interpretation is deferred to downstream code (only current usage is population_template calling transformcalc decomp).
    - utils.name_temporary(): Fix creation of filesystem paths for temporary directories.
    Lestropie committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    081ddec View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c737b06 View commit details
    Browse the repository at this point in the history
  3. mrtrix3.app: Changes to filesystem path handling

    - Remove function app.make_quote_escaped_path_object() and replace with class FSQEPath (F-string quote-escaped path). This exploits runtime inheritance to discover the type of pathlib.Path and inherit from it, rather than using clumsy multiple inheritance.
    - Fix cygpath invocation for input image pipes.
    - Improve run.command() printed terminal strings with use of this new class.
    Lestropie committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    6ece29e View commit details
    Browse the repository at this point in the history