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

Use environment variable instead of CLI argument for the Python configuration file #1230

Open
maximemulder opened this issue Feb 14, 2025 · 2 comments

Comments

@maximemulder
Copy link
Contributor

maximemulder commented Feb 14, 2025

Currently, there is the directory of the Python configuration file in the $LORIS_CONFIG variable (set in the environment file), and then each Python (and Perl) script takes the name of the configuration file as a CLI argument. The full path of the configuration file is obviously the environment variable joined with the CLI argument.

What is we instead put the full path to the configuration file in the environment variable such as $LORIS_CONFIG_PYTHON (example name) ? This would allow to not specify the configuration file each time and makes the scripts easier to use for new users.

For instance, on the new import_dicom_study.py script (#1117), we go from:

import_dicom_study.py --insert --source=/path/to/dicom/study

to:

import_dicom_study.py --profile database_config.py --insert --source=/path/to/dicom/study

(in comparison, the current command to get the same result is this one 👀)

dicomTar.pl -profile prod -database -source=/path/to/dicom/study -target=/path/to/tarchive/dir
@cmadjar
Copy link
Collaborator

cmadjar commented Feb 14, 2025

You can have multiple configuration files. Hardcoding it in $LORIS_CONFIG_PYTHON makes switching between configuration files more complex for little benefits IMO. I constantly switch the configuration file when testing on different LORIS versions.

@maximemulder
Copy link
Contributor Author

Discussion at the LORIS-MRI meeting: This might be nice to have, but is not a priority. One option would be to have a default configuration file that can be overridden with --profile.

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

No branches or pull requests

2 participants