abczarr 0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- abczarr-0.1/LICENSE +23 -0
- abczarr-0.1/PKG-INFO +128 -0
- abczarr-0.1/README.md +85 -0
- abczarr-0.1/pyproject.toml +116 -0
- abczarr-0.1/setup.cfg +4 -0
- abczarr-0.1/src/abczarr/__init__.py +99 -0
- abczarr-0.1/src/abczarr/_core/__init__.py +0 -0
- abczarr-0.1/src/abczarr/_core/asyncutils.py +102 -0
- abczarr-0.1/src/abczarr/_core/attributes.py +145 -0
- abczarr-0.1/src/abczarr/_core/attrs.py +4 -0
- abczarr-0.1/src/abczarr/_core/auto/__init__.py +16 -0
- abczarr-0.1/src/abczarr/_core/auto/_typing.py +57 -0
- abczarr-0.1/src/abczarr/_core/auto/_utils.py +85 -0
- abczarr-0.1/src/abczarr/_core/auto/attrs.py +400 -0
- abczarr-0.1/src/abczarr/_core/auto/converters.py +17 -0
- abczarr-0.1/src/abczarr/_core/auto/factories.py +10 -0
- abczarr-0.1/src/abczarr/_core/auto/validators.py +9 -0
- abczarr-0.1/src/abczarr/_core/constants.py +7 -0
- abczarr-0.1/src/abczarr/_core/dtypes.py +298 -0
- abczarr-0.1/src/abczarr/_core/features.py +58 -0
- abczarr-0.1/src/abczarr/_core/frozendict.py +53 -0
- abczarr-0.1/src/abczarr/_core/metadata.py +387 -0
- abczarr-0.1/src/abczarr/_core/pyramid.py +136 -0
- abczarr-0.1/src/abczarr/_core/rfc2119.py +189 -0
- abczarr-0.1/src/abczarr/_core/sharding.py +325 -0
- abczarr-0.1/src/abczarr/_core/typevars/__init__.py +0 -0
- abczarr-0.1/src/abczarr/_core/typevars/inv.py +21 -0
- abczarr-0.1/src/abczarr/_core/typing.py +262 -0
- abczarr-0.1/src/abczarr/_version.py +1 -0
- abczarr-0.1/src/abczarr/abc/__init__.py +31 -0
- abczarr-0.1/src/abczarr/abc/asynchronous.py +637 -0
- abczarr-0.1/src/abczarr/abc/capabilities.py +151 -0
- abczarr-0.1/src/abczarr/abc/store.py +783 -0
- abczarr-0.1/src/abczarr/abc/sync.py +836 -0
- abczarr-0.1/src/abczarr/abc/transactions.py +346 -0
- abczarr-0.1/src/abczarr/api/__init__.py +103 -0
- abczarr-0.1/src/abczarr/api/config.py +400 -0
- abczarr-0.1/src/abczarr/api/entrypoint.py +818 -0
- abczarr-0.1/src/abczarr/api/registry.py +87 -0
- abczarr-0.1/src/abczarr/drivers/__init__.py +1 -0
- abczarr-0.1/src/abczarr/drivers/_metadata.py +41 -0
- abczarr-0.1/src/abczarr/drivers/base.py +316 -0
- abczarr-0.1/src/abczarr/drivers/tensorstore.py +559 -0
- abczarr-0.1/src/abczarr/drivers/zarr_python.py +540 -0
- abczarr-0.1/src/abczarr/drivers/zarrista.py +253 -0
- abczarr-0.1/src/abczarr/errors.py +108 -0
- abczarr-0.1/src/abczarr/metadata/__init__.py +3 -0
- abczarr-0.1/src/abczarr/metadata/base.py +681 -0
- abczarr-0.1/src/abczarr/metadata/v1/__init__.py +16 -0
- abczarr-0.1/src/abczarr/metadata/v1/array.py +201 -0
- abczarr-0.1/src/abczarr/metadata/v1/base.py +13 -0
- abczarr-0.1/src/abczarr/metadata/v1/codecs/__init__.py +13 -0
- abczarr-0.1/src/abczarr/metadata/v1/codecs/aliases.py +30 -0
- abczarr-0.1/src/abczarr/metadata/v1/codecs/base.py +54 -0
- abczarr-0.1/src/abczarr/metadata/v1/codecs/builtin.py +52 -0
- abczarr-0.1/src/abczarr/metadata/v1/codecs/extensions.py +125 -0
- abczarr-0.1/src/abczarr/metadata/v1/dtypes.py +6 -0
- abczarr-0.1/src/abczarr/metadata/v2/__init__.py +19 -0
- abczarr-0.1/src/abczarr/metadata/v2/array.py +275 -0
- abczarr-0.1/src/abczarr/metadata/v2/base.py +25 -0
- abczarr-0.1/src/abczarr/metadata/v2/codecs/__init__.py +13 -0
- abczarr-0.1/src/abczarr/metadata/v2/codecs/aliases.py +52 -0
- abczarr-0.1/src/abczarr/metadata/v2/codecs/base.py +70 -0
- abczarr-0.1/src/abczarr/metadata/v2/codecs/builtin.py +89 -0
- abczarr-0.1/src/abczarr/metadata/v2/codecs/extensions.py +150 -0
- abczarr-0.1/src/abczarr/metadata/v2/dtypes.py +127 -0
- abczarr-0.1/src/abczarr/metadata/v2/filters/__init__.py +13 -0
- abczarr-0.1/src/abczarr/metadata/v2/filters/base.py +59 -0
- abczarr-0.1/src/abczarr/metadata/v2/filters/builtin.py +1 -0
- abczarr-0.1/src/abczarr/metadata/v2/filters/extensions.py +233 -0
- abczarr-0.1/src/abczarr/metadata/v3/__init__.py +19 -0
- abczarr-0.1/src/abczarr/metadata/v3/array.py +471 -0
- abczarr-0.1/src/abczarr/metadata/v3/base.py +24 -0
- abczarr-0.1/src/abczarr/metadata/v3/codecs/__init__.py +13 -0
- abczarr-0.1/src/abczarr/metadata/v3/codecs/aliases.py +23 -0
- abczarr-0.1/src/abczarr/metadata/v3/codecs/base.py +132 -0
- abczarr-0.1/src/abczarr/metadata/v3/codecs/builtin.py +203 -0
- abczarr-0.1/src/abczarr/metadata/v3/codecs/extensions.py +371 -0
- abczarr-0.1/src/abczarr/metadata/v3/dtypes/__init__.py +13 -0
- abczarr-0.1/src/abczarr/metadata/v3/dtypes/base.py +130 -0
- abczarr-0.1/src/abczarr/metadata/v3/dtypes/builtin.py +55 -0
- abczarr-0.1/src/abczarr/metadata/v3/dtypes/extensions.py +175 -0
- abczarr-0.1/src/abczarr/metadata/v3/extensions.py +89 -0
- abczarr-0.1/src/abczarr/ome/__init__.py +43 -0
- abczarr-0.1/src/abczarr/ome/base.py +794 -0
- abczarr-0.1/src/abczarr/ome/config.py +824 -0
- abczarr-0.1/src/abczarr/ome/node.py +338 -0
- abczarr-0.1/src/abczarr/ome/pyramid.py +519 -0
- abczarr-0.1/src/abczarr/ome/schemas/__init__.py +18 -0
- abczarr-0.1/src/abczarr/ome/schemas/_contains.py +241 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/README.md +63 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_1/image.schema +112 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_1/plate.schema +112 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_1/strict_image.schema +19 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_1/well.schema +47 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_2/image.schema +117 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_2/plate.schema +116 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_2/strict_image.schema +23 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_2/well.schema +48 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_3/image.schema +109 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_3/plate.schema +119 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_3/strict_image.schema +19 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_3/well.schema +47 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/bf2raw.schema +14 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/image.schema +233 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/label.schema +77 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/ome.schema +17 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/plate.schema +140 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/strict_image.schema +19 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/strict_label.schema +18 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/strict_plate.schema +28 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/strict_well.schema +17 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_4/well.schema +47 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/_version.schema +10 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/bf2raw.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/image.schema +268 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/label.schema +91 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/ome.schema +33 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/ome_zarr.schema +24 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/plate.schema +153 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/strict_image.schema +25 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/strict_label.schema +21 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/strict_plate.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/strict_well.schema +8 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_5/well.schema +56 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/_version.schema +10 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/axes.schema +62 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/bf2raw.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/coordinate_systems.schema +30 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/coordinate_systems_and_transforms.schema +45 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/coordinate_transformation.schema +344 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/image.schema +132 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/label.schema +91 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/ome.schema +33 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/ome_zarr.schema +24 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/plate.schema +153 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/strict_axes.schema +30 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/strict_coordinate_systems.schema +18 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/strict_image.schema +25 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/strict_label.schema +21 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/strict_plate.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/strict_well.schema +8 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev1/well.schema +56 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/_version.schema +10 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/axes.schema +64 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/bf2raw.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/coordinate_systems.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/coordinate_systems_and_transforms.schema +47 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/coordinate_transformations.schema +394 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/image.schema +172 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/label.schema +91 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/ome.schema +33 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/ome_zarr.schema +24 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/plate.schema +153 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/strict_axes.schema +30 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/strict_coordinate_systems.schema +18 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/strict_image.schema +25 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/strict_label.schema +21 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/strict_plate.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/strict_well.schema +8 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev2/well.schema +56 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/_version.schema +10 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/axes.schema +70 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/bf2raw.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/coordinate_systems.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/coordinate_transformations.schema +409 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/image.schema +241 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/label.schema +91 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/ome.schema +33 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/ome_zarr.schema +29 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/plate.schema +153 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/scene.schema +94 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_axes.schema +30 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_coordinate_systems.schema +19 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_image.schema +26 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_label.schema +22 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_ome_zarr.schema +24 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_plate.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/strict_well.schema +5 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev3/well.schema +63 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/_version.schema +10 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/axes.schema +70 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/bf2raw.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/coordinate_systems.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/coordinate_transformations.schema +392 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/image.schema +303 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/label.schema +91 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/ome.schema +33 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/ome_zarr.schema +29 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/plate.schema +153 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/scene.schema +90 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_axes.schema +30 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_coordinate_systems.schema +19 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_image.schema +26 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_label.schema +22 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_ome_zarr.schema +24 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_plate.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/strict_well.schema +5 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6dev4/well.schema +63 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/_version.schema +10 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/axes.schema +70 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/bf2raw.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/coordinate_systems.schema +31 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/coordinate_transformations.schema +440 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/image.schema +267 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/label.schema +91 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/ome.schema +33 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/ome_zarr.schema +29 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/plate.schema +153 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/scene.schema +69 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_axes.schema +30 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_coordinate_systems.schema +19 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_image.schema +26 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_label.schema +22 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_ome_zarr.schema +24 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_plate.schema +32 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/strict_well.schema +5 -0
- abczarr-0.1/src/abczarr/ome/schemas/_ngff/v0_6rc0/well.schema +63 -0
- abczarr-0.1/src/abczarr/ome/schemas/_validation.py +248 -0
- abczarr-0.1/src/abczarr/ome/v0_1/__init__.py +29 -0
- abczarr-0.1/src/abczarr/ome/v0_1/images.py +69 -0
- abczarr-0.1/src/abczarr/ome/v0_1/labels.py +69 -0
- abczarr-0.1/src/abczarr/ome/v0_1/ome.py +145 -0
- abczarr-0.1/src/abczarr/ome/v0_1/omero.py +56 -0
- abczarr-0.1/src/abczarr/ome/v0_1/plates.py +85 -0
- abczarr-0.1/src/abczarr/ome/v0_1/version.py +6 -0
- abczarr-0.1/src/abczarr/ome/v0_1/wells.py +41 -0
- abczarr-0.1/src/abczarr/ome/v0_2/__init__.py +36 -0
- abczarr-0.1/src/abczarr/ome/v0_2/images.py +66 -0
- abczarr-0.1/src/abczarr/ome/v0_2/labels.py +63 -0
- abczarr-0.1/src/abczarr/ome/v0_2/ome.py +148 -0
- abczarr-0.1/src/abczarr/ome/v0_2/omero.py +53 -0
- abczarr-0.1/src/abczarr/ome/v0_2/plates.py +77 -0
- abczarr-0.1/src/abczarr/ome/v0_2/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_2/wells.py +38 -0
- abczarr-0.1/src/abczarr/ome/v0_3/__init__.py +36 -0
- abczarr-0.1/src/abczarr/ome/v0_3/images.py +68 -0
- abczarr-0.1/src/abczarr/ome/v0_3/labels.py +63 -0
- abczarr-0.1/src/abczarr/ome/v0_3/ome.py +148 -0
- abczarr-0.1/src/abczarr/ome/v0_3/omero.py +53 -0
- abczarr-0.1/src/abczarr/ome/v0_3/plates.py +77 -0
- abczarr-0.1/src/abczarr/ome/v0_3/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_3/wells.py +38 -0
- abczarr-0.1/src/abczarr/ome/v0_4/__init__.py +54 -0
- abczarr-0.1/src/abczarr/ome/v0_4/axes.py +122 -0
- abczarr-0.1/src/abczarr/ome/v0_4/images.py +76 -0
- abczarr-0.1/src/abczarr/ome/v0_4/labels.py +63 -0
- abczarr-0.1/src/abczarr/ome/v0_4/ome.py +148 -0
- abczarr-0.1/src/abczarr/ome/v0_4/omero.py +53 -0
- abczarr-0.1/src/abczarr/ome/v0_4/plates.py +77 -0
- abczarr-0.1/src/abczarr/ome/v0_4/transformations.py +51 -0
- abczarr-0.1/src/abczarr/ome/v0_4/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_4/wells.py +38 -0
- abczarr-0.1/src/abczarr/ome/v0_5/__init__.py +54 -0
- abczarr-0.1/src/abczarr/ome/v0_5/axes.py +122 -0
- abczarr-0.1/src/abczarr/ome/v0_5/images.py +74 -0
- abczarr-0.1/src/abczarr/ome/v0_5/labels.py +61 -0
- abczarr-0.1/src/abczarr/ome/v0_5/ome.py +148 -0
- abczarr-0.1/src/abczarr/ome/v0_5/omero.py +51 -0
- abczarr-0.1/src/abczarr/ome/v0_5/plates.py +75 -0
- abczarr-0.1/src/abczarr/ome/v0_5/transformations.py +51 -0
- abczarr-0.1/src/abczarr/ome/v0_5/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_5/wells.py +36 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/__init__.py +48 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/images.py +57 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/labels.py +49 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/ome.py +130 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/omero.py +45 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/plates.py +66 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/systems.py +145 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/transformations.py +220 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/version.py +6 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev1/wells.py +29 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/__init__.py +54 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/images.py +55 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/labels.py +43 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/ome.py +133 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/omero.py +42 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/plates.py +58 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/systems.py +187 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/transformations.py +217 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev2/wells.py +26 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/__init__.py +54 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/images.py +55 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/labels.py +43 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/ome.py +147 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/omero.py +42 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/plates.py +58 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/scenes.py +22 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/systems.py +187 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/transformations.py +209 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev3/wells.py +26 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/__init__.py +54 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/images.py +55 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/labels.py +43 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/ome.py +147 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/omero.py +42 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/plates.py +58 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/scenes.py +22 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/systems.py +187 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/transformations.py +224 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_6dev4/wells.py +26 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/__init__.py +54 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/images.py +55 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/labels.py +43 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/ome.py +147 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/omero.py +42 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/plates.py +58 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/scenes.py +22 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/systems.py +187 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/transformations.py +239 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/version.py +8 -0
- abczarr-0.1/src/abczarr/ome/v0_6rc0/wells.py +26 -0
- abczarr-0.1/src/abczarr/schemas/__init__.py +18 -0
- abczarr-0.1/src/abczarr/schemas/_validation.py +222 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/README.md +43 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v1/array.schema +99 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v1/group.schema +13 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v2/array.schema +623 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v2/group.schema +13 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/core/array.schema +447 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/core/group.schema +20 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/chunk-grids/rectilinear/schema.json +78 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/bitround/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/bytes/schema.json +30 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/cast_value/schema.json +55 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/n5_default/schema.json +74 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/packbits/schema.json +39 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/reshape/schema.json +27 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/scale_offset/schema.json +19 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/transpose/schema.json +29 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/vlen-bytes/schema.json +20 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/vlen-utf8/schema.json +20 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/zfp/schema.json +94 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/codecs/zstd/schema.json +27 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/bfloat16/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/bytes/schema.json +20 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_bfloat16/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float16/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float32/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float4_e2m1fn/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float64/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float6_e2m3fn/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float6_e3m2fn/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e3m4/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e4m3/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e4m3b11fnuz/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e4m3fnuz/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e5m2/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e5m2fnuz/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/complex_float8_e8m0fnu/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/fixed_length_utf32/schema.json +23 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float4_e2m1fn/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float6_e2m3fn/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float6_e3m2fn/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e3m4/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e4m3/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e4m3b11fnuz/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e4m3fnuz/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e5m2/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e5m2fnuz/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/float8_e8m0fnu/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/int2/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/int4/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/numpy.datetime64/schema.json +44 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/numpy.timedelta64/schema.json +44 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/string/schema.json +20 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/struct/schema.json +61 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/uint2/schema.json +22 -0
- abczarr-0.1/src/abczarr/schemas/_zarr/v3/extensions/data-types/uint4/schema.json +22 -0
- abczarr-0.1/src/abczarr.egg-info/PKG-INFO +128 -0
- abczarr-0.1/src/abczarr.egg-info/SOURCES.txt +427 -0
- abczarr-0.1/src/abczarr.egg-info/dependency_links.txt +1 -0
- abczarr-0.1/src/abczarr.egg-info/requires.txt +39 -0
- abczarr-0.1/src/abczarr.egg-info/top_level.txt +1 -0
- abczarr-0.1/tests/test_abc_contract.py +148 -0
- abczarr-0.1/tests/test_api.py +265 -0
- abczarr-0.1/tests/test_array_abc.py +116 -0
- abczarr-0.1/tests/test_array_dask.py +77 -0
- abczarr-0.1/tests/test_async_nodes.py +823 -0
- abczarr-0.1/tests/test_atomic_write.py +83 -0
- abczarr-0.1/tests/test_attribute_write_frozen.py +115 -0
- abczarr-0.1/tests/test_attributes.py +65 -0
- abczarr-0.1/tests/test_attributes_metadata.py +276 -0
- abczarr-0.1/tests/test_auto_foundations.py +84 -0
- abczarr-0.1/tests/test_capabilities.py +83 -0
- abczarr-0.1/tests/test_config_api.py +157 -0
- abczarr-0.1/tests/test_conversion_matrix.py +627 -0
- abczarr-0.1/tests/test_conversion_realistic.py +284 -0
- abczarr-0.1/tests/test_core_metadata_new.py +44 -0
- abczarr-0.1/tests/test_create_data_ome.py +210 -0
- abczarr-0.1/tests/test_driver_base.py +128 -0
- abczarr-0.1/tests/test_dtype_datetime.py +52 -0
- abczarr-0.1/tests/test_dtype_extensions.py +122 -0
- abczarr-0.1/tests/test_dtype_v3_strings.py +90 -0
- abczarr-0.1/tests/test_dtype_v3_vlen.py +166 -0
- abczarr-0.1/tests/test_frozen_json.py +87 -0
- abczarr-0.1/tests/test_import.py +144 -0
- abczarr-0.1/tests/test_metadata_array.py +313 -0
- abczarr-0.1/tests/test_metadata_conversion.py +258 -0
- abczarr-0.1/tests/test_ome_0_6_dev.py +338 -0
- abczarr-0.1/tests/test_ome_config.py +458 -0
- abczarr-0.1/tests/test_ome_convert.py +251 -0
- abczarr-0.1/tests/test_ome_json_schema.py +289 -0
- abczarr-0.1/tests/test_ome_metadata.py +447 -0
- abczarr-0.1/tests/test_ome_metadata_generated.py +46 -0
- abczarr-0.1/tests/test_ome_node.py +295 -0
- abczarr-0.1/tests/test_ome_pyramid.py +313 -0
- abczarr-0.1/tests/test_ome_schema.py +256 -0
- abczarr-0.1/tests/test_ome_serialization.py +109 -0
- abczarr-0.1/tests/test_path_group.py +332 -0
- abczarr-0.1/tests/test_required_features.py +174 -0
- abczarr-0.1/tests/test_sharding.py +47 -0
- abczarr-0.1/tests/test_store.py +390 -0
- abczarr-0.1/tests/test_store_path.py +106 -0
- abczarr-0.1/tests/test_tensorstore_driver.py +426 -0
- abczarr-0.1/tests/test_tests.py +4 -0
- abczarr-0.1/tests/test_transactions.py +189 -0
- abczarr-0.1/tests/test_v1_codec_id.py +47 -0
- abczarr-0.1/tests/test_v3_codec_extensions.py +138 -0
- abczarr-0.1/tests/test_zarr_json_schema.py +209 -0
- abczarr-0.1/tests/test_zarr_python_create.py +255 -0
- abczarr-0.1/tests/test_zarr_python_driver.py +99 -0
- abczarr-0.1/tests/test_zarr_python_nodes.py +168 -0
- abczarr-0.1/tests/test_zarr_python_v2.py +70 -0
- abczarr-0.1/tests/test_zarrista_driver.py +202 -0
abczarr-0.1/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026- Yael Balbastre
|
|
4
|
+
Copyright (c) 2024-2026 Kaidong Chai
|
|
5
|
+
Copyright (c) 2015-2025 Zarr Developers <https://github.com/zarr-developers>
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
abczarr-0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: abczarr
|
|
3
|
+
Version: 0.1
|
|
4
|
+
Summary: ABC...Z(arr) - Abstract base classes for the Zarr format, and vendored implementations
|
|
5
|
+
Author-email: "Chai, Kaidong" <mail@kchai.me>
|
|
6
|
+
Maintainer-email: "Balbastre, Yael" <y.balbastre@ucl.ac.uk>
|
|
7
|
+
Project-URL: Homepage, https://github.com/neuroscales/abczarr
|
|
8
|
+
Project-URL: Issues, https://github.com/neuroscales/abczarr/issues
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: typing_extensions>=4.13
|
|
13
|
+
Requires-Dist: attrs>=25.2
|
|
14
|
+
Requires-Dist: numpy>=1.20
|
|
15
|
+
Requires-Dist: dask[array,diagnostics]>=2.9.1
|
|
16
|
+
Requires-Dist: bagof-paths>=0.1.0
|
|
17
|
+
Requires-Dist: bagof-converters>=0.1
|
|
18
|
+
Requires-Dist: bagof-validators>=0.1
|
|
19
|
+
Requires-Dist: bagof-factories>=0.1
|
|
20
|
+
Requires-Dist: fastjsonschema>=2.16
|
|
21
|
+
Provides-Extra: tqdm
|
|
22
|
+
Requires-Dist: tqdm; extra == "tqdm"
|
|
23
|
+
Provides-Extra: upath
|
|
24
|
+
Requires-Dist: universal-pathlib; extra == "upath"
|
|
25
|
+
Provides-Extra: anypath
|
|
26
|
+
Requires-Dist: cloudpathlib; extra == "anypath"
|
|
27
|
+
Provides-Extra: ml-dtypes
|
|
28
|
+
Requires-Dist: ml_dtypes>=0.2; extra == "ml-dtypes"
|
|
29
|
+
Provides-Extra: zarr-py
|
|
30
|
+
Requires-Dist: zarr; extra == "zarr-py"
|
|
31
|
+
Provides-Extra: tensorstore
|
|
32
|
+
Requires-Dist: tensorstore; extra == "tensorstore"
|
|
33
|
+
Provides-Extra: zarrista
|
|
34
|
+
Requires-Dist: zarrista; extra == "zarrista"
|
|
35
|
+
Provides-Extra: test
|
|
36
|
+
Requires-Dist: pytest; extra == "test"
|
|
37
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
38
|
+
Provides-Extra: doc
|
|
39
|
+
Requires-Dist: zensical>=0.0.11; extra == "doc"
|
|
40
|
+
Requires-Dist: mkdocstrings[python]>=1.0.0; extra == "doc"
|
|
41
|
+
Requires-Dist: markdown-grid-tables; extra == "doc"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# abczarr
|
|
45
|
+
|
|
46
|
+
<img src="https://neuroscales.github.io/abczarr/images/logo_title_color.svg" style="display: block; margin: 0 auto; width: 75%; height: auto;" alt="abczarr logo" />
|
|
47
|
+
|
|
48
|
+
One interface for reading and writing Zarr arrays and groups, synchronously
|
|
49
|
+
or asynchronously, regardless of which backend or storage location holds
|
|
50
|
+
them.
|
|
51
|
+
|
|
52
|
+
## What it does
|
|
53
|
+
|
|
54
|
+
Zarr has several capable Python implementations
|
|
55
|
+
([`zarr-python`](https://github.com/zarr-developers/zarr-python),
|
|
56
|
+
[`tensorstore`](https://github.com/google/tensorstore/),
|
|
57
|
+
[`zarrista`](https://github.com/developmentseed/zarrista)), and they
|
|
58
|
+
differ in what they support and in the API each one exposes. abczarr sits
|
|
59
|
+
above these implementations and exposes a single API, `ZarrArray` and
|
|
60
|
+
`ZarrGroup`, and selects whichever backend actually supports the requested
|
|
61
|
+
operation. A backend can also be named explicitly when a specific one is
|
|
62
|
+
required. Local paths and cloud URLs such as `s3://` or `gs://` are handled
|
|
63
|
+
the same way, regardless of which backend is in use.
|
|
64
|
+
|
|
65
|
+
Every node exists in both a synchronous and an asynchronous form, and the
|
|
66
|
+
two behave identically regardless of what the underlying backend supports.
|
|
67
|
+
When a backend provides real asynchronous I/O, abczarr uses it directly.
|
|
68
|
+
When a backend does not, the call runs in a background thread instead.
|
|
69
|
+
Either form returns an object with the same behavior, and the asynchronous
|
|
70
|
+
form can be awaited.
|
|
71
|
+
|
|
72
|
+
Backends genuinely differ in what they support. abczarr exposes a backend's
|
|
73
|
+
capabilities so that they can be checked before an operation runs, instead
|
|
74
|
+
of discovering a gap partway through a write. When an operation is not
|
|
75
|
+
supported, the resulting error names what is missing, instead of
|
|
76
|
+
surfacing as a stack trace from inside a driver's internals.
|
|
77
|
+
|
|
78
|
+
Zarr's array metadata has changed shape across versions. Versions v1, v2,
|
|
79
|
+
and v3 each describe an array a little differently. abczarr models all
|
|
80
|
+
three as one typed, validated object that converts between versions. When
|
|
81
|
+
a conversion can carry an option across cleanly, it does. When it cannot,
|
|
82
|
+
the missing option can be configured to be dropped silently, to raise a
|
|
83
|
+
warning, or to raise a hard error. OME-Zarr metadata receives the same
|
|
84
|
+
treatment: a typed model, schema validation that runs offline, and
|
|
85
|
+
conversion between OME-NGFF versions.
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from abczarr import open
|
|
89
|
+
|
|
90
|
+
# opens a Zarr node at any location, with the backend chosen automatically
|
|
91
|
+
group = open("s3://my-bucket/dataset.zarr")
|
|
92
|
+
array = group["images"]
|
|
93
|
+
data = array[:100, :100]
|
|
94
|
+
|
|
95
|
+
# a backend can also be named explicitly
|
|
96
|
+
volume = open("data.zarr", driver="tensorstore")
|
|
97
|
+
|
|
98
|
+
# the asynchronous form awaits open() and each subsequent method call
|
|
99
|
+
agroup = await open("s3://my-bucket/dataset.zarr", asynchronous=True)
|
|
100
|
+
aimages = await agroup.getitem("images")
|
|
101
|
+
tile = await aimages.getitem((slice(100), slice(100)))
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Install
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
pip install abczarr
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The core installs no backend of its own. The driver needed for reading
|
|
111
|
+
and writing, along with any required storage or dtype support, is added
|
|
112
|
+
through extras:
|
|
113
|
+
|
|
114
|
+
| extra | enables |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `abczarr[zarr-py]` | the zarr-python driver |
|
|
117
|
+
| `abczarr[tensorstore]` | the TensorStore driver |
|
|
118
|
+
| `abczarr[zarrista]` | the zarrista driver |
|
|
119
|
+
| `abczarr[upath]` | fsspec and cloud URLs (`s3://`, `gs://`, ...) via universal-pathlib |
|
|
120
|
+
| `abczarr[anypath]` | cloud paths via cloudpathlib |
|
|
121
|
+
| `abczarr[ml-dtypes]` | exotic v3 float dtypes (`bfloat16`, `float8_*`, ...) |
|
|
122
|
+
|
|
123
|
+
Extras can be combined, for example `pip install "abczarr[zarr-py,upath]"`.
|
|
124
|
+
|
|
125
|
+
## Learn more
|
|
126
|
+
|
|
127
|
+
Full documentation lives at
|
|
128
|
+
[neuroscales.github.io/abczarr](https://neuroscales.github.io/abczarr/).
|
abczarr-0.1/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# abczarr
|
|
2
|
+
|
|
3
|
+
<img src="https://neuroscales.github.io/abczarr/images/logo_title_color.svg" style="display: block; margin: 0 auto; width: 75%; height: auto;" alt="abczarr logo" />
|
|
4
|
+
|
|
5
|
+
One interface for reading and writing Zarr arrays and groups, synchronously
|
|
6
|
+
or asynchronously, regardless of which backend or storage location holds
|
|
7
|
+
them.
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
Zarr has several capable Python implementations
|
|
12
|
+
([`zarr-python`](https://github.com/zarr-developers/zarr-python),
|
|
13
|
+
[`tensorstore`](https://github.com/google/tensorstore/),
|
|
14
|
+
[`zarrista`](https://github.com/developmentseed/zarrista)), and they
|
|
15
|
+
differ in what they support and in the API each one exposes. abczarr sits
|
|
16
|
+
above these implementations and exposes a single API, `ZarrArray` and
|
|
17
|
+
`ZarrGroup`, and selects whichever backend actually supports the requested
|
|
18
|
+
operation. A backend can also be named explicitly when a specific one is
|
|
19
|
+
required. Local paths and cloud URLs such as `s3://` or `gs://` are handled
|
|
20
|
+
the same way, regardless of which backend is in use.
|
|
21
|
+
|
|
22
|
+
Every node exists in both a synchronous and an asynchronous form, and the
|
|
23
|
+
two behave identically regardless of what the underlying backend supports.
|
|
24
|
+
When a backend provides real asynchronous I/O, abczarr uses it directly.
|
|
25
|
+
When a backend does not, the call runs in a background thread instead.
|
|
26
|
+
Either form returns an object with the same behavior, and the asynchronous
|
|
27
|
+
form can be awaited.
|
|
28
|
+
|
|
29
|
+
Backends genuinely differ in what they support. abczarr exposes a backend's
|
|
30
|
+
capabilities so that they can be checked before an operation runs, instead
|
|
31
|
+
of discovering a gap partway through a write. When an operation is not
|
|
32
|
+
supported, the resulting error names what is missing, instead of
|
|
33
|
+
surfacing as a stack trace from inside a driver's internals.
|
|
34
|
+
|
|
35
|
+
Zarr's array metadata has changed shape across versions. Versions v1, v2,
|
|
36
|
+
and v3 each describe an array a little differently. abczarr models all
|
|
37
|
+
three as one typed, validated object that converts between versions. When
|
|
38
|
+
a conversion can carry an option across cleanly, it does. When it cannot,
|
|
39
|
+
the missing option can be configured to be dropped silently, to raise a
|
|
40
|
+
warning, or to raise a hard error. OME-Zarr metadata receives the same
|
|
41
|
+
treatment: a typed model, schema validation that runs offline, and
|
|
42
|
+
conversion between OME-NGFF versions.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from abczarr import open
|
|
46
|
+
|
|
47
|
+
# opens a Zarr node at any location, with the backend chosen automatically
|
|
48
|
+
group = open("s3://my-bucket/dataset.zarr")
|
|
49
|
+
array = group["images"]
|
|
50
|
+
data = array[:100, :100]
|
|
51
|
+
|
|
52
|
+
# a backend can also be named explicitly
|
|
53
|
+
volume = open("data.zarr", driver="tensorstore")
|
|
54
|
+
|
|
55
|
+
# the asynchronous form awaits open() and each subsequent method call
|
|
56
|
+
agroup = await open("s3://my-bucket/dataset.zarr", asynchronous=True)
|
|
57
|
+
aimages = await agroup.getitem("images")
|
|
58
|
+
tile = await aimages.getitem((slice(100), slice(100)))
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Install
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
pip install abczarr
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The core installs no backend of its own. The driver needed for reading
|
|
68
|
+
and writing, along with any required storage or dtype support, is added
|
|
69
|
+
through extras:
|
|
70
|
+
|
|
71
|
+
| extra | enables |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| `abczarr[zarr-py]` | the zarr-python driver |
|
|
74
|
+
| `abczarr[tensorstore]` | the TensorStore driver |
|
|
75
|
+
| `abczarr[zarrista]` | the zarrista driver |
|
|
76
|
+
| `abczarr[upath]` | fsspec and cloud URLs (`s3://`, `gs://`, ...) via universal-pathlib |
|
|
77
|
+
| `abczarr[anypath]` | cloud paths via cloudpathlib |
|
|
78
|
+
| `abczarr[ml-dtypes]` | exotic v3 float dtypes (`bfloat16`, `float8_*`, ...) |
|
|
79
|
+
|
|
80
|
+
Extras can be combined, for example `pip install "abczarr[zarr-py,upath]"`.
|
|
81
|
+
|
|
82
|
+
## Learn more
|
|
83
|
+
|
|
84
|
+
Full documentation lives at
|
|
85
|
+
[neuroscales.github.io/abczarr](https://neuroscales.github.io/abczarr/).
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "abczarr"
|
|
3
|
+
authors = [{name = "Chai, Kaidong", email = "mail@kchai.me"}]
|
|
4
|
+
maintainers = [{name = "Balbastre, Yael", email = "y.balbastre@ucl.ac.uk"}]
|
|
5
|
+
description = "ABC...Z(arr) - Abstract base classes for the Zarr format, and vendored implementations"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
requires-python = ">=3.8"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"typing_extensions >= 4.13", # shared floor of the bagof-* engine
|
|
11
|
+
"attrs >= 25.2", # @define
|
|
12
|
+
"numpy >= 1.20", # numpy.typing.DTypeLike
|
|
13
|
+
"dask[array,diagnostics] >= 2.9.1", # nanmedian
|
|
14
|
+
# One pathlib-style API over local and cloud paths. universal-pathlib /
|
|
15
|
+
# cloudpathlib stay optional extras below -- the core wraps stdlib pathlib
|
|
16
|
+
# and needs neither.
|
|
17
|
+
"bagof-paths >= 0.1.0",
|
|
18
|
+
# Hint-driven converters / validators / factories. abczarr's metadata
|
|
19
|
+
# model derives per-field conversion and validation from type hints; these
|
|
20
|
+
# provide that engine (the same one bagof-magic uses), replacing the
|
|
21
|
+
# home-grown version under _core/auto.
|
|
22
|
+
"bagof-converters >= 0.1",
|
|
23
|
+
"bagof-validators >= 0.1",
|
|
24
|
+
"bagof-factories >= 0.1",
|
|
25
|
+
# Offline JSON-schema validation of OME-Zarr / Zarr metadata against the
|
|
26
|
+
# vendored NGFF and Zarr schemas. Pure-Python, zero runtime dependencies,
|
|
27
|
+
# no python_requires floor (installs on the 3.8 floor), and fast (compiles
|
|
28
|
+
# each schema to a validation function).
|
|
29
|
+
"fastjsonschema >= 2.16",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
|
|
34
|
+
# fancy
|
|
35
|
+
tqdm = ["tqdm"]
|
|
36
|
+
upath = ["universal-pathlib"]
|
|
37
|
+
anypath = ["cloudpathlib"]
|
|
38
|
+
|
|
39
|
+
# dtypes
|
|
40
|
+
# Registers exotic v3 extension floats (bfloat16, float8_*, ...) with numpy
|
|
41
|
+
# on import, so ``asdtype`` resolves them. Optional -- the core needs none of
|
|
42
|
+
# it. The 0.2 floor is what pip resolves on the 3.8 leg; newer wheels are
|
|
43
|
+
# selected automatically on newer interpreters.
|
|
44
|
+
ml-dtypes = ["ml_dtypes >= 0.2"]
|
|
45
|
+
|
|
46
|
+
# drivers
|
|
47
|
+
zarr-py = ["zarr"]
|
|
48
|
+
tensorstore = ["tensorstore"]
|
|
49
|
+
zarrista = ["zarrista"]
|
|
50
|
+
|
|
51
|
+
# test
|
|
52
|
+
test = ["pytest", "pytest-cov"]
|
|
53
|
+
|
|
54
|
+
# doc
|
|
55
|
+
doc = [
|
|
56
|
+
"zensical>=0.0.11",
|
|
57
|
+
"mkdocstrings[python]>=1.0.0",
|
|
58
|
+
"markdown-grid-tables",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[project.urls]
|
|
62
|
+
Homepage = "https://github.com/neuroscales/abczarr"
|
|
63
|
+
Issues = "https://github.com/neuroscales/abczarr/issues"
|
|
64
|
+
|
|
65
|
+
[tool.setuptools.package-data]
|
|
66
|
+
# Ship the JSON schemas (they live in non-package data directories under the
|
|
67
|
+
# schemas packages, so they are not picked up as modules).
|
|
68
|
+
"abczarr.ome.schemas" = ["_ngff/*/*.schema", "_ngff/*.md"]
|
|
69
|
+
"abczarr.schemas" = [
|
|
70
|
+
"_zarr/*.md",
|
|
71
|
+
"_zarr/*/*.schema",
|
|
72
|
+
"_zarr/*/*/*.schema",
|
|
73
|
+
"_zarr/v3/extensions/*/*/schema.json",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[build-system]
|
|
77
|
+
requires = [
|
|
78
|
+
"setuptools>=59",
|
|
79
|
+
"wheel",
|
|
80
|
+
"versioningit>=1.0",
|
|
81
|
+
]
|
|
82
|
+
build-backend = "setuptools.build_meta"
|
|
83
|
+
|
|
84
|
+
[tool.versioningit]
|
|
85
|
+
default-version = "0+unknown"
|
|
86
|
+
|
|
87
|
+
[tool.versioningit.vcs]
|
|
88
|
+
default-tag = "0.1"
|
|
89
|
+
|
|
90
|
+
[tool.versioningit.format]
|
|
91
|
+
distance = "{base_version}+{distance}.{vcs}{rev}"
|
|
92
|
+
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
|
|
93
|
+
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
|
|
94
|
+
|
|
95
|
+
[tool.versioningit.write]
|
|
96
|
+
file = "src/abczarr/_version.py"
|
|
97
|
+
|
|
98
|
+
[tool.pytest.ini_options]
|
|
99
|
+
pythonpath = ["."]
|
|
100
|
+
testpaths = ["tests"]
|
|
101
|
+
|
|
102
|
+
[tool.ruff]
|
|
103
|
+
line-length = 79
|
|
104
|
+
target-version = "py38"
|
|
105
|
+
|
|
106
|
+
[tool.ruff.lint]
|
|
107
|
+
select = ["ANN", "B", "E", "F", "I", "UP", "W"]
|
|
108
|
+
ignore = [
|
|
109
|
+
"ANN002", # Allow missing type annotations for *args
|
|
110
|
+
"ANN003", # Allow missing type annotations for **kwargs
|
|
111
|
+
"ANN401", # Allow annotating with Any
|
|
112
|
+
"UP006", # Allow typing.List/Type over the builtin generic
|
|
113
|
+
"UP007", # Allow typing.Optional/Union over the X | Y form
|
|
114
|
+
"UP035", # Allow importing from typing / typing_extensions
|
|
115
|
+
"UP045", # Allow typing.Optional[X] over X | None
|
|
116
|
+
]
|
abczarr-0.1/setup.cfg
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"""abczarr: one interface for reading and writing Zarr, over any backend.
|
|
2
|
+
|
|
3
|
+
Open or create a node with [open][abczarr.open] and [create][abczarr.create],
|
|
4
|
+
and read or write it through the uniform
|
|
5
|
+
[ZarrArray][abczarr.abc.sync.ZarrArray] /
|
|
6
|
+
[ZarrGroup][abczarr.abc.sync.ZarrGroup] surface, whatever backend or storage is
|
|
7
|
+
behind it. The whole user-facing API is
|
|
8
|
+
re-exported here at the top level: the [ArrayConfig][abczarr.ArrayConfig] and
|
|
9
|
+
[GroupConfig][abczarr.GroupConfig] that creation rests on, the
|
|
10
|
+
[select_driver][abczarr.select_driver] registry that picks a backend, and the
|
|
11
|
+
errors abczarr raises. The open/create, config and registry names are also
|
|
12
|
+
available under [api][abczarr.api]; the errors keep their own home in
|
|
13
|
+
[abczarr.errors][abczarr.errors].
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
# subpackages
|
|
18
|
+
"abc",
|
|
19
|
+
"api",
|
|
20
|
+
"drivers",
|
|
21
|
+
"errors",
|
|
22
|
+
"metadata",
|
|
23
|
+
"ome",
|
|
24
|
+
"schemas",
|
|
25
|
+
# node surface
|
|
26
|
+
"ZarrArray",
|
|
27
|
+
"ZarrGroup",
|
|
28
|
+
"ZarrNode",
|
|
29
|
+
"AsyncZarrArray",
|
|
30
|
+
"AsyncZarrGroup",
|
|
31
|
+
"AsyncZarrNode",
|
|
32
|
+
# open / create
|
|
33
|
+
"open",
|
|
34
|
+
"open_array",
|
|
35
|
+
"open_group",
|
|
36
|
+
"create",
|
|
37
|
+
"create_array",
|
|
38
|
+
"create_group",
|
|
39
|
+
# config
|
|
40
|
+
"ZarrConfig",
|
|
41
|
+
"GroupConfig",
|
|
42
|
+
"ArrayConfig",
|
|
43
|
+
"ZarrOptions",
|
|
44
|
+
"GroupOptions",
|
|
45
|
+
"ArrayOptions",
|
|
46
|
+
# driver registry
|
|
47
|
+
"register_driver",
|
|
48
|
+
"available_drivers",
|
|
49
|
+
"select_driver",
|
|
50
|
+
# errors
|
|
51
|
+
"UnsupportedZarrOperation",
|
|
52
|
+
"UnsupportedConversion",
|
|
53
|
+
"TransactionConflict",
|
|
54
|
+
"SchemaValidationError",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
# Subpackages first: importing `drivers` fully loads `drivers.base` (which
|
|
58
|
+
# imports the config layer) before the re-exports below reach for the
|
|
59
|
+
# reader/writer or the registry, so those lazy imports never cycle back.
|
|
60
|
+
from . import (
|
|
61
|
+
abc,
|
|
62
|
+
api,
|
|
63
|
+
drivers,
|
|
64
|
+
errors,
|
|
65
|
+
metadata,
|
|
66
|
+
ome,
|
|
67
|
+
schemas,
|
|
68
|
+
)
|
|
69
|
+
from .abc import (
|
|
70
|
+
AsyncZarrArray,
|
|
71
|
+
AsyncZarrGroup,
|
|
72
|
+
AsyncZarrNode,
|
|
73
|
+
ZarrArray,
|
|
74
|
+
ZarrGroup,
|
|
75
|
+
ZarrNode,
|
|
76
|
+
)
|
|
77
|
+
from .api import (
|
|
78
|
+
ArrayConfig,
|
|
79
|
+
ArrayOptions,
|
|
80
|
+
GroupConfig,
|
|
81
|
+
GroupOptions,
|
|
82
|
+
ZarrConfig,
|
|
83
|
+
ZarrOptions,
|
|
84
|
+
available_drivers,
|
|
85
|
+
create,
|
|
86
|
+
create_array,
|
|
87
|
+
create_group,
|
|
88
|
+
open,
|
|
89
|
+
open_array,
|
|
90
|
+
open_group,
|
|
91
|
+
register_driver,
|
|
92
|
+
select_driver,
|
|
93
|
+
)
|
|
94
|
+
from .errors import (
|
|
95
|
+
SchemaValidationError,
|
|
96
|
+
TransactionConflict,
|
|
97
|
+
UnsupportedConversion,
|
|
98
|
+
UnsupportedZarrOperation,
|
|
99
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Small async helpers: run a blocking call in a bounded pool, and fan a
|
|
2
|
+
batch of coroutines out with a concurrency cap.
|
|
3
|
+
|
|
4
|
+
abczarr synthesizes the async-from-sync direction only (a synchronous
|
|
5
|
+
backend run in a worker thread). The thread pool here is a dedicated,
|
|
6
|
+
bounded one -- not asyncio's default executor -- so a burst of chunk I/O
|
|
7
|
+
cannot starve the interpreter's shared pool, and the fan-out helper carries
|
|
8
|
+
a default concurrency limit so a wide ``gather`` does not open thousands of
|
|
9
|
+
threads or backend connections at once.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"DEFAULT_CONCURRENCY",
|
|
14
|
+
"run_sync",
|
|
15
|
+
"concurrent_map",
|
|
16
|
+
"ensure_coroutine",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
# stdlib
|
|
20
|
+
import asyncio
|
|
21
|
+
import os
|
|
22
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
23
|
+
from functools import partial
|
|
24
|
+
|
|
25
|
+
# dependencies
|
|
26
|
+
import typing_extensions as tx
|
|
27
|
+
|
|
28
|
+
# typing
|
|
29
|
+
T = tx.TypeVar("T", bound=tx.Tuple[tx.Any, ...])
|
|
30
|
+
V = tx.TypeVar("V")
|
|
31
|
+
|
|
32
|
+
#: The default fan-out width, matching the thread pool's size, so a batch
|
|
33
|
+
#: run through :func:`concurrent_map` never wants more workers than there
|
|
34
|
+
#: are threads to serve it.
|
|
35
|
+
DEFAULT_CONCURRENCY = min(32, (os.cpu_count() or 1) + 4)
|
|
36
|
+
|
|
37
|
+
#: The dedicated executor, built on first use. Kept apart from asyncio's
|
|
38
|
+
#: default (``None``) pool so abczarr's blocking chunk I/O never contends
|
|
39
|
+
#: with whatever else a caller's event loop offloads.
|
|
40
|
+
_executor = None # type: tx.Optional[ThreadPoolExecutor]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _thread_pool() -> ThreadPoolExecutor:
|
|
44
|
+
"""The shared bounded thread pool, created on first use."""
|
|
45
|
+
global _executor
|
|
46
|
+
if _executor is None:
|
|
47
|
+
_executor = ThreadPoolExecutor(
|
|
48
|
+
max_workers=DEFAULT_CONCURRENCY,
|
|
49
|
+
thread_name_prefix="abczarr-async",
|
|
50
|
+
)
|
|
51
|
+
return _executor
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
async def run_sync(
|
|
55
|
+
func: tx.Callable[..., V], *args: tx.Any, **kwargs: tx.Any
|
|
56
|
+
) -> V:
|
|
57
|
+
"""Run the blocking *func* in the dedicated thread pool and await it.
|
|
58
|
+
|
|
59
|
+
A cancelled ``await`` cannot interrupt the running thread, so a write
|
|
60
|
+
already handed to the backend may still land even when the awaiting task
|
|
61
|
+
is cancelled.
|
|
62
|
+
"""
|
|
63
|
+
loop = asyncio.get_running_loop()
|
|
64
|
+
call = partial(func, *args, **kwargs)
|
|
65
|
+
return await loop.run_in_executor(_thread_pool(), call)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
async def concurrent_map(
|
|
69
|
+
items: tx.Iterable[T],
|
|
70
|
+
func: tx.Callable[..., tx.Awaitable[V]],
|
|
71
|
+
limit: tx.Optional[int] = DEFAULT_CONCURRENCY,
|
|
72
|
+
) -> tx.List[V]:
|
|
73
|
+
"""Await *func* over each of *items*, at most *limit* at a time.
|
|
74
|
+
|
|
75
|
+
Each item is a tuple of positional arguments for *func*. Results come
|
|
76
|
+
back in the order of *items*. A *limit* of ``None`` runs them all at
|
|
77
|
+
once (unbounded); the default caps the fan-out so a wide batch does not
|
|
78
|
+
open more connections or threads than the pool can serve.
|
|
79
|
+
"""
|
|
80
|
+
if limit is None:
|
|
81
|
+
return await asyncio.gather(*[func(*item) for item in items])
|
|
82
|
+
|
|
83
|
+
sem = asyncio.Semaphore(limit)
|
|
84
|
+
|
|
85
|
+
async def run(item: T) -> V:
|
|
86
|
+
async with sem:
|
|
87
|
+
return await func(*item)
|
|
88
|
+
|
|
89
|
+
return await asyncio.gather(*[run(item) for item in items])
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def ensure_coroutine(
|
|
93
|
+
fn: tx.Callable[..., tx.Any]
|
|
94
|
+
) -> tx.Callable[..., tx.Awaitable[tx.Any]]:
|
|
95
|
+
"""Adapt *fn* to a coroutine function.
|
|
96
|
+
|
|
97
|
+
A coroutine function is returned unchanged; a plain callable is wrapped
|
|
98
|
+
so calling it runs it in the thread pool and returns an awaitable.
|
|
99
|
+
"""
|
|
100
|
+
if asyncio.iscoroutinefunction(fn):
|
|
101
|
+
return fn
|
|
102
|
+
return partial(run_sync, fn)
|