File: README.md

package info (click to toggle)
zarr 3.1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,068 kB
  • sloc: python: 31,589; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Custom Data Type Example

This example demonstrates how to extend Zarr Python by defining a new data type.

The example shows how to:

- Define a custom `ZDType` class for the `int2` data type from [`ml_dtypes`](https://pypi.org/project/ml-dtypes/)
- Implement all required methods for serialization and deserialization
- Register the custom data type with Zarr's registry
- Create and use arrays with the custom data type in both Zarr v2 and v3 formats

## Running the Example

```bash
python examples/custom_dtype/custom_dtype.py
```

Or run with uv:

```bash
uv run examples/custom_dtype/custom_dtype.py
```