You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,7 +46,7 @@ Now create the Zarr array you will write to.
46
46
import zarr
47
47
48
48
zarr_chunks = (10, 10)
49
-
group = zarr.group(store=icechunk_session.store, overwrite=True)
49
+
group = zarr.group(store=session.store, overwrite=True)
50
50
51
51
zarray = group.create_array(
52
52
"array",
@@ -55,74 +55,41 @@ zarray = group.create_array(
55
55
dtype="f8",
56
56
fill_value=float("nan"),
57
57
)
58
+
session.commit("initialize array")
58
59
```
59
60
60
61
Note that the chunks in the store are a divisor of the Cubed chunks. This means each individual write task is independent, and will not conflict. It is your responsibility to ensure that such conflicts are avoided.
61
62
62
-
Now write
63
+
First remember to fork the session before re-opening the Zarr array. `store_icechunk` will merge all the remote write sessions on the cluster before returning back a single merged `ForkSession`.
In distributed contexts where the Session, and Zarr Array objects are sent across the network, you must opt-in to successful pickling of a writable store.
91
-
`cubed.icechunk.store_icechunk` takes care of the hard bit of merging Sessions but it is required that you opt-in to pickling prior to creating the target Zarr array objects.
89
+
## Read from Icechunk
92
90
93
-
Here is an example:
91
+
Use {py:func}`cubed.from_zarr` to read from Icechunk - note that no special Icechunk-specific function is needed in this case.
94
92
95
93
```{code-cell} ipython3
96
-
from cubed import config
97
-
98
-
# start a new session. Old session is readonly after committing
0 commit comments