Skip to main content

Lazy slicing and transpose operations for h5py and zarr

Project description

lazy_ops

Lazy transposing and slicing of h5py Datasets and zarr arrays

Installation

$ pip install lazy_ops

Usage:

from lazy_ops import DatasetView

# h5py #
import h5py
dsetview = DatasetView(dataset) # dataset is an instance of h5py.Dataset
view1 = dsetview.lazy_slice[1:40:2,:,0:50:5].lazy_transpose([2,0,1]).lazy_slice[8,5:10]

# zarr #
import zarr
zarrview = DatasetView(zarray) # dataset is an instance of zarr.core.Array
view1 = zview.lazy_slice[1:10:2,:,5:10].lazy_transpose([0,2,1]).lazy_slice[0:3,1:4]

# reading from view on either h5py or zarr
A = view1[:]          # Brackets on DataSetView call the h5py or zarr slicing method, returning the data
B = view1.dsetread()  # same as view1[:]

# iterating on either h5yy or zarr
for ib in view.lazy_iter(axis=1):
    print(ib[0])

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

lazy_ops-0.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

lazy_ops-0.2.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file lazy_ops-0.2.0.tar.gz.

File metadata

  • Download URL: lazy_ops-0.2.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for lazy_ops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5f3ea1ab296f63e4dd4b2bef065356f1d797b07c96a6f7f5bbc3232c32f83bcc
MD5 0f0b52098b47d46559e89686db19a8b6
BLAKE2b-256 55136458abd9d85aaa5324bae4568daed6d60f6e301008480b0ad911e7859704

See more details on using hashes here.

File details

Details for the file lazy_ops-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lazy_ops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for lazy_ops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c9bdc2dd2fb8c1f5e648ff54125e39893506fc4dfc1d35e513b6206ee962166
MD5 99f738945adab6e3cea2e7ac479421fd
BLAKE2b-256 9b758d2a657b5bab5a0c90473fc42145ce441b200132700412446012e74fba78

See more details on using hashes here.

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