core
tuplify_json #
Recursively converts lists within a Python object to tuples.
Source code in pydantic_zarr/experimental/core.py
parse_dtype_v2 #
Convert the input to a NumPy dtype and either return the str attribute of that
object or, if the dtype is a structured dtype, return the fields of that dtype as a list
of tuples.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
DTypeLike
|
A value that can be converted to a NumPy dtype. |
required |
Returns:
| Type | Description |
|---|---|
A Zarr V2-compatible encoding of the dtype.
|
|
References
See the Zarr V2 specification for more details on this encoding of data types.
Source code in pydantic_zarr/experimental/core.py
ensure_member_name #
If the input is a string, then ensure that it is a valid name for a subnode in a zarr group
Source code in pydantic_zarr/experimental/core.py
model_like #
A similarity check for a pair pydantic.BaseModel, parametrized over included or excluded fields.
Source code in pydantic_zarr/experimental/core.py
maybe_node #
Return the array or group found at the store / path, if an array or group exists there. Otherwise return None.
Source code in pydantic_zarr/experimental/core.py
ensure_multiple #
Ensure that there is at least one element in the sequence
json_eq #
An equality check between python objects that recurses into dicts and sequences and ignores the difference between tuples and lists. Otherwise, it's just regular equality. Useful for comparing dicts that would become identical JSON, but where one has lists and the other has tuples.