This commit is contained in:
sneakers-the-rat 2024-09-20 23:58:40 -07:00
parent b436d8d592
commit 02855852b7
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D

View file

@ -170,19 +170,21 @@ class ZarrInterface(Interface):
) -> list | ZarrJsonDict: ) -> list | ZarrJsonDict:
""" """
Dump a Zarr Array to JSON Dump a Zarr Array to JSON
If ``info.round_trip == False``, dump the array as a list of lists. If ``info.round_trip == False``, dump the array as a list of lists.
This may be a memory-intensive operation. This may be a memory-intensive operation.
Otherwise, dump the metadata for an array from :meth:`zarr.core.Array.info_items` Otherwise, dump the metadata for an array from
:meth:`zarr.core.Array.info_items`
plus the :meth:`zarr.core.Array.hexdigest` as a :class:`.ZarrJsonDict` plus the :meth:`zarr.core.Array.hexdigest` as a :class:`.ZarrJsonDict`
If either the ``zarr_dump_array`` value in the context dictionary is ``True`` If either the ``zarr_dump_array`` value in the context dictionary is ``True``
or the zarr array is an in-memory array, dump the array as well or the zarr array is an in-memory array, dump the array as well
(since without a persistent array it would be impossible to roundtrip and (since without a persistent array it would be impossible to roundtrip and
dumping to JSON would be meaningless) dumping to JSON would be meaningless)
Passing ``'zarr_dump_array': True`` to the serialization ``context`` looks like this:: Passing ``'zarr_dump_array': True`` to the serialization ``context``
looks like this::
model.model_dump_json(context={'zarr_dump_array': True}) model.model_dump_json(context={'zarr_dump_array': True})
""" """