Skip to content

Commit 9ee608b

Browse files
committed
Replace more instances of group()
1 parent 1ba9ad5 commit 9ee608b

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

docs/developers/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ a bug report:
3131

3232
```python
3333
import zarr
34-
g = zarr.group()
34+
g = zarr.create_group(store={})
3535
# etc.
3636
```
3737

docs/quickstart.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Hierarchical Groups
9898
Zarr allows you to create hierarchical groups, similar to directories::
9999

100100
>>> # Create nested groups and add arrays
101-
>>> root = zarr.group("data/example-2.zarr")
101+
>>> root = zarr.create_group("data/example-2.zarr")
102102
>>> foo = root.create_group(name="foo")
103103
>>> bar = root.create_array(
104104
... name="bar", shape=(100, 10), chunks=(10, 10), dtype="f4"
@@ -126,7 +126,7 @@ Zarr provides tools for creating a collection of arrays and groups with a single
126126
Suppose we want to copy existing groups and arrays into a new storage backend:
127127

128128
>>> # Create nested groups and add arrays
129-
>>> root = zarr.group("data/example-3.zarr", attributes={'name': 'root'})
129+
>>> root = zarr.create_group("data/example-3.zarr", attributes={'name': 'root'})
130130
>>> foo = root.create_group(name="foo")
131131
>>> bar = root.create_array(
132132
... name="bar", shape=(100, 10), chunks=(10, 10), dtype="f4"

docs/user-guide/groups.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Diagnostic information about arrays and groups is available via the ``info``
107107
property. E.g.::
108108

109109
>>> store = zarr.storage.MemoryStore()
110-
>>> root = zarr.group(store=store)
110+
>>> root = zarr.create_group(store=store)
111111
>>> foo = root.create_group('foo')
112112
>>> bar = foo.create_array(name='bar', shape=1000000, chunks=100000, dtype='int64')
113113
>>> bar[:] = 42

src/zarr/core/group.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ def __iter__(self) -> Iterator[str]:
19691969
Examples
19701970
--------
19711971
>>> import zarr
1972-
>>> g1 = zarr.group()
1972+
>>> g1 = zarr.create_group(store={})
19731973
>>> g2 = g1.create_group('foo')
19741974
>>> g3 = g1.create_group('bar')
19751975
>>> d1 = g1.create_array('baz', shape=(10,), chunks=(10,))
@@ -2003,7 +2003,7 @@ def __setitem__(self, key: str, value: Any) -> None:
20032003
Examples
20042004
--------
20052005
>>> import zarr
2006-
>>> group = zarr.group()
2006+
>>> group = zarr.create_group(store={})
20072007
>>> group["foo"] = zarr.zeros((10,))
20082008
>>> group["foo"]
20092009
<Array memory://132270269438272/foo shape=(10,) dtype=float64>
@@ -2019,7 +2019,7 @@ async def update_attributes_async(self, new_attributes: dict[str, Any]) -> Group
20192019
Examples
20202020
--------
20212021
>>> import zarr
2022-
>>> group = zarr.group()
2022+
>>> group = zarr.create_group(store={})
20232023
>>> await group.update_attributes_async({"foo": "bar"})
20242024
>>> group.attrs.asdict()
20252025
{'foo': 'bar'}
@@ -2120,7 +2120,7 @@ def update_attributes(self, new_attributes: dict[str, Any]) -> Group:
21202120
Examples
21212121
--------
21222122
>>> import zarr
2123-
>>> group = zarr.group()
2123+
>>> group = zarr.create_group(store={})
21242124
>>> group.update_attributes({"foo": "bar"})
21252125
>>> group.attrs.asdict()
21262126
{'foo': 'bar'}
@@ -2245,7 +2245,7 @@ def keys(self) -> Generator[str, None]:
22452245
Examples
22462246
--------
22472247
>>> import zarr
2248-
>>> g1 = zarr.group()
2248+
>>> g1 = zarr.create_group(store={})
22492249
>>> g2 = g1.create_group('foo')
22502250
>>> g3 = g1.create_group('bar')
22512251
>>> d1 = g1.create_array('baz', shape=(10,), chunks=(10,))
@@ -2265,7 +2265,7 @@ def __contains__(self, member: str) -> bool:
22652265
Examples
22662266
--------
22672267
>>> import zarr
2268-
>>> g1 = zarr.group()
2268+
>>> g1 = zarr.create_group(store={})
22692269
>>> g2 = g1.create_group('foo')
22702270
>>> d1 = g1.create_array('bar', shape=(10,), chunks=(10,))
22712271
>>> 'foo' in g1
@@ -2284,7 +2284,7 @@ def groups(self) -> Generator[tuple[str, Group], None]:
22842284
Examples
22852285
--------
22862286
>>> import zarr
2287-
>>> group = zarr.group()
2287+
>>> group = zarr.create_group(store={})
22882288
>>> group.create_group("subgroup")
22892289
>>> for name, subgroup in group.groups():
22902290
... print(name, subgroup)
@@ -2299,7 +2299,7 @@ def group_keys(self) -> Generator[str, None]:
22992299
Examples
23002300
--------
23012301
>>> import zarr
2302-
>>> group = zarr.group()
2302+
>>> group = zarr.create_group(store={})
23032303
>>> group.create_group("subgroup")
23042304
>>> for name in group.group_keys():
23052305
... print(name)
@@ -2314,7 +2314,7 @@ def group_values(self) -> Generator[Group, None]:
23142314
Examples
23152315
--------
23162316
>>> import zarr
2317-
>>> group = zarr.group()
2317+
>>> group = zarr.create_group(store={})
23182318
>>> group.create_group("subgroup")
23192319
>>> for subgroup in group.group_values():
23202320
... print(subgroup)
@@ -2329,7 +2329,7 @@ def arrays(self) -> Generator[tuple[str, Array], None]:
23292329
Examples
23302330
--------
23312331
>>> import zarr
2332-
>>> group = zarr.group()
2332+
>>> group = zarr.create_group(store={})
23332333
>>> group.create_array("subarray", shape=(10,), chunks=(10,))
23342334
>>> for name, subarray in group.arrays():
23352335
... print(name, subarray)
@@ -2344,7 +2344,7 @@ def array_keys(self) -> Generator[str, None]:
23442344
Examples
23452345
--------
23462346
>>> import zarr
2347-
>>> group = zarr.group()
2347+
>>> group = zarr.create_group(store={})
23482348
>>> group.create_array("subarray", shape=(10,), chunks=(10,))
23492349
>>> for name in group.array_keys():
23502350
... print(name)
@@ -2360,7 +2360,7 @@ def array_values(self) -> Generator[Array, None]:
23602360
Examples
23612361
--------
23622362
>>> import zarr
2363-
>>> group = zarr.group()
2363+
>>> group = zarr.create_group(store={})
23642364
>>> group.create_array("subarray", shape=(10,), chunks=(10,))
23652365
>>> for subarray in group.array_values():
23662366
... print(subarray)
@@ -2405,7 +2405,7 @@ def create_group(self, name: str, **kwargs: Any) -> Group:
24052405
Examples
24062406
--------
24072407
>>> import zarr
2408-
>>> group = zarr.group()
2408+
>>> group = zarr.create_group(store={})
24092409
>>> subgroup = group.create_group("subgroup")
24102410
>>> subgroup
24112411
<Group memory://132270269438272/subgroup>

0 commit comments

Comments
 (0)