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

ENH: Accept pathlib.Path objects where filenames are accepted #610

Merged
merged 18 commits into from
Oct 23, 2019

Commits on Mar 15, 2018

  1. 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.
    CRiddler committed Mar 15, 2018
    Configuration menu
    Copy the full SHA
    180fd50 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2018

  1. Configuration menu
    Copy the full SHA
    9835998 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2019

  1. Configuration menu
    Copy the full SHA
    b44c06b View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2019

  1. Configuration menu
    Copy the full SHA
    3346689 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aaf1a19 View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2019

  1. Configuration menu
    Copy the full SHA
    185f82c View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2019

  1. resolve flake8

    CRiddler committed Sep 23, 2019
    Configuration menu
    Copy the full SHA
    e1d78c8 View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2019

  1. testing for pathlib

    CRiddler committed Oct 14, 2019
    Configuration menu
    Copy the full SHA
    d9ce63e View commit details
    Browse the repository at this point in the history
  2. purge basestring

    CRiddler committed Oct 14, 2019
    Configuration menu
    Copy the full SHA
    7887232 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2019

  1. Configuration menu
    Copy the full SHA
    6c0497e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0fff5c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fbaeacc View commit details
    Browse the repository at this point in the history
  4. update _stringify_path doc

    CRiddler committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    6056014 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0cb7c39 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ca10c44 View commit details
    Browse the repository at this point in the history
  7. tests pathlib compatible

    CRiddler committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    e98dbfc View commit details
    Browse the repository at this point in the history
  8. update _stringify_path doc

    CRiddler committed Oct 16, 2019
    Configuration menu
    Copy the full SHA
    6394536 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2019

  1. Fix flake 8 issues

    CRiddler committed Oct 23, 2019
    Configuration menu
    Copy the full SHA
    60a4624 View commit details
    Browse the repository at this point in the history