You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently started using Python 3's built-in pathlib module (introduced in PEP 428 for path managing in my projects and I really like it.
I thought that it would be nice if nibabel accepted PathLike objects as filenames, instead of only str or whatever the current behaviour is.
In my code I use wrappers for nib.load and nib.save that always transform the filename argument to str. That might be naive, but it seems to work. As a reference, matplotlib uses os.fspath if the filename argument is PathLike.
The text was updated successfully, but these errors were encountered:
I have recently started using Python 3's built-in
pathlib
module (introduced in PEP 428 for path managing in my projects and I really like it.I thought that it would be nice if
nibabel
acceptedPathLike
objects as filenames, instead of onlystr
or whatever the current behaviour is.In my code I use wrappers for
nib.load
andnib.save
that always transform thefilename
argument tostr
. That might be naive, but it seems to work. As a reference,matplotlib
usesos.fspath
if the filename argument isPathLike
.The text was updated successfully, but these errors were encountered: