Skip to main content

Lightweight multiscale zarr

Project description

topozarr - lightweight multiscale zarr pyramids

Warning: experimental

Usage

Installation

uv add topozarr
# or
pip install topozarr

Example

# !pip install netcdf4 pooch 
import xarray as xr
import xproj # for crs assignment
from topozarr.coarsen import create_pyramid

# Load the air_temp tutorial xarray dataset
ds = xr.tutorial.open_dataset('air_temperature', chunks={})
ds = ds.proj.assign_crs(spatial_ref_crs={"EPSG":4326})
print(ds)
pyramid = create_pyramid(
    ds, 
    levels=2, 
    x_dim="lon", 
    y_dim="lat", 
    spec="ndpyramid" # or "zarr-multiscales"
)
print(pyramid.encoding)
print(pyramid.dt)
# Optional: Write to Zarr
!pip install obstore zarr
from obstore.store import from_url
from zarr.storage import ObjectStore


store = from_url(url = "<add_your_bucket_url>", region="<add_your_region>")
zstore = ObjectStore(store) 
result_GEOG.dt.to_zarr(zstore, mode="w", encoding = pyramid.encoding, zarr_format=3)

Development

This project uses uv for dependency management, pytest and hypothesis for testing and ruff for linting.

Sync development environment

uv sync --all-extras

Run linter

uv run pre-commit run all-files

Run tests

uv run pytest tests/

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

topozarr-0.0.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topozarr-0.0.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file topozarr-0.0.3.tar.gz.

File metadata

  • Download URL: topozarr-0.0.3.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for topozarr-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d2b6f2e8b2852158fc313c95756971eb5d72a9fa6adc8ee9b7790fa51e56f47b
MD5 8547666523eef1b407e4b5a8deb9cd4d
BLAKE2b-256 97eae3210a78e3ab8f64b2b1079f1bddf253c6ecc211e189350a6a5a576e624c

See more details on using hashes here.

File details

Details for the file topozarr-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: topozarr-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for topozarr-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a8fcf38e386bded37d15584eed68cdcafb3c462f38abade4ebbaa25e57818732
MD5 fd1110413cd2a397e2ee8e2b644e870e
BLAKE2b-256 31566e8abe59a01bfc7348c777be87e2b7607e940370f3a88d7fad82b798bb68

See more details on using hashes here.

Supported by

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