Skip to content

Commit d37820a

Browse files
committed
Improve store section in migration guide
1 parent fe42655 commit d37820a

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

docs/user-guide/v3_migration.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,51 +117,48 @@ The following sections provide details on breaking changes in Zarr-Python 3.
117117

118118
### The Store class
119119

120-
The Store API has changed significant in Zarr-Python 3. The most notable changes to the
121-
Store API are:
120+
The Store API has changed significant in Zarr-Python 3.
122121

123-
#### Store Import Paths
122+
#### The base store class
124123

125-
Several store implementations have moved from the top-level module to `zarr.storage`:
124+
The `MutableMapping` base class has been replaced in favor of a custom abstract base class ([`zarr.abc.store.Store`][]).
125+
An asynchronous interface is used for all store methods that use I/O.
126+
This change ensures that all store methods are non-blocking and are as performant as possible.
127+
128+
#### Store implementations
129+
130+
Store implementations have moved from the top-level module to `zarr.storage`:
126131

127132
```diff title="Store import changes from v2 to v3"
128133
# Before (v2)
129-
- from zarr import MemoryStore, DirectoryStore
130-
+ from zarr.storage import MemoryStore, LocalStore # LocalStore replaces DirectoryStore
134+
- from zarr import MemoryStore
135+
+ from zarr.storage import MemoryStore
131136
```
132137

133-
Common replacements:
138+
The following stores have been renamed or changed:
134139

135-
| v2 Import | v3 Import |
136-
|-------------------------|------------------------------------|
137-
| `zarr.MemoryStore` | [`zarr.storage.MemoryStore`][] |
138-
| `zarr.DirectoryStore` | [`zarr.storage.LocalStore`][] |
139-
| `zarr.TempStore` | Use [`tempfile.TemporaryDirectory`][] with [`LocalStore`][zarr.storage.LocalStore] |
140+
| v2 | v3 |
141+
|------------------------|------------------------------------|
142+
| `DirectoryStore` | [`zarr.storage.LocalStore`][] |
143+
| `FSStore` | [`zarr.storage.FsspecStore`][] |
144+
| `TempStore` | Use [`tempfile.TemporaryDirectory`][] with [`LocalStore`][zarr.storage.LocalStore] |
145+
| `zarr.
140146
141-
1. Replaced the `MutableMapping` base class in favor of a custom abstract base class
142-
([`zarr.abc.store.Store`][]).
143-
2. Switched to an asynchronous interface for all store methods that result in IO. This
144-
change ensures that all store methods are non-blocking and are as performant as
145-
possible.
146147

147-
Beyond the changes store interface, a number of deprecated stores were also removed in
148-
Zarr-Python 3. See issue #1274 for more details on the removal of these stores.
148+
A number of deprecated stores were also removed.
149+
See issue #1274 for more details on the removal of these stores.
149150

150151
- `N5Store` - see https://github.com/zarr-developers/n5py for an alternative interface to
151152
N5 formatted data.
152153
- `ABSStore` - use the [`zarr.storage.FsspecStore`][] instead along with fsspec's
153154
[adlfs backend](https://github.com/fsspec/adlfs).
154-
155-
The following stores have been removed altogether. Users who need these stores will have to
156-
implement their own version in zarr-python v3.
157-
158155
- `DBMStore`
159156
- `LMDBStore`
160157
- `SQLiteStore`
161158
- `MongoDBStore`
162159
- `RedisStore`
163160

164-
At present, the latter five stores in this list do not have an equivalent in Zarr-Python 3.
161+
The latter five stores in this list do not have an equivalent in Zarr-Python 3.
165162
If you are interested in developing a custom store that targets these backends, see
166163
[developing custom stores](storage.md/#developing-custom-stores) or open an
167164
[issue](https://github.com/zarr-developers/zarr-python/issues) to discuss your use case.

0 commit comments

Comments
 (0)