Skip to content

Commit

Permalink
fix: handle Path objects correctly when checking store (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol-G committed Mar 20, 2024
1 parent cc774d5 commit e1ba34b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mzarr/mzarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import Optional, List, Union, Literal, Any
import os
import numcodecs
from pathlib import Path


numcodecs.register_codec(JpegXl)
Expand All @@ -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]:
Expand Down

0 comments on commit e1ba34b

Please sign in to comment.