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

Fix bug in make_nifti method to handle Path objects correctly #333

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

mcsitter
Copy link
Contributor

@mcsitter mcsitter commented Jan 28, 2025

This pull request includes a bug fix in the pypet2bids/ecat.py file and I added myself to the contributors.md file.

I modified the make_nifti method to correctly check if the output file name ends with "nii.gz" using pathlib.Path(output).name instead of checking the entire path string. Since pathlib.Path objects are not iterable, the "nii.gz" not in output check would otherwise throw a TypeError, if output is not a string but a Path object. Since providing the nifti_file as a pathlib.Path object does not throw errors in other places of the code, at least when running .convert(), I considered this a bug.


📚 Documentation preview 📚: https://pet2bids--333.org.readthedocs.build/en/333/

@bendhouseart bendhouseart self-requested a review January 28, 2025 20:33
Copy link
Contributor

@bendhouseart bendhouseart left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks! I went ahead and did some significant refactoring just now. I would ask that you re-sync your main branch and merge it into mcsitter:path-1. Will hit the squash and merge as soon as that's taken care of.

@bendhouseart
Copy link
Contributor

Actually that shouldn't matter, it's two small changes. I'm going to send it.

@bendhouseart bendhouseart merged commit 6d17a83 into openneuropet:main Jan 28, 2025
8 of 10 checks passed
@mcsitter mcsitter deleted the patch-1 branch January 31, 2025 09:43
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.

2 participants