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

[FIX] update cli for preprocess #1190

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

Remi-Gau
Copy link
Contributor

No description provided.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Type: Enhancement

PR Summary: The pull request introduces enhancements to the command-line interface for preprocessing tasks. It includes updates to logging within the bidspm module to provide more information about the execution environment, specifically the Matlab and Octave platforms. Additionally, a new shell script is added to facilitate running preprocessing tasks from the command line.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
  • Unsupported files: the diff contains files that Sourcery does not currently support during reviews.

General suggestions:

  • Consider storing the result of the matlab() function call in a variable to avoid calling it multiple times, which could be a potential performance issue.
  • For consistency and maintainability, it would be beneficial to log the path to the Octave executable in the same manner as the Matlab path is logged.
  • Verify that the participant labels are handled correctly in all contexts, particularly with regard to potential octal interpretation due to leading zeros.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -429,9 +429,11 @@ def run_command(cmd: str, platform: str | None = None) -> int:

if platform is None:
if Path(matlab()).exists():
log.info(f"Using matlab found at: {matlab()}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (llm): Logging the path to the Matlab executable is a good practice for debugging. However, calling matlab() function twice (once for logging and once for setting platform) could be inefficient if the function does any non-trivial computation or IO. Consider storing the result in a variable and reusing it.

platform = matlab()
cmd = cmd.replace(new_line, ", ")
else:
log.info("Using octave")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (llm): Consistency in logging is important for maintainability. Consider adding the path to the octave executable, similar to how the path to Matlab is logged.

--action preprocess \
--task balloonanalogrisktask \
--fwhm 8 \
--participant_label 01 02 03
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question (llm): Ensure that the participant labels are correctly formatted and that leading zeros do not imply octal interpretation in any context where these values are used.

@Remi-Gau Remi-Gau added this to the v3.2.0 milestone Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant