-
Notifications
You must be signed in to change notification settings - Fork 257
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
ENH: Accept pathlib.Path objects where filenames are accepted #610
Merged
Commits on Mar 15, 2018
-
load save with pathlib.Path objects
For python >= 3.6, objects representing paths now have the option to have a dunder `__fspath__` (See PEP 519 for more info) to return the string (or bytes) representation of the path. Pathlib on 3.6 includes this method so we should check for it first. Then, for pathlib objects from the py 3.4-3.5x, `__fspath__` is not available, so we dip into the py3k module to get the current python version's (2 or 3) string method (`unicode` in this case). So overall we're allowing filename to be a path object, but ensuring that it will be converted to the string/bytes representation of the path before passing it on to `image_klass.from_filename` My only reservations is that `nib.load` lowest entry point for this type of handling, because if some one really wants to call `from_filename` from an image_klass directly, they won't have this pathlib compatibility- however I think that `nib.load` is a very common entry point, which justifies the placement.
Configuration menu - View commit details
-
Copy full SHA for 180fd50 - Browse repository at this point
Copy the full SHA 180fd50View commit details
Commits on Jun 13, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 9835998 - Browse repository at this point
Copy the full SHA 9835998View commit details
Commits on Aug 19, 2019
-
Configuration menu - View commit details
-
Copy full SHA for b44c06b - Browse repository at this point
Copy the full SHA b44c06bView commit details
Commits on Sep 16, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 3346689 - Browse repository at this point
Copy the full SHA 3346689View commit details -
Configuration menu - View commit details
-
Copy full SHA for aaf1a19 - Browse repository at this point
Copy the full SHA aaf1a19View commit details
Commits on Sep 17, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 185f82c - Browse repository at this point
Copy the full SHA 185f82cView commit details
Commits on Sep 23, 2019
-
Configuration menu - View commit details
-
Copy full SHA for e1d78c8 - Browse repository at this point
Copy the full SHA e1d78c8View commit details
Commits on Oct 14, 2019
-
Configuration menu - View commit details
-
Copy full SHA for d9ce63e - Browse repository at this point
Copy the full SHA d9ce63eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7887232 - Browse repository at this point
Copy the full SHA 7887232View commit details
Commits on Oct 16, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 6c0497e - Browse repository at this point
Copy the full SHA 6c0497eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e0fff5c - Browse repository at this point
Copy the full SHA e0fff5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for fbaeacc - Browse repository at this point
Copy the full SHA fbaeaccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6056014 - Browse repository at this point
Copy the full SHA 6056014View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cb7c39 - Browse repository at this point
Copy the full SHA 0cb7c39View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca10c44 - Browse repository at this point
Copy the full SHA ca10c44View commit details -
Configuration menu - View commit details
-
Copy full SHA for e98dbfc - Browse repository at this point
Copy the full SHA e98dbfcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6394536 - Browse repository at this point
Copy the full SHA 6394536View commit details
Commits on Oct 23, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 60a4624 - Browse repository at this point
Copy the full SHA 60a4624View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.