-
-
Notifications
You must be signed in to change notification settings - Fork 387
Closed
Description
Strictly, anything which doesn't cause os.fspath to raise a TypeError.
Minimal, reproducible code sample, a copy-pastable example if possible
import zarr
from pathlib import Path
path_str = "path/to/array.zarr"
zarr.open(path_str) # works fine
zarr.open(Path(path_str)) # fails with TypeError because it's not a str and not iterableProblem description
pathlib is great and everyone should use it whenever appropriate. Personally, I even subclass PurePosixPath for manipulations of object names inside hdf5/ zarr/ n5 containers.
People with zarr objects on the file system should want to use Paths to refer to them, so zarr should support people doing so.
This should just be a case of trying os.fspath on the store/path argument(s) for most of the functions in convenience.
Version and installation information
Please provide the following:
- Value of
zarr.__version__: 2.4.0 - Value of
numcodecs.__version__: 0.6.4 - Version of Python interpreter: 3.8.5
- Operating system (Linux/Windows/Mac): Linux
- How Zarr was installed (e.g., "using pip into virtual environment", or "using conda"): pip in virtual environment
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels