Skip to content

Improve env object for more flexible lifecyle - #1478

Merged
cmadjar merged 20 commits into
aces:mainfrom
MaximeBICMTL:improve-env-object
Aug 10, 2026
Merged

Improve env object for more flexible lifecyle#1478
cmadjar merged 20 commits into
aces:mainfrom
MaximeBICMTL:improve-env-object

Conversation

@MaximeBICMTL

@MaximeBICMTL MaximeBICMTL commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This is a preparatory PR for the LORIS Python server, but that is still valuable on its own.

Description

Improve the flexibility of the Env object with the following two changes:

  • Add an env.close() method to manually close an env object, 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-lived env objects (one per request).
  • Add an optional log_file: bool = True parameter to make_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.

MaximeBICMTL and others added 19 commits June 23, 2026 11:54
* fix bids scans matching

* integration test and fix scans path bug

* add line that i forgot
* 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 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
@github-actions github-actions Bot added Language: Perl Issue or PR related to the Perl codebase Language: Python Issue or PR related to the Python codebase Package: BIDS importer PR or issue related to the BIDS importer Package: Utilities PR or issue related to the LORIS-agnostic utilities Package: BIDS utilities PR or issue related to the BIDS utilities labels Jul 22, 2026
@MaximeBICMTL MaximeBICMTL added Category: Feature Issue or PR that aims to introduce a new feature and removed Language: Perl Issue or PR related to the Perl codebase Language: Python Issue or PR related to the Python codebase Package: BIDS importer PR or issue related to the BIDS importer Package: Utilities PR or issue related to the LORIS-agnostic utilities Package: BIDS utilities PR or issue related to the BIDS utilities labels Jul 22, 2026
@MaximeBICMTL MaximeBICMTL added this to the 30.0.0 milestone Jul 22, 2026
@MaximeBICMTL MaximeBICMTL added the Complexity: Medium Issue or PR that requires a moderate effort or expertise to implement, review, or test label Jul 22, 2026
@github-actions github-actions Bot added Language: Perl Issue or PR related to the Perl codebase Language: Python Issue or PR related to the Python codebase Package: BIDS importer PR or issue related to the BIDS importer Package: Utilities PR or issue related to the LORIS-agnostic utilities Package: BIDS utilities PR or issue related to the BIDS utilities labels Aug 6, 2026
@cmadjar cmadjar closed this Aug 10, 2026
@cmadjar cmadjar reopened this Aug 10, 2026
@cmadjar
cmadjar merged commit bf64609 into aces:main Aug 10, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Feature Issue or PR that aims to introduce a new feature Complexity: Medium Issue or PR that requires a moderate effort or expertise to implement, review, or test Language: Perl Issue or PR related to the Perl codebase Language: Python Issue or PR related to the Python codebase Package: BIDS importer PR or issue related to the BIDS importer Package: BIDS utilities PR or issue related to the BIDS utilities Package: Utilities PR or issue related to the LORIS-agnostic utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants