Improve env object for more flexible lifecyle - #1478
Merged
Conversation
* move the sourcing of the python environment up as this erase the PATH configuration when done at the end of the file * Update comment for the python environment sourcingg
…#1455) * remove update of session scan done field from the delete script now that the Scan_done field has been removed from the DB * update MD file --------- Co-authored-by: lorisadmin <lorisadmin@cbrain.mcgill.ca>
* Validate config-provided CenterID against the psc table in getPSC * Validate config CenterID and finish removing MRI_alias from Perl * shorten comment section * address Nics comments: generate associated .md file for documentation changes in MRI.pm file. better validation strategy with PSCOB class rather than database check. Improved order of code for readability in tarchiveLoader.pl
* add a few test plans * fix typo
* add dicom and bids importer documentation * fix whoopsie
Co-authored-by: cmadjar <lorisadmin@cbrain.mcgill.ca>
… generate Python config file. (aces#1477) * fix old file name * fix macos
* fix PosixPath error when running push to s3 script * fix startswith s3:/ and return from remove empty directory if path does not exists on the file system * check if directory exists before calling remove_empty_directory instead of inside the function
MaximeBICMTL
force-pushed
the
improve-env-object
branch
from
August 6, 2026 08:26
9430525 to
8c13937
Compare
cmadjar
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a preparatory PR for the LORIS Python server, but that is still valuable on its own.
Description
Improve the flexibility of the
Envobject with the following two changes:env.close()method to manually close anenvobject, which closes its database connections and delete its temporary directory. It is not necessary to manually call this method in the current LORIS Python pipelines as they only use a single long-lived environment, but it is required for the Python server that manages many short-livedenvobjects (one per request).log_file: bool = Trueparameter tomake_env(), which determines if the environment should create its own log file. We currently do so for our pipelines, but we certainly don't want to for the Python server, where we likely prefer to rely on the more standard Linux system logs.