8000 DOC: Add store import changes to v3 migration guide (fix #2733) (#2883) · tomwhite/zarr-python@73d5a6c · GitHub
[go: up one dir, main page]

Skip to content

Commit 73d5a6c

Browse files
OPMTerradstansby
andauthored
DOC: Add store import changes to v3 migration guide (fix zarr-developers#2733) (zarr-developers#2883)
* DOC: Add store import changes to v3 migration guide (fix zarr-developers#2733) * Update docs/user-guide/v3_migration.rst Adjust heading level per review feedback Co-authored-by: David Stansby <dstansby@gmail.com> --------- Co-authored-by: David Stansby <dstansby@gmail.com>
1 parent fae8fb9 commit 73d5a6c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/user-guide/v3_migration.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,30 @@ The Store class
124124
The Store API has changed significant in Zarr-Python 3. The most notable changes to the
125125
Store API are:
126126

127+
Store Import Paths
128+
^^^^^^^^^^^^^^^^^^
129+
Several store implementations have moved from the top-level module to ``zarr.storage``:
130+
131+
.. code-block:: diff
132+
:caption: Store import changes from v2 to v3
133+
134+
# Before (v2)
135+
- from zarr import MemoryStore, DirectoryStore
136+
+ from zarr.storage import MemoryStore, LocalStore # LocalStore replaces DirectoryStore
137+
138+
Common replacements:
139+
140+
+-------------------------+------------------------------------+
141+
| v2 Import | v3 Import |
142+
+=========================+====================================+
143+
| ``zarr.MemoryStore`` | ``zarr.storage.MemoryStore`` |
144+
+-------------------------+------------------------------------+
145+
| ``zarr.DirectoryStore`` | ``zarr.storage.LocalStore`` |
146+
+-------------------------+------------------------------------+
147+
| ``zarr.TempStore`` | Use ``tempfile.TemporaryDirectory``|
148+
| | with ``LocalStore`` |
149+
+-------------------------+------------------------------------+
150+
127151
1. Replaced the ``MutableMapping`` base class in favor of a custom abstract base class
128152
(:class:`zarr.abc.store.Store`).
129153
2. Switched to an asynchronous interface for all store methods that result in IO. This

0 commit comments

Comments
 (0)
0