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
Copy file name to clipboardExpand all lines: docs/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ print(spec.dict())
22
22
{
23
23
'zarr_version': 2,
24
24
'attrs': {},
25
-
'items': {
25
+
'members': {
26
26
'bar': {
27
27
'zarr_version': 2,
28
28
'attrs': {'metadata': 'hello'},
@@ -68,11 +68,11 @@ Note the use of the term "schematized": Zarr arrays also represent N-dimensional
68
68
Accordingly, in `pydantic-zarr`, Zarr groups are encoded by the `GroupSpec` class with two fields:
69
69
70
70
-`GroupSpec.attrs`: either a `Mapping` or a `pydantic.BaseModel`.
71
-
-`GroupSpec.items`: a mapping with string keys and values that must be `GroupSpec` or `ArraySpec` instances.
71
+
-`GroupSpec.members`: a mapping with string keys and values that must be `GroupSpec` or `ArraySpec` instances.
72
72
73
73
Zarr arrays are represented by the `ArraySpec` class, which has a similar `attrs` field, as well as fields for all the Zarr array properties (`dtype`, `shape`, `chunks`, etc).
74
74
75
-
`GroupSpec` and `ArraySpec` are both [generic models](https://docs.pydantic.dev/1.10/usage/models/#generic-models). `GroupSpec` takes two type parameters, the first specializing the type of `GroupSpec.attrs`, and the second specializing the type of the *values* of `GroupSpec.items` (they keys of `GroupSpec.items` are always strings). `ArraySpec` only takes one type parameter, which specializes the type of `ArraySpec.attrs`.
75
+
`GroupSpec` and `ArraySpec` are both [generic models](https://docs.pydantic.dev/1.10/usage/models/#generic-models). `GroupSpec` takes two type parameters, the first specializing the type of `GroupSpec.attrs`, and the second specializing the type of the *values* of `GroupSpec.items` (the keys of `GroupSpec.members` are strings). `ArraySpec` only takes one type parameter, which specializes the type of `ArraySpec.attrs`.
76
76
77
77
Examples using this generic typing functionality can be found in the [usage guide](usage.md#using-generic-types).
0 commit comments