Skip to main content

No project description provided

Project description

zarrs-python

⚠️ The version of `zarr-python` we currently depend on is still in pre-release and this
package is accordingly extremely experimental.
We cannot guarantee any stability or correctness at the moment, although we have
tried to do extensive testing and make clear what we think we support and do not.

This project serves as a bridge between zarrs and zarr via PyO3. The main goal of the project is to speed up i/o.

To use the project, simply install our package (which depends on zarr-python>3.0.0b0), and run:

import zarr
import zarrs
zarr.config.set({"codec_pipeline.path": "zarrs.ZarrsCodecPipeline"})

You can then use your zarr as normal (with some caveats)!

API

We export a ZarrsCodecPipeline class so that zarr-python can use the class but it is not meant to be instantiated and we do not guarantee the stability of its API beyond what is required so that zarr-python can use it. Therefore, it is not documented here. We also export two errors, DiscontiguousArrayError and CollapsedDimensionError that can be thrown in the process of converting to indexers that zarrs can understand (see below for more details).

Configuration

ZarrsCodecPipeline options are exposed through zarr.config.

Standard zarr.config options control some functionality (see the defaults in the config.py of zarr-python):

  • threading.max_workers: the maximum number of threads used internally by the ZarrsCodecPipeline on the Rust side.
  • array.write_empty_chunks: whether or not to store empty chunks.
    • Defaults to false if None. Note that checking for emptiness has some overhead, see here for more info.
    • This option name is proposed in zarr-python #2429

The ZarrsCodecPipeline specific options are:

  • codec_pipeline.chunk_concurrent_maximum: the maximum number of chunks stored/retrieved concurrently.
    • Defaults to the number of logical CPUs if None. It is constrained by threading.max_workers as well.
  • codec_pipeline.chunk_concurrent_minimum: the minimum number of chunks retrieved/stored concurrently when balancing chunk/codec concurrency.
    • Defaults to 4 if None. See here for more info.
  • codec_pipeline.validate_checksums: enable checksum validation (e.g. with the CRC32C codec).
    • Defaults to true if None. See here for more info.

For example:

zarr.config.set({
    "threading.max_workers": None,
    "array.write_empty_chunks": False,
    "codec_pipeline": {
        "path": "zarrs.ZarrsCodecPipeline",
        "validate_checksums": True,
        "store_empty_chunks": False,
        "chunk_concurrent_maximum": None,
        "chunk_concurrent_minimum": 4,
    }
})

Concurrency

Concurrency can be classified into two types:

  • chunk (outer) concurrency: the number of chunks retrieved/stored concurrently.
    • This is chosen automatically based on various factors, such as the chunk size and codecs.
    • It is constrained between codec_pipeline.chunk_concurrent_minimum and codec_pipeline.chunk_concurrent_maximum for operations involving multiple chunks.
  • codec (inner) concurrency: the number of threads encoding/decoding a chunk.
    • This is chosen automatically in combination with the chunk concurrency.

The product of the chunk and codec concurrency will approximately match threading.max_workers.

Chunk concurrency is typically favored because:

  • parallel encoding/decoding can have a high overhead with some codecs, especially with small chunks, and
  • it is advantageous to retrieve/store multiple chunks concurrently, especially with high latency stores.

zarrs-python will often favor codec concurrency with sharded arrays, as they are well suited to codec concurrency.

Supported Indexing Methods

We do not officially support the following indexing methods. Some of these methods may error out, others may not:

  1. Any oindex or vindex integer np.ndarray indexing with dimensionality >=3 i.e.,

    arr[np.array([...]), :, np.array([...])]
    arr[np.array([...]), np.array([...]), np.array([...])]
    arr[np.array([...]), np.array([...]), np.array([...])] = ...
    arr.oindex[np.array([...]), np.array([...]), np.array([...])] = ...
    
  2. Any vindex or oindex discontinuous integer np.ndarray indexing for writes in 2D

    arr[np.array([0, 5]), :] = ...
    arr.oindex[np.array([0, 5]), :] = ...
    
  3. vindex writes in 2D where both indexers are integer np.ndarray indices i.e.,

    arr[np.array([...]), np.array([...])] = ...
    
  4. Ellipsis indexing. We have tested some, but others fail even with zarr-python's default codec pipeline. Thus for now we advise proceeding with caution here.

    arr[0:10, ..., 0:5]
    

Otherwise, we believe that we support your indexing case: slices, ints, and all integer np.ndarray indices in 2D for reading, contiguous integer np.ndarray indices along one axis for writing etc. Please file an issue if you believe we have more holes in our coverage than we are aware of or you wish to contribute! For example, we have an issue in zarrs for integer-array indexing that would unblock a lot of these issues!

That being said, using non-contiguous integer np.ndarray indexing for reads may not be as fast as expected given the performance of other supported methods. Until zarrs supports integer indexing, only fetching chunks is done in rust while indexing then occurs in python.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zarrs-0.1.0.tar.gz (42.7 kB view details)

Uploaded Source

Built Distributions

zarrs-0.1.0-cp311-abi3-win_arm64.whl (1.1 MB view details)

Uploaded CPython 3.11+ Windows ARM64

zarrs-0.1.0-cp311-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11+ Windows x86-64

zarrs-0.1.0-cp311-abi3-win32.whl (1.0 MB view details)

Uploaded CPython 3.11+ Windows x86

zarrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.11+ musllinux: musl 1.2+ x86-64

zarrs-0.1.0-cp311-abi3-musllinux_1_2_armv7l.whl (7.5 MB view details)

Uploaded CPython 3.11+ musllinux: musl 1.2+ ARMv7l

zarrs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl (7.5 MB view details)

Uploaded CPython 3.11+ musllinux: musl 1.2+ ARM64

zarrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ x86-64

zarrs-0.1.0-cp311-abi3-manylinux_2_28_ppc64le.whl (1.6 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ ppc64le

zarrs-0.1.0-cp311-abi3-manylinux_2_28_armv7l.whl (1.3 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ ARMv7l

zarrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ ARM64

zarrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11+ macOS 11.0+ ARM64

zarrs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11+ macOS 10.12+ x86-64

File details

Details for the file zarrs-0.1.0.tar.gz.

File metadata

  • Download URL: zarrs-0.1.0.tar.gz
  • Upload date:
  • Size: 42.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for zarrs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9873ff4fc0c69f1bf50137857716af7041fa5a39397c87c096eda6836fdb1225
MD5 00d5f9427ad661193a11b82974b61108
BLAKE2b-256 9c6ee88fc089ce686c9928238ce952fe2f98e51557c376755d0b8b7b14c38cae

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0.tar.gz:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-win_arm64.whl.

File metadata

  • Download URL: zarrs-0.1.0-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 1a8c3b8227019a83bf27ba13dbb83047dcad2e9dc5b8b92d855b40bc705856e9
MD5 5a11b0f952daa65253852a50e1c86a60
BLAKE2b-256 3c00b70e922799385f3962b309b87fb571903ab3257c9f12af035ba962f99a62

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-win_arm64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: zarrs-0.1.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 244fb53b4c4265a2f0646844a4d2c94b886f8436a265878feff4378101afb180
MD5 f8675fee12b4fad51489db6a621560a4
BLAKE2b-256 b5350a0f6c10cda31126783f0bc750b805c443d64f17781a0e9c597c21e3166b

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-win_amd64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-win32.whl.

File metadata

  • Download URL: zarrs-0.1.0-cp311-abi3-win32.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.11+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-win32.whl
Algorithm Hash digest
SHA256 5691c995e3ffc431847546b809d39d15127b1f73489c64dcf49fbacd89e87bc4
MD5 6b3abe4ee1bf74b390ee60f1c1675d16
BLAKE2b-256 130d0c21d93402d9ffd9cfcf3a85b3193cde23cc678b91ba9345016fb8e88c65

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-win32.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 df34ec1eb325236ef117f5bba9b2b0b431fb58470521b1406e1d30e6c1005f85
MD5 e2323cad65b1058f4e292236cdc345c1
BLAKE2b-256 6b1e813c0d7e786251c09218fa4fe7a5a50d33342f3145328461cdfd72bc5432

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 a072a1cd28fb2081aeb428bb9a75e1afd140b988254d38f2f36ee2b064f0f161
MD5 28163b30fb1dd4ab5a286945554dbd1f
BLAKE2b-256 79b5514211ae10eb0a5eac57d15fa368f4bbe9825e4219133e5157be6f83bbbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-musllinux_1_2_armv7l.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 12d84e21ce3c35ccae4403728c9fe75b94588d00c03a0421a51d462af2726fa7
MD5 1a95f5c106b65b24d31036ec4c5eaf84
BLAKE2b-256 00859f67ada99105a84be84f1de341bc5b859e365e342c20656b1add8339c8af

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 872f3be41a2adf73bd333d9f3c2c9b459443bf63db5b1b6d09b8ded747fbcd90
MD5 053f6db61cb2200515923786c3161aab
BLAKE2b-256 906fb404acfaec7d3894998e0b2b141080d5a6963b85d5bfa717e8765476af23

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-manylinux_2_28_ppc64le.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-manylinux_2_28_ppc64le.whl
Algorithm Hash digest
SHA256 d2bc7333f0a721dce43d7a6dd575b297b2c18cbfdb0257fdadf1a6fe3b28edf6
MD5 f8801cb2c35da7a8be69d1c17f67eb73
BLAKE2b-256 da8020eabe2430cd824d21b484d940f257b92ce79aa2f95c96dc920a269701a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-manylinux_2_28_ppc64le.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-manylinux_2_28_armv7l.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-manylinux_2_28_armv7l.whl
Algorithm Hash digest
SHA256 5ee58653ed9048270414685a33a561baf0ee1160a20b7a189f3a1f7c6e020b10
MD5 1632480a44f01dc554414b2cea2742bd
BLAKE2b-256 c2eeb73e4600ad0aa77f4fb99c9203d468da998a43b5cd0fad8c90eef21e7bba

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-manylinux_2_28_armv7l.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 302651a60aec11e12ad79be1ec059dfeffa6c7ee71a48fc65bcbc5e14e8a9459
MD5 0e5b3ce34055263778a10b06232c0df4
BLAKE2b-256 bdb5ab0d9c11867c4d8fed24f7dcfe2aa1140a58e118f1263823cf4fc7c8c80b

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-manylinux_2_28_aarch64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 303951f3507af937a68a9441f4d97bc08e06d3f699cacb5320b8947392eaaf65
MD5 38aca8046a8729c314d152ef815e9a83
BLAKE2b-256 2fc8d4ffdeec7a9a9576d529f72fbe9d9d1ec9e654e8ccfff17945cea0f64d75

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

File details

Details for the file zarrs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for zarrs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 665c44cd37bee2f72b7b583f7c5f2c12d02c2f5726065898f9fc556d9e92e3cb
MD5 417b23028a39e07b449bc97a9bc02291
BLAKE2b-256 7bcc5eaaf9a6cf8211d7062e2d8dfb0cb8f53cc7ada953edb8d63cd3b308d27b

See more details on using hashes here.

Provenance

The following attestation bundles were made for zarrs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: cd.yml on ilan-gold/zarrs-python

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page