Skip to content

ENH: Allow path-like objects for tractogram load/saving #1421

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhlegarreta
Copy link
Contributor

Allow path-like objects for tractogram load/saving.

Crucially, this patch set uses the capabilities of pathlib.Path to get the suffix of a filename when detecing the format instead of relying on the splitext function of the os.path module, which requires a str instance.

Add the corresponding tests.

Change the docstrings to mark the types of the filenames as path-like objects instead of only str objects.

Copy link

codecov bot commented Jul 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.34%. Comparing base (b5ecf48) to head (92e8cb2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1421   +/-   ##
=======================================
  Coverage   95.34%   95.34%           
=======================================
  Files         209      209           
  Lines       29780    29801   +21     
  Branches     3357     3361    +4     
=======================================
+ Hits        28393    28414   +21     
  Misses        948      948           
  Partials      439      439           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jhlegarreta jhlegarreta force-pushed the AllowPathlikeTractogramLoadSave branch from 5254601 to e263641 Compare July 5, 2025 21:40
Allow path-like objects for tractogram load/saving.

Crucially, this patch set uses the capabilities of `pathlib.Path` to get
the suffix of a filename when detecing the format instead of relying on
the `splitext` function of the `os.path` module, which requires a `str`
instance.

Add the corresponding tests.

Change the docstrings to mark the types of the filenames as `path-like`
objects instead of only `str` objects.
@jhlegarreta jhlegarreta force-pushed the AllowPathlikeTractogramLoadSave branch from e263641 to 92e8cb2 Compare July 5, 2025 21:49
@jhlegarreta
Copy link
Contributor Author

jhlegarreta commented Jul 5, 2025

Style errors predated this PR. Addressed in PR #1423.
Type checking errors predated this PR. Addressed in PR #1424.

@jhlegarreta
Copy link
Contributor Author

@effigies this is ready to be merged.

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.

1 participant