Skip to content

Conversation

@MaximeBICMTL
Copy link
Contributor

@MaximeBICMTL MaximeBICMTL commented Nov 21, 2025

Extracted from #1325

Description

The BIDS importer refactor changes path manipulation from string concatenation (which is a very fragile way of doing things, notably as it is very sensible to trailing slashes) to pathlib.Path or os.path functions and methods. Unfortunately, doing so also requires to update EEG code to this new technique as string-based path manipulation does not work with modern paths (because of the absence of trailing slashes).

Details

  • Use os.path.join in EEG code instead of string concatenation.
  • Use os.path.relpath in EEG code instead of string replacement.
  • Store paths in a list instead of a growing tuple.

@github-actions github-actions bot added the Language: Python Issue or PR related to the Python codebase label Nov 21, 2025
@MaximeBICMTL MaximeBICMTL added Category: Refactor Issue or PR that aims to improve the existing code Complexity: Simple Issue or PR that should be simple to implement, review, or test Pipeline: BIDS importer PR or issue related to the BIDS importer Language: Python Issue or PR related to the Python codebase and removed Language: Python Issue or PR related to the Python codebase labels Nov 21, 2025
@MaximeBICMTL MaximeBICMTL changed the title Use os.path.join in EEG Use os.path instead of string operations in EEG Nov 21, 2025
@MaximeBICMTL MaximeBICMTL removed the Complexity: Simple Issue or PR that should be simple to implement, review, or test label Nov 21, 2025
Copy link
Contributor

@jeffersoncasimir jeffersoncasimir left a comment

Choose a reason for hiding this comment

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

Tested and works as expected!

@MaximeBICMTL MaximeBICMTL added the Complexity: Medium Issue or PR that requires a moderate effort or expertise to implement, review, or test label Nov 22, 2025
@MaximeBICMTL MaximeBICMTL force-pushed the use_path_join_in_eeg branch 2 times, most recently from 39b2ffe to c3588b4 Compare November 27, 2025 05:34
@cmadjar cmadjar merged commit 4ac4cb6 into aces:main Nov 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Refactor Issue or PR that aims to improve the existing code Complexity: Medium Issue or PR that requires a moderate effort or expertise to implement, review, or test Language: Python Issue or PR related to the Python codebase Pipeline: BIDS importer PR or issue related to the BIDS importer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants