diff --git a/mzarr/mzarr.py b/mzarr/mzarr.py index 8533bd6..990b9e3 100644 --- a/mzarr/mzarr.py +++ b/mzarr/mzarr.py @@ -6,6 +6,7 @@ from typing import Optional, List, Union, Literal, Any import os import numcodecs +from pathlib import Path numcodecs.register_codec(JpegXl) @@ -32,7 +33,7 @@ def __init__(self, store: Union[np.ndarray, str], mode: Literal['r', 'r+', 'a', self.store = None self.array = None - if isinstance(store, str): + if isinstance(store, str) or isinstance(store, Path): self.load(store, mode) else: if store.dtype in [np.uint8, np.uint16, np.float16, np.float32]: