agentsclimarketplace

Alterlab zarr

Skill AlterLab-IEU/AlterLab-Academic-Skills/skills/data-science/alterlab-zarr

Chunked, compressed N-dimensional arrays for cloud storage with Zarr — parallel I/O, S3/GCS integration, and NumPy/Dask/Xarray compatibility. Use when storing or reading large N-D scientific arrays, streaming chunked data to/from cloud object stores, or building large-scale scientific computing pipelines. Part of the AlterLab Academic Skills suite.From its SKILL.md

Install
npx -y skills add AlterLab-IEU/AlterLab-Academic-Skills --skill alterlab-zarr

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.7 KB, 795 tokens by cl100k_base, as published. Nobody here has run it

Zarr Python

Overview

Zarr is a Python library for storing large N-dimensional arrays with chunking and compression. Apply this skill for efficient parallel I/O, cloud-native workflows, and seamless integration with NumPy, Dask, and Xarray.

Quick Start

Installation

uv pip install zarr

Requires Python 3.11+ and Zarr v3 (zarr>=3). For cloud storage support, install the matching fsspec backend:

uv pip install s3fs   # For S3
uv pip install gcsfs  # For Google Cloud Storage

Basic Array Creation

import zarr
import numpy as np

# Create a 2D array with chunking and compression
z = zarr.create_array(
    store="data/my_array.zarr",
    shape=(10000, 10000),
    chunks=(1000, 1000),
    dtype="f4"
)

# Write data using NumPy-style indexing
z[:, :] = np.random.random((10000, 10000))

# Read data
data = z[0:100, 0:100]  # Returns NumPy array

Core Workflow

  1. Create or open an array/group, picking a store appropriate to the environment (local, in-memory, ZIP, S3/GCS).
  2. Choose chunking aligned to your access pattern (aim for 1-10 MB chunks; rows-first → chunks span columns, and vice versa). This is the single biggest performance lever.
  3. Pick compression via compressors= based on workload — Zstandard (the default), Blosc+LZ4 (fast), Gzip (max ratio); compressors=None to disable.
  4. Read/write with NumPy-style indexing; resize/append as data grows.
  5. Scale out with Dask (lazy, out-of-core, parallel) or label with Xarray for climate/geospatial data.
  6. For cloud and many-array stores, consolidate metadata and consider sharding to cut object/file count.
# Minimal end-to-end
import zarr, numpy as np
z = zarr.create_array(store="data/my_array.zarr", shape=(10000, 10000),
                      chunks=(1000, 1000), dtype="f4")
z[:, :] = np.random.random((10000, 10000))
sub = z[0:100, 0:100]            # returns a NumPy array

Routing — where to look

You need…Go to
Array create/open, read/write, resize/append, attributes, groups & hierarchies, consolidated metadatareferences/array_operations.md
Chunk-size guidelines, aligning chunks to access patterns, sharding, compression codecs & tipsreferences/chunking_compression.md
Local / in-memory / ZIP / S3 / GCS stores and cloud best practicesreferences/storage_backends.md
NumPy / Dask / Xarray integration, thread- and process-safe parallel writesreferences/integration.md
Performance checklist, profiling, common patterns (time series, large matrices, cloud-native, format conversion), troubleshootingreferences/patterns_performance.md
Full API surfacereferences/api_reference.md

Additional Resources

What ships with it: 7 files

38.5 KB alongside SKILL.md

evals/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.