(*, storage_options, store, chunk_store)
| 47 | |
| 48 | |
| 49 | def _get_mappers(*, storage_options, store, chunk_store): |
| 50 | # expand str and path-like arguments |
| 51 | store = _normalize_path(store) |
| 52 | chunk_store = _normalize_path(chunk_store) |
| 53 | |
| 54 | kwargs = {} |
| 55 | if storage_options is None: |
| 56 | mapper = store |
| 57 | chunk_mapper = chunk_store |
| 58 | else: |
| 59 | if not isinstance(store, str): |
| 60 | raise ValueError( |
| 61 | f"store must be a string to use storage_options. Got {type(store)}" |
| 62 | ) |
| 63 | |
| 64 | if _zarr_v3(): |
| 65 | kwargs["storage_options"] = storage_options |
| 66 | mapper = store |
| 67 | chunk_mapper = chunk_store |
| 68 | else: |
| 69 | from fsspec import get_mapper |
| 70 | |
| 71 | mapper = get_mapper(store, **storage_options) |
| 72 | if chunk_store is not None: |
| 73 | chunk_mapper = get_mapper(chunk_store, **storage_options) |
| 74 | else: |
| 75 | chunk_mapper = chunk_store |
| 76 | return kwargs, mapper, chunk_mapper |
| 77 | |
| 78 | |
| 79 | def _choose_default_mode( |
no test coverage detected
searching dependent graphs…