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

Support pathlib paths in NWBHDF5IO #1314

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

dsleiter
Copy link
Contributor

@dsleiter dsleiter commented Nov 6, 2020

Motivation

Fix #1303: support pathlib.Path paths when opening NWBHDF5IO objects.

Pathlib paths will be supported in the next release of hdmf (hdmf-dev/hdmf#450). This WIP PR updates pynwb to support this enhancement, and can be merged in after the next hdmf release and pip requirements are updated.

How to test the behavior?

from pathlib import Path
from pynwb import NWBHDF5IO

filepath = Path('foo.nwb')
with NWBHDF5IO(filepath, mode='w') as io:
    nwbfile = io.read()

Checklist

  • Have you checked our Contributing document?
  • Have you ensured the PR description clearly describes problem and the solution?
  • Is your contribution compliant with our coding style? This can be checked running flake8 from the source directory.
  • Have you checked to ensure that there aren't other open Pull Requests for the same change?
  • Have you included the relevant issue number using #XXX notation where XXX is the issue number?

* Fix NeurodataWithoutBorders#1303
* Ref hdmf-dev/hdmf#439
* This will require the next release of `hdmf` before the enhancement is ready
* Support pathlib.Path as path parameter in NWBHDF5IO.__init__
* Add new tests for loading NWBHDF5IO with both pathlib paths and path strings
@dsleiter dsleiter changed the title [WIP] Support pathlib paths in NWBHDF5IO Support pathlib paths in NWBHDF5IO Dec 14, 2020
@rly
Copy link
Contributor

rly commented Dec 15, 2020

Looks good. Thanks @dsleiter . The miniconda3.6 test is failing due to a separate issue which will be resolved in a separate PR.

@rly rly merged commit 9d32f5e into NeurodataWithoutBorders:dev Dec 15, 2020
@dsleiter dsleiter deleted the enh/support_pathlib branch December 15, 2020 21:56
@dsleiter
Copy link
Contributor Author

Ok, thanks for taking a look at the failing test issue @rly and for the review!

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.

Pathlib support in NWBHDF5IO
2 participants