Skip to content

Commit

Permalink
Support Pathlib
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Aug 20, 2024
1 parent 7283d9f commit 9849449
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/hdmf_zarr/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
from hdmf.query import HDMFDataset
from hdmf.container import Container

from pathlib import Path


# Module variables
ROOT_NAME = 'root'
"""
Expand Down Expand Up @@ -84,7 +87,7 @@ def can_read(path):
return False

@docval({'name': 'path',
'type': (str, *SUPPORTED_ZARR_STORES),
'type': (str, Path, *SUPPORTED_ZARR_STORES),
'doc': 'the path to the Zarr file or a supported Zarr store'},
{'name': 'manager', 'type': BuildManager, 'doc': 'the BuildManager to use for I/O', 'default': None},
{'name': 'mode', 'type': str,
Expand Down Expand Up @@ -115,6 +118,8 @@ def __init__(self, **kwargs):
else:
self.__synchronizer = synchronizer
self.__mode = mode
if isinstance(path, Path):
path = str(path)
self.__path = path
self.__file = None
self.__storage_options = storage_options
Expand Down Expand Up @@ -195,7 +200,7 @@ def is_remote(self):
'type': (NamespaceCatalog, TypeMap),
'doc': 'the NamespaceCatalog or TypeMap to load namespaces into'},
{'name': 'path',
'type': (str, *SUPPORTED_ZARR_STORES),
'type': (str, Path, *SUPPORTED_ZARR_STORES),
'doc': 'the path to the Zarr file or a supported Zarr store'},
{'name': 'storage_options', 'type': dict,
'doc': 'Zarr storage options to read remote folders',
Expand Down

0 comments on commit 9849449

Please sign in to comment.