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

[ENH] Expose n_procs option to Adni2BIDS Oasis2BIDS and Aibl2BIDS #1009

Merged

Conversation

NicolasGensollen
Copy link
Member

Closes #1007

Copy link
Collaborator

@ghisvail ghisvail left a comment

Choose a reason for hiding this comment

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

This approach looks good and should work.

Let me propose a different alternative, which might reduce the amount of code duplication:

  • Use Clinica's n_procs Click option wherever needed.
  • Put the logic for computing the default value for n_procs in the default parameter for the option.
  • Expose parameterization with n_procs to converters with a safe default value of 1, instead of making it optional and duplicating calls to get_n_procs to each pool.
  • Plugging the n_procs option to the parameter should provide the benefits of safe defaults inside Clinica's code, whilst keeping backward compatibility at the CLI layer.

@NicolasGensollen
Copy link
Member Author

Thanks for the review @ghisvail !
I implemented something that should go in the direction you detailed.
Let me know if I misunderstood or if you see some points to improve further.

Copy link
Collaborator

@ghisvail ghisvail left a comment

Choose a reason for hiding this comment

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

Exactly what I had in mind 👌

I expected you would reuse the existing n_procs in cli_param to minimize the diff, but why not. I added a comment regarding the optional vs keyword param with default value.

Co-authored-by: Ghislain Vaillant <[email protected]>
@NicolasGensollen NicolasGensollen marked this pull request as ready for review October 31, 2023 07:54
@NicolasGensollen
Copy link
Member Author

Thanks for the review ! 👍
The failures are unrelated, so I'll merge this one.

@NicolasGensollen NicolasGensollen merged commit a258c72 into aramis-lab:dev Oct 31, 2023
15 of 17 checks passed
@NicolasGensollen NicolasGensollen deleted the expose-n_proc-to-adni-2-bids branch October 31, 2023 08:45
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.

Enable user control over the number of jobs for converters
2 participants