-
-
Notifications
You must be signed in to change notification settings - Fork 326
Pathlib support #768
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
Pathlib support #768
Conversation
Codecov Report
@@ Coverage Diff @@
## master #768 +/- ##
=======================================
Coverage 99.94% 99.94%
=======================================
Files 29 30 +1
Lines 10568 10586 +18
=======================================
+ Hits 10562 10580 +18
Misses 6 6
|
Interesting. I'd be especially happy if I could attach extra metadata to that ;) see #769 (comment)
Just add to the top. (The mainline may now have an "Unreleased" section at the top) |
Rebased and added documentation to release.rst. Build failures are (I hope) unrelated; a segfault coming from numpy. |
Rebased and green! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, looks good from my side. I've noted one renaming issue on which I'd appreciate thoughts from others.
Now rebased on master; I've also reverted the |
This makes a more obvious contrast opposed to zarr's built-in `Path` type annotation (for internal keys).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the rebase, @clbarnes! To my eye, this is now a very non-invasive widening of what the open methods will accept.
Minor changes to utility functions to allow convenience functions to work with
os.PathLike
s; see #261 and #601. These now just normalise tostr
, which the DirectoryStore was doing explicitly before anyway. It might be nice to avoid that and for thepath
member of things containing a path to store (/return) it as aPath
, but that was a more invasive change; the main value here is avoiding the errors.One module defined a
Path
newtype for typing purposes; I renamed that toPathType
for clarity.I found it a little confusing to see "path" used to describe zarr's internal keys; looking through the code, you have to get whether it's talking about key or e.g. file system path from context. Would changing that verbiage be considered in an upcoming major version increment? Another "going forward" thought: it's a bit of a pain/ source of errors to manipulate path-like things as strings, which is why pathlib exists. Would you consider something like
for internal use to begin with? On the flip side, we'd need to be more careful about
os.PathLike
checks, but there are only a couple in there.Lastly, where in
release.rst
do new features go? There doesn't seem to be an entry for "current release" features.TODO: