From 0a0f41cbb974f81b786768a25d6f3068ecb18797 Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Mon, 24 Feb 2025 16:15:58 +0100 Subject: [PATCH 1/6] add bz2 --- codecs/numcodecs.bz2/README.md | 39 ++++++++++++++++++++++++++++++++ codecs/numcodecs.bz2/schema.json | 21 +++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 codecs/numcodecs.bz2/README.md create mode 100644 codecs/numcodecs.bz2/schema.json diff --git a/codecs/numcodecs.bz2/README.md b/codecs/numcodecs.bz2/README.md new file mode 100644 index 0000000..d7ad777 --- /dev/null +++ b/codecs/numcodecs.bz2/README.md @@ -0,0 +1,39 @@ +# BZ2 codec + +Defines a `bytes -> bytes` codec that compresses chunks using the bz2 algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `vlen-bytes`. + +## Configuration parameters + +None. + +## Example + +For example, the array metadata below specifies that the array contains variable-length byte strings: + +```json +{ + "codecs": [{ + "name": "bz2" + }], +} +``` + +## Format and algorithm + +This is a `array -> bytes` codec. + +This codec is only compatible with the [`"bytes"`](../../data-types/bytes/README.md) data type. + +See https://numcodecs.readthedocs.io/en/stable/other/vlen.html#vlenbytes for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.bz2/schema.json b/codecs/numcodecs.bz2/schema.json new file mode 100644 index 0000000..bf6419e --- /dev/null +++ b/codecs/numcodecs.bz2/schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["bz2"] + }, + "configuration": { + "type": "object", + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["bz2"] } + ] +} From 34ac80c397d3c43e0a2469cad64cbeff9085a554 Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Mon, 24 Feb 2025 16:32:59 +0100 Subject: [PATCH 2/6] gzip --- codecs/numcodecs.bz2/README.md | 23 +++++++++--------- codecs/numcodecs.bz2/schema.json | 10 ++++++-- codecs/numcodecs.gzip/README.md | 40 +++++++++++++++++++++++++++++++ codecs/numcodecs.gzip/schema.json | 27 +++++++++++++++++++++ 4 files changed, 87 insertions(+), 13 deletions(-) create mode 100644 codecs/numcodecs.gzip/README.md create mode 100644 codecs/numcodecs.gzip/schema.json diff --git a/codecs/numcodecs.bz2/README.md b/codecs/numcodecs.bz2/README.md index d7ad777..c8b8e50 100644 --- a/codecs/numcodecs.bz2/README.md +++ b/codecs/numcodecs.bz2/README.md @@ -1,34 +1,35 @@ # BZ2 codec -Defines a `bytes -> bytes` codec that compresses chunks using the bz2 algorithm. +Defines a `bytes -> bytes` codec that compresses chunks using the bzip2 algorithm. ## Codec name -The value of the `name` member in the codec object MUST be `vlen-bytes`. +The value of the `name` member in the codec object MUST be `numcodecs.bz2`. ## Configuration parameters -None. +See https://numcodecs.readthedocs.io/en/stable/compression/bz2.html for details about the configuration parameters. + +- `level` ## Example -For example, the array metadata below specifies that the array contains variable-length byte strings: +For example, the array metadata below specifies that the array contains bzip2 compressed chunks: ```json { - "codecs": [{ - "name": "bz2" + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.bz2", + "configuration": { + "level": 1 + } }], } ``` ## Format and algorithm -This is a `array -> bytes` codec. - -This codec is only compatible with the [`"bytes"`](../../data-types/bytes/README.md) data type. - -See https://numcodecs.readthedocs.io/en/stable/other/vlen.html#vlenbytes for details about the encoding. +See https://numcodecs.readthedocs.io/en/stable/compression/bz2.html for details about the encoding. ## Change log diff --git a/codecs/numcodecs.bz2/schema.json b/codecs/numcodecs.bz2/schema.json index bf6419e..4ebddb7 100644 --- a/codecs/numcodecs.bz2/schema.json +++ b/codecs/numcodecs.bz2/schema.json @@ -6,16 +6,22 @@ "properties": { "name": { "type": "string", - "enum": ["bz2"] + "enum": ["numcodecs.bz2"] }, "configuration": { "type": "object", + "properties": { + "level": { + "type": "number" + } + }, + "required": ["level"], "additionalProperties": false } }, "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["bz2"] } + { "type": "string", "enum": ["numcodecs.bz2"] } ] } diff --git a/codecs/numcodecs.gzip/README.md b/codecs/numcodecs.gzip/README.md new file mode 100644 index 0000000..029621a --- /dev/null +++ b/codecs/numcodecs.gzip/README.md @@ -0,0 +1,40 @@ +# Gzip codec + +Defines a `bytes -> bytes` codec that compresses chunks using the gzip algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.gzip`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/gzip.html for details about the configuration parameters. + +- `level` + +## Example + +For example, the array metadata below specifies that the array contains gzip compressed chunks: + +```json +{ + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.gzip", + "configuration": { + "level": 1 + } + }], +} +``` + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/gzip.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.gzip/schema.json b/codecs/numcodecs.gzip/schema.json new file mode 100644 index 0000000..8c80e1b --- /dev/null +++ b/codecs/numcodecs.gzip/schema.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.gzip"] + }, + "configuration": { + "type": "object", + "properties": { + "level": { + "type": "number" + } + }, + "required": ["level"], + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.gzip"] } + ] +} From 1befbd994e0e0acdeb126d4b83b72938d6f725ce Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Thu, 27 Feb 2025 15:38:02 +0100 Subject: [PATCH 3/6] adds numcodecs codecs --- codecs/numcodecs.adler32/README.md | 44 ++++++++++++++++++ codecs/numcodecs.astype/README.md | 42 +++++++++++++++++ codecs/numcodecs.bitround/README.md | 41 +++++++++++++++++ codecs/numcodecs.blosc/README.md | 47 +++++++++++++++++++ codecs/numcodecs.bz2/README.md | 1 + codecs/numcodecs.crc32/README.md | 44 ++++++++++++++++++ codecs/numcodecs.crc32c/README.md | 44 ++++++++++++++++++ codecs/numcodecs.delta/README.md | 42 +++++++++++++++++ codecs/numcodecs.fixedscaleoffset/README.md | 46 +++++++++++++++++++ codecs/numcodecs.fletcher32/README.md | 41 +++++++++++++++++ codecs/numcodecs.gzip/README.md | 1 + codecs/numcodecs.jenkins_lookup3/README.md | 43 +++++++++++++++++ codecs/numcodecs.lz4/README.md | 41 +++++++++++++++++ codecs/numcodecs.lzma/README.md | 44 ++++++++++++++++++ codecs/numcodecs.packbits/README.md | 41 +++++++++++++++++ codecs/numcodecs.pcodec/README.md | 51 +++++++++++++++++++++ codecs/numcodecs.quantize/README.md | 44 ++++++++++++++++++ codecs/numcodecs.shuffle/README.md | 41 +++++++++++++++++ codecs/numcodecs.zfpy/README.md | 44 ++++++++++++++++++ codecs/numcodecs.zlib/README.md | 41 +++++++++++++++++ codecs/numcodecs.zstd/README.md | 43 +++++++++++++++++ 21 files changed, 826 insertions(+) create mode 100644 codecs/numcodecs.adler32/README.md create mode 100644 codecs/numcodecs.astype/README.md create mode 100644 codecs/numcodecs.bitround/README.md create mode 100644 codecs/numcodecs.blosc/README.md create mode 100644 codecs/numcodecs.crc32/README.md create mode 100644 codecs/numcodecs.crc32c/README.md create mode 100644 codecs/numcodecs.delta/README.md create mode 100644 codecs/numcodecs.fixedscaleoffset/README.md create mode 100644 codecs/numcodecs.fletcher32/README.md create mode 100644 codecs/numcodecs.jenkins_lookup3/README.md create mode 100644 codecs/numcodecs.lz4/README.md create mode 100644 codecs/numcodecs.lzma/README.md create mode 100644 codecs/numcodecs.packbits/README.md create mode 100644 codecs/numcodecs.pcodec/README.md create mode 100644 codecs/numcodecs.quantize/README.md create mode 100644 codecs/numcodecs.shuffle/README.md create mode 100644 codecs/numcodecs.zfpy/README.md create mode 100644 codecs/numcodecs.zlib/README.md create mode 100644 codecs/numcodecs.zstd/README.md diff --git a/codecs/numcodecs.adler32/README.md b/codecs/numcodecs.adler32/README.md new file mode 100644 index 0000000..4f7aa82 --- /dev/null +++ b/codecs/numcodecs.adler32/README.md @@ -0,0 +1,44 @@ +# Adler32 codec + +Defines a `bytes -> bytes` codec that adds a Adler32 checksum to the data. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.adler32`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#adler32 for details about the configuration parameters. + +- `location` + +## Example + +For example, the array metadata below specifies that the array contains chunks with appended checksum: + +```json +{ + "codecs": [{ + "name": "bytes", + "configuration": { "endian": "little" } + }, { + "name": "numcodecs.adler32", + "configuration": { + "location": "end" + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#adler32 for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.astype/README.md b/codecs/numcodecs.astype/README.md new file mode 100644 index 0000000..3e97b25 --- /dev/null +++ b/codecs/numcodecs.astype/README.md @@ -0,0 +1,42 @@ +# AsType codec + +Defines a `array -> array` codec that converts data between different types. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.astype`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/astype.html for details about the configuration parameters. + +- `encode_dtype` +- `decode_dtype` (optional) + +## Example + +For example, the array metadata below specifies that the array contains converted chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.astype", + "configuration": { + "encode_dtype": "float32" + } + }, { "name": "bytes", "configuration": { "endian": "little" } }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/astype.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.bitround/README.md b/codecs/numcodecs.bitround/README.md new file mode 100644 index 0000000..ca033db --- /dev/null +++ b/codecs/numcodecs.bitround/README.md @@ -0,0 +1,41 @@ +# BitRound codec + +Defines a `array -> array` codec to bit-round floating-point numbers. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.bitround`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/bitround.html for details about the configuration parameters. + +- `keepbits` + +## Example + +For example, the array metadata below specifies that the array contains bitrounded chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.bitround", + "configuration": { + "keepbits": 5 + } + }, { "name": "bytes", "configuration": { "endian": "little" } }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/bitround.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.blosc/README.md b/codecs/numcodecs.blosc/README.md new file mode 100644 index 0000000..58fef37 --- /dev/null +++ b/codecs/numcodecs.blosc/README.md @@ -0,0 +1,47 @@ +# Blosc codec + +Defines a `bytes -> bytes` codec that compresses chunks using the blosc (version 1) algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.blosc`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/blosc.html for details about the configuration parameters. + +- `cname` (optional) +- `clevel` (optional) +- `shuffle` (optional) +- `blocksize` + +## Example + +For example, the array metadata below specifies that the array contains blosc compressed chunks: + +```json +{ + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.blosc", + "configuration": { + "cname": "zstd", + "clevel": 5, + "shuffle": 1, + "blocksize": 0 + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/blosc.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.bz2/README.md b/codecs/numcodecs.bz2/README.md index c8b8e50..0c250fd 100644 --- a/codecs/numcodecs.bz2/README.md +++ b/codecs/numcodecs.bz2/README.md @@ -27,6 +27,7 @@ For example, the array metadata below specifies that the array contains bzip2 co } ``` + ## Format and algorithm See https://numcodecs.readthedocs.io/en/stable/compression/bz2.html for details about the encoding. diff --git a/codecs/numcodecs.crc32/README.md b/codecs/numcodecs.crc32/README.md new file mode 100644 index 0000000..e18945f --- /dev/null +++ b/codecs/numcodecs.crc32/README.md @@ -0,0 +1,44 @@ +# CRC32 codec + +Defines a `bytes -> bytes` codec that adds a CRC32 checksum to the data. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.crc32`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#crc32 for details about the configuration parameters. + +- `location` + +## Example + +For example, the array metadata below specifies that the array contains chunks with appended checksum: + +```json +{ + "codecs": [{ + "name": "bytes", + "configuration": { "endian": "little" } + }, { + "name": "numcodecs.crc32", + "configuration": { + "location": "end" + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#crc32 for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.crc32c/README.md b/codecs/numcodecs.crc32c/README.md new file mode 100644 index 0000000..b5b4783 --- /dev/null +++ b/codecs/numcodecs.crc32c/README.md @@ -0,0 +1,44 @@ +# CRC32C codec + +Defines a `bytes -> bytes` codec that adds a CRC32C checksum to the data. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.crc32c`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#crc32c for details about the configuration parameters. + +- `location` + +## Example + +For example, the array metadata below specifies that the array contains chunks with appended checksum: + +```json +{ + "codecs": [{ + "name": "bytes", + "configuration": { "endian": "little" } + }, { + "name": "numcodecs.crc32c", + "configuration": { + "location": "end" + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#crc32c for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.delta/README.md b/codecs/numcodecs.delta/README.md new file mode 100644 index 0000000..dbefcd6 --- /dev/null +++ b/codecs/numcodecs.delta/README.md @@ -0,0 +1,42 @@ +# Delta codec + +Defines a `array -> array` codec that performs delta encoding. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.delta`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/delta.html for details about the configuration parameters. + +- `dtype` +- `astype` (optional) + +## Example + +For example, the array metadata below specifies that the array contains delta-encoded chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.delta", + "configuration": { + "dtype": "uint8" + } + }, { "name": "bytes" }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/delta.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.fixedscaleoffset/README.md b/codecs/numcodecs.fixedscaleoffset/README.md new file mode 100644 index 0000000..99e05e4 --- /dev/null +++ b/codecs/numcodecs.fixedscaleoffset/README.md @@ -0,0 +1,46 @@ +# FixedScaleOffset codec + +Defines a `array -> array` codec that performs a numeric transformation. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.fixedscaleoffset`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/fixedscaleoffset.html for details about the configuration parameters. + +- `offset` +- `scale` +- `dtype` +- `astype` (optional) + +## Example + +For example, the array metadata below specifies that the array contains scale-offset transformed chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.fixedscaleoffset", + "configuration": { + "offset": 5, + "scale": 10, + "dtype": "int32" + } + }, { "name": "bytes", "configuration": { "endian": "little" } }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/fixedscaleoffset.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.fletcher32/README.md b/codecs/numcodecs.fletcher32/README.md new file mode 100644 index 0000000..c0e6622 --- /dev/null +++ b/codecs/numcodecs.fletcher32/README.md @@ -0,0 +1,41 @@ +# Fletcher32 codec + +Defines a `bytes -> bytes` codec that adds a Fletcher32 checksum to the data. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.fletcher32`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#fletcher32 for details about the configuration parameters. + + + +## Example + +For example, the array metadata below specifies that the array contains chunks with added checksum: + +```json +{ + "codecs": [{ + "name": "bytes", + "configuration": { "endian": "little" } + }, { + "name": "numcodecs.fletcher32" + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#fletcher32 for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.gzip/README.md b/codecs/numcodecs.gzip/README.md index 029621a..29961d5 100644 --- a/codecs/numcodecs.gzip/README.md +++ b/codecs/numcodecs.gzip/README.md @@ -27,6 +27,7 @@ For example, the array metadata below specifies that the array contains gzip com } ``` + ## Format and algorithm See https://numcodecs.readthedocs.io/en/stable/compression/gzip.html for details about the encoding. diff --git a/codecs/numcodecs.jenkins_lookup3/README.md b/codecs/numcodecs.jenkins_lookup3/README.md new file mode 100644 index 0000000..9d93fd2 --- /dev/null +++ b/codecs/numcodecs.jenkins_lookup3/README.md @@ -0,0 +1,43 @@ +# JenkinsLookup3 codec + +Defines a `bytes -> bytes` codec that adds a JenkinsLookup3 checksum to the data. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.jenkins_lookup3`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#jenkinslookup3 for details about the configuration parameters. + +- `initval` +- `prefix` (optional) + +## Example + +For example, the array metadata below specifies that the array contains chunks with appended checksum: + +```json +{ + "codecs": [{ + "name": "bytes", + "configuration": { "endian": "little" } + }, { + "name": "numcodecs.jenkins_lookup3", + "configuration": { "initval": 0 } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/checksum32.html#jenkinslookup3 for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.lz4/README.md b/codecs/numcodecs.lz4/README.md new file mode 100644 index 0000000..dacb305 --- /dev/null +++ b/codecs/numcodecs.lz4/README.md @@ -0,0 +1,41 @@ +# LZ4 codec + +Defines a `bytes -> bytes` codec that compresses chunks using the lz4 algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.lz4`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/lz4.html for details about the configuration parameters. + +- `acceleration` + +## Example + +For example, the array metadata below specifies that the array contains lz4 compressed chunks: + +```json +{ + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.lz4", + "configuration": { + "acceleration": 1 + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/lz4.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.lzma/README.md b/codecs/numcodecs.lzma/README.md new file mode 100644 index 0000000..772128c --- /dev/null +++ b/codecs/numcodecs.lzma/README.md @@ -0,0 +1,44 @@ +# LZMA codec + +Defines a `bytes -> bytes` codec that compresses chunks using the lzma algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.lzma`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/lzma.html for details about the configuration parameters. + +- `format` (optional) +- `check` (optional) +- `preset` (optional) +- `filters` (optional) + +## Example + +For example, the array metadata below specifies that the array contains lzma compressed chunks: + +```json +{ + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.lzma", + "configuration": { + "preset": 5 + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/lzma.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.packbits/README.md b/codecs/numcodecs.packbits/README.md new file mode 100644 index 0000000..08b1579 --- /dev/null +++ b/codecs/numcodecs.packbits/README.md @@ -0,0 +1,41 @@ +# PackBits codec + +Defines a `array -> array` to pack elements of a boolean array into bits in a uint8 array. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.packbits`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/packbits.html for details about the configuration parameters. + + + +## Example + +For example, the array metadata below specifies that the array contains bit-packed chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.packbits", + "configuration": { + "keepbits": 5 + } + }, { "name": "bytes" }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/packbits.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.pcodec/README.md b/codecs/numcodecs.pcodec/README.md new file mode 100644 index 0000000..5b8092f --- /dev/null +++ b/codecs/numcodecs.pcodec/README.md @@ -0,0 +1,51 @@ +# PCodec codec + +Defines a `array -> bytes` codec that compresses chunks using the pcodec algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.pcodec`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/pcodec.html for details about the configuration parameters. + +- `level` +- `mode_spec` +- `delta_spec` +- `paging_spec` +- `delta_encoding_order` +- `equal_pages_up_to` + +## Example + +For example, the array metadata below specifies that the array contains pcodec compressed chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.pcodec", + "configuration": { + "level": 5, + "mode_spec": "auto", + "delta_spec": "auto", + "paging_spec": "equal_pages_up_to", + "delta_encoding_order": null, + "equal_pages_up_to": 262144 + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/pcodec.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.quantize/README.md b/codecs/numcodecs.quantize/README.md new file mode 100644 index 0000000..de3370b --- /dev/null +++ b/codecs/numcodecs.quantize/README.md @@ -0,0 +1,44 @@ +# Quantize codec + +Defines a `array -> array` codec that performs a quantize transformation. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.quantize`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/quantize.html for details about the configuration parameters. + +- `digits` +- `dtype` +- `astype` (optional) + +## Example + +For example, the array metadata below specifies that the array contains quantized chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.quantize", + "configuration": { + "digits": 5, + "dtype": "float64" + } + }, { "name": "bytes", "configuration": { "endian": "little" } }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/quantize.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.shuffle/README.md b/codecs/numcodecs.shuffle/README.md new file mode 100644 index 0000000..1a446d2 --- /dev/null +++ b/codecs/numcodecs.shuffle/README.md @@ -0,0 +1,41 @@ +# Shuffle codec + +Defines a `array -> array` codec that provides a shuffle filter. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.shuffle`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/filter/shuffle.html for details about the configuration parameters. + +- `elementsize` + +## Example + +For example, the array metadata below specifies that the array contains shuffled chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.shuffle", + "configuration": { + "elementsize": 4 + } + }, { "name": "bytes", "configuration": { "endian": "little" } }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/filter/shuffle.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.zfpy/README.md b/codecs/numcodecs.zfpy/README.md new file mode 100644 index 0000000..ab03cfb --- /dev/null +++ b/codecs/numcodecs.zfpy/README.md @@ -0,0 +1,44 @@ +# ZFPY codec + +Defines a `array -> bytes` codec that compresses chunks using the zfpy algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.zfpy`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/zfpy.html for details about the configuration parameters. + +- `mode` +- `tolerance` (optional) +- `rate` (optional) +- `precision` (optional) + +## Example + +For example, the array metadata below specifies that the array contains zfpy compressed chunks: + +```json +{ + "codecs": [{ + "name": "numcodecs.zfpy", + "configuration": { + "mode": 4 + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/zfpy.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.zlib/README.md b/codecs/numcodecs.zlib/README.md new file mode 100644 index 0000000..7cf0f94 --- /dev/null +++ b/codecs/numcodecs.zlib/README.md @@ -0,0 +1,41 @@ +# Zlib codec + +Defines a `bytes -> bytes` codec that compresses chunks using the zlib algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.zlib`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/zlib.html for details about the configuration parameters. + +- `level` + +## Example + +For example, the array metadata below specifies that the array contains zlib compressed chunks: + +```json +{ + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.zlib", + "configuration": { + "level": 5 + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/zlib.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) diff --git a/codecs/numcodecs.zstd/README.md b/codecs/numcodecs.zstd/README.md new file mode 100644 index 0000000..af28e65 --- /dev/null +++ b/codecs/numcodecs.zstd/README.md @@ -0,0 +1,43 @@ +# Zstd codec + +Defines a `bytes -> bytes` codec that compresses chunks using the zstd algorithm. + +## Codec name + +The value of the `name` member in the codec object MUST be `numcodecs.zstd`. + +## Configuration parameters + +See https://numcodecs.readthedocs.io/en/stable/compression/zstd.html for details about the configuration parameters. + +- `level` +- `checksum` (optional) + +## Example + +For example, the array metadata below specifies that the array contains zstd compressed chunks: + +```json +{ + "codecs": [{ "name": "bytes" }, { + "name": "numcodecs.zstd", + "configuration": { + "level": 5, + "checksum": true + } + }], +} +``` + + +## Format and algorithm + +See https://numcodecs.readthedocs.io/en/stable/compression/zstd.html for details about the encoding. + +## Change log + +No changes yet. + +## Current maintainers + +* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs) From 6cf3d67d2a6d2efaad3633c9c68876c43e5c754a Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Sat, 1 Mar 2025 21:39:57 +0100 Subject: [PATCH 4/6] schema.json --- codecs/numcodecs.adler32/schema.json | 27 +++++++++++ codecs/numcodecs.astype/schema.json | 25 ++++++++++ codecs/numcodecs.bitround/schema.json | 22 +++++++++ codecs/numcodecs.blosc/schema.json | 40 ++++++++++++++++ codecs/numcodecs.bz2/schema.json | 4 +- codecs/numcodecs.crc32/schema.json | 27 +++++++++++ codecs/numcodecs.crc32c/schema.json | 27 +++++++++++ codecs/numcodecs.delta/schema.json | 29 +++++++++++ codecs/numcodecs.fixedscaleoffset/schema.json | 31 ++++++++++++ codecs/numcodecs.fletcher32/schema.json | 21 ++++++++ codecs/numcodecs.gzip/schema.json | 5 +- codecs/numcodecs.jenkins_lookup3/schema.json | 21 ++++++++ codecs/numcodecs.lz4/schema.json | 26 ++++++++++ codecs/numcodecs.lzma/schema.json | 40 ++++++++++++++++ codecs/numcodecs.packbits/schema.json | 21 ++++++++ codecs/numcodecs.pcodec/schema.json | 48 +++++++++++++++++++ codecs/numcodecs.quantize/schema.json | 29 +++++++++++ codecs/numcodecs.shuffle/schema.json | 26 ++++++++++ codecs/numcodecs.zfpy/schema.json | 38 +++++++++++++++ codecs/numcodecs.zlib/schema.json | 28 +++++++++++ codecs/numcodecs.zstd/schema.json | 29 +++++++++++ 21 files changed, 561 insertions(+), 3 deletions(-) create mode 100644 codecs/numcodecs.adler32/schema.json create mode 100644 codecs/numcodecs.astype/schema.json create mode 100644 codecs/numcodecs.bitround/schema.json create mode 100644 codecs/numcodecs.blosc/schema.json create mode 100644 codecs/numcodecs.crc32/schema.json create mode 100644 codecs/numcodecs.crc32c/schema.json create mode 100644 codecs/numcodecs.delta/schema.json create mode 100644 codecs/numcodecs.fixedscaleoffset/schema.json create mode 100644 codecs/numcodecs.fletcher32/schema.json create mode 100644 codecs/numcodecs.jenkins_lookup3/schema.json create mode 100644 codecs/numcodecs.lz4/schema.json create mode 100644 codecs/numcodecs.lzma/schema.json create mode 100644 codecs/numcodecs.packbits/schema.json create mode 100644 codecs/numcodecs.pcodec/schema.json create mode 100644 codecs/numcodecs.quantize/schema.json create mode 100644 codecs/numcodecs.shuffle/schema.json create mode 100644 codecs/numcodecs.zfpy/schema.json create mode 100644 codecs/numcodecs.zlib/schema.json create mode 100644 codecs/numcodecs.zstd/schema.json diff --git a/codecs/numcodecs.adler32/schema.json b/codecs/numcodecs.adler32/schema.json new file mode 100644 index 0000000..5bb508d --- /dev/null +++ b/codecs/numcodecs.adler32/schema.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.adler32"] + }, + "configuration": { + "type": "object", + "properties": { + "location": { + "type": "string", + "enum": ["start", "end"] + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.adler32"] } + ] +} diff --git a/codecs/numcodecs.astype/schema.json b/codecs/numcodecs.astype/schema.json new file mode 100644 index 0000000..2cc703f --- /dev/null +++ b/codecs/numcodecs.astype/schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.astype"] + }, + "configuration": { + "type": "object", + "properties": { + "encode_dtype": { + "type": "string" + }, + "decode_dtype": { + "type": "string" + } + }, + "required": ["encode_dtype"], + "additionalProperties": false + } + }, + "required": ["name", "configuration"], + "additionalProperties": false +} diff --git a/codecs/numcodecs.bitround/schema.json b/codecs/numcodecs.bitround/schema.json new file mode 100644 index 0000000..712408c --- /dev/null +++ b/codecs/numcodecs.bitround/schema.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.bitround"] + }, + "configuration": { + "type": "object", + "properties": { + "keepbits": { + "type": "integer" + } + }, + "required": ["keepbits"], + "additionalProperties": false + } + }, + "required": ["name", "configuration"], + "additionalProperties": false +} diff --git a/codecs/numcodecs.blosc/schema.json b/codecs/numcodecs.blosc/schema.json new file mode 100644 index 0000000..bcff019 --- /dev/null +++ b/codecs/numcodecs.blosc/schema.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.blosc"] + }, + "configuration": { + "type": "object", + "properties": { + "cname": { + "type": "string", + "enum": ["zstd", "blosclz", "lz4", "lz4hc", "zlib", "snappy"] + }, + "clevel": { + "type": "integer", + "minimum": 0, + "maximum": 12 + }, + "shuffle": { + "type": "integer", + "minimum": -1, + "maximum": 2 + }, + "blocksize": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.blosc"] } + ] +} diff --git a/codecs/numcodecs.bz2/schema.json b/codecs/numcodecs.bz2/schema.json index 4ebddb7..98d773d 100644 --- a/codecs/numcodecs.bz2/schema.json +++ b/codecs/numcodecs.bz2/schema.json @@ -12,7 +12,9 @@ "type": "object", "properties": { "level": { - "type": "number" + "type": "integer", + "minimum": 1, + "maximum": 9 } }, "required": ["level"], diff --git a/codecs/numcodecs.crc32/schema.json b/codecs/numcodecs.crc32/schema.json new file mode 100644 index 0000000..2f30273 --- /dev/null +++ b/codecs/numcodecs.crc32/schema.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.crc32"] + }, + "configuration": { + "type": "object", + "properties": { + "location": { + "type": "string", + "enum": ["start", "end"] + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.crc32"] } + ] +} diff --git a/codecs/numcodecs.crc32c/schema.json b/codecs/numcodecs.crc32c/schema.json new file mode 100644 index 0000000..f342a6d --- /dev/null +++ b/codecs/numcodecs.crc32c/schema.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.crc32c"] + }, + "configuration": { + "type": "object", + "properties": { + "location": { + "type": "string", + "enum": ["start", "end"] + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.crc32c"] } + ] +} diff --git a/codecs/numcodecs.delta/schema.json b/codecs/numcodecs.delta/schema.json new file mode 100644 index 0000000..1a017c7 --- /dev/null +++ b/codecs/numcodecs.delta/schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.delta"] + }, + "configuration": { + "type": "object", + "properties": { + "dtype": { + "type": "string" + }, + "astype": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.delta"] } + ] +} diff --git a/codecs/numcodecs.fixedscaleoffset/schema.json b/codecs/numcodecs.fixedscaleoffset/schema.json new file mode 100644 index 0000000..bf74c93 --- /dev/null +++ b/codecs/numcodecs.fixedscaleoffset/schema.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.fixedscaleoffset"] + }, + "configuration": { + "type": "object", + "properties": { + "offset": { + "type": "number" + }, + "scale": { + "type": "number" + }, + "dtype": { + "type": "string" + }, + "astype": { + "type": "string" + } + }, + "required": ["offset", "scale", "dtype"], + "additionalProperties": false + } + }, + "required": ["name", "configuration"], + "additionalProperties": false +} diff --git a/codecs/numcodecs.fletcher32/schema.json b/codecs/numcodecs.fletcher32/schema.json new file mode 100644 index 0000000..ffa0517 --- /dev/null +++ b/codecs/numcodecs.fletcher32/schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.fletcher32"] + }, + "configuration": { + "type": "object", + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.fletcher32"] } + ] +} diff --git a/codecs/numcodecs.gzip/schema.json b/codecs/numcodecs.gzip/schema.json index 8c80e1b..a30b304 100644 --- a/codecs/numcodecs.gzip/schema.json +++ b/codecs/numcodecs.gzip/schema.json @@ -12,10 +12,11 @@ "type": "object", "properties": { "level": { - "type": "number" + "type": "integer", + "minimum": 0, + "maximum": 9 } }, - "required": ["level"], "additionalProperties": false } }, diff --git a/codecs/numcodecs.jenkins_lookup3/schema.json b/codecs/numcodecs.jenkins_lookup3/schema.json new file mode 100644 index 0000000..1efc61c --- /dev/null +++ b/codecs/numcodecs.jenkins_lookup3/schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.jenkins_lookup3"] + }, + "configuration": { + "type": "object", + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.jenkins_lookup3"] } + ] +} diff --git a/codecs/numcodecs.lz4/schema.json b/codecs/numcodecs.lz4/schema.json new file mode 100644 index 0000000..926317e --- /dev/null +++ b/codecs/numcodecs.lz4/schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.lz4"] + }, + "configuration": { + "type": "object", + "properties": { + "acceleration": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.lz4"] } + ] +} diff --git a/codecs/numcodecs.lzma/schema.json b/codecs/numcodecs.lzma/schema.json new file mode 100644 index 0000000..75c1e38 --- /dev/null +++ b/codecs/numcodecs.lzma/schema.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.lzma"] + }, + "configuration": { + "type": "object", + "properties": { + "format": { + "type": "integer" + }, + "check": { + "type": "integer" + }, + "preset": { + "type": "integer", + "minimum": 0, + "maximum": 9 + }, + "filters": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.lzma"] } + ] +} diff --git a/codecs/numcodecs.packbits/schema.json b/codecs/numcodecs.packbits/schema.json new file mode 100644 index 0000000..bc37dc9 --- /dev/null +++ b/codecs/numcodecs.packbits/schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.packbits"] + }, + "configuration": { + "type": "object", + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.packbits"] } + ] +} diff --git a/codecs/numcodecs.pcodec/schema.json b/codecs/numcodecs.pcodec/schema.json new file mode 100644 index 0000000..011e259 --- /dev/null +++ b/codecs/numcodecs.pcodec/schema.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.pcodec"] + }, + "configuration": { + "type": "object", + "properties": { + "level": { + "type": "integer", + "minimum": 0, + "maximum": 12 + }, + "mode_spec": { + "type": "string", + "enum": ["auto", "classic"] + }, + "delta_spec": { + "type": "string", + "enum": ["auto", "none", "try_consecutive", "try_lookback"] + }, + "paging_spec": { + "type": "string", + "enum": ["equal_pages_up_to"] + }, + "delta_encoding_order": { + "type": "integer", + "minimum": 0, + "maximum": 7 + }, + "equal_pages_up_to": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.pcodec"] } + ] +} diff --git a/codecs/numcodecs.quantize/schema.json b/codecs/numcodecs.quantize/schema.json new file mode 100644 index 0000000..862559b --- /dev/null +++ b/codecs/numcodecs.quantize/schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.quantize"] + }, + "configuration": { + "type": "object", + "properties": { + "digits": { + "type": "integer", + "minimum": 0 + }, + "dtype": { + "type": "string" + }, + "astype": { + "type": "string" + } + }, + "required": ["digits", "dtype"], + "additionalProperties": false + } + }, + "required": ["name", "configuration"], + "additionalProperties": false +} diff --git a/codecs/numcodecs.shuffle/schema.json b/codecs/numcodecs.shuffle/schema.json new file mode 100644 index 0000000..dc3721e --- /dev/null +++ b/codecs/numcodecs.shuffle/schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.shuffle"] + }, + "configuration": { + "type": "object", + "properties": { + "elementsize": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.shuffle"] } + ] +} diff --git a/codecs/numcodecs.zfpy/schema.json b/codecs/numcodecs.zfpy/schema.json new file mode 100644 index 0000000..cbea026 --- /dev/null +++ b/codecs/numcodecs.zfpy/schema.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.zfpy"] + }, + "configuration": { + "type": "object", + "properties": { + "mode": { + "type": "integer" + }, + "tolerance": { + "type": "number" + }, + "rate": { + "type": "number" + }, + "precision": { + "type": "integer" + }, + "compression_kwargs": { + "type": "object" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.zfpy"] } + ] +} diff --git a/codecs/numcodecs.zlib/schema.json b/codecs/numcodecs.zlib/schema.json new file mode 100644 index 0000000..dbe2a87 --- /dev/null +++ b/codecs/numcodecs.zlib/schema.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.zlib"] + }, + "configuration": { + "type": "object", + "properties": { + "level": { + "type": "integer", + "minimum": 0, + "maximum": 9 + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.zlib"] } + ] +} diff --git a/codecs/numcodecs.zstd/schema.json b/codecs/numcodecs.zstd/schema.json new file mode 100644 index 0000000..325295d --- /dev/null +++ b/codecs/numcodecs.zstd/schema.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string", + "enum": ["numcodecs.zstd"] + }, + "configuration": { + "type": "object", + "properties": { + "level": { + "type": "integer" + }, + "checksum": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "required": ["name"], + "additionalProperties": false + }, + { "type": "string", "enum": ["numcodecs.zstd"] } + ] +} From 73d96106ce8054a9be6ccc9761da876da48458ea Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Sat, 1 Mar 2025 21:52:56 +0100 Subject: [PATCH 5/6] fixes schema jsons --- codecs/numcodecs.gzip/schema.json | 2 +- codecs/numcodecs.lzma/schema.json | 28 ++++++++++++++++++++------- codecs/numcodecs.pcodec/schema.json | 13 ++++++++++--- codecs/numcodecs.quantize/schema.json | 2 +- codecs/numcodecs.zlib/schema.json | 2 +- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/codecs/numcodecs.gzip/schema.json b/codecs/numcodecs.gzip/schema.json index a30b304..2db2d61 100644 --- a/codecs/numcodecs.gzip/schema.json +++ b/codecs/numcodecs.gzip/schema.json @@ -13,7 +13,7 @@ "properties": { "level": { "type": "integer", - "minimum": 0, + "minimum": -1, "maximum": 9 } }, diff --git a/codecs/numcodecs.lzma/schema.json b/codecs/numcodecs.lzma/schema.json index 75c1e38..2056fe7 100644 --- a/codecs/numcodecs.lzma/schema.json +++ b/codecs/numcodecs.lzma/schema.json @@ -18,15 +18,29 @@ "type": "integer" }, "preset": { - "type": "integer", - "minimum": 0, - "maximum": 9 + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 9 + }, + { + "type": "null" + } + ] }, "filters": { - "type": "array", - "items": { - "type": "object" - } + "anyOf": [ + { + "type": "array", + "items": { + "type": "object" + } + }, + { + "type": "null" + } + ] } }, "additionalProperties": false diff --git a/codecs/numcodecs.pcodec/schema.json b/codecs/numcodecs.pcodec/schema.json index 011e259..84da2a4 100644 --- a/codecs/numcodecs.pcodec/schema.json +++ b/codecs/numcodecs.pcodec/schema.json @@ -29,9 +29,16 @@ "enum": ["equal_pages_up_to"] }, "delta_encoding_order": { - "type": "integer", - "minimum": 0, - "maximum": 7 + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 7 + }, + { + "type": "null" + } + ] }, "equal_pages_up_to": { "type": "integer" diff --git a/codecs/numcodecs.quantize/schema.json b/codecs/numcodecs.quantize/schema.json index 862559b..dcd1325 100644 --- a/codecs/numcodecs.quantize/schema.json +++ b/codecs/numcodecs.quantize/schema.json @@ -11,7 +11,7 @@ "properties": { "digits": { "type": "integer", - "minimum": 0 + "minimum": -1 }, "dtype": { "type": "string" diff --git a/codecs/numcodecs.zlib/schema.json b/codecs/numcodecs.zlib/schema.json index dbe2a87..4c446c2 100644 --- a/codecs/numcodecs.zlib/schema.json +++ b/codecs/numcodecs.zlib/schema.json @@ -13,7 +13,7 @@ "properties": { "level": { "type": "integer", - "minimum": 0, + "minimum": -1, "maximum": 9 } }, From 083d621a7c9e52fdb77ed6f4482404b0655d33fb Mon Sep 17 00:00:00 2001 From: Norman Rzepka Date: Thu, 10 Apr 2025 15:56:27 +0200 Subject: [PATCH 6/6] update schema --- codecs/numcodecs.adler32/schema.json | 7 +++---- codecs/numcodecs.astype/schema.json | 3 +-- codecs/numcodecs.bitround/schema.json | 3 +-- codecs/numcodecs.blosc/schema.json | 7 +++---- codecs/numcodecs.bz2/schema.json | 7 +++---- codecs/numcodecs.crc32/schema.json | 7 +++---- codecs/numcodecs.crc32c/schema.json | 7 +++---- codecs/numcodecs.delta/schema.json | 7 +++---- codecs/numcodecs.fixedscaleoffset/schema.json | 3 +-- codecs/numcodecs.fletcher32/schema.json | 7 +++---- codecs/numcodecs.gzip/schema.json | 7 +++---- codecs/numcodecs.jenkins_lookup3/schema.json | 7 +++---- codecs/numcodecs.lz4/schema.json | 7 +++---- codecs/numcodecs.lzma/schema.json | 11 +++++------ codecs/numcodecs.packbits/schema.json | 7 +++---- codecs/numcodecs.pcodec/schema.json | 12 +++++------- codecs/numcodecs.quantize/schema.json | 3 +-- codecs/numcodecs.shuffle/schema.json | 7 +++---- codecs/numcodecs.zfpy/schema.json | 7 +++---- codecs/numcodecs.zlib/schema.json | 7 +++---- codecs/numcodecs.zstd/schema.json | 7 +++---- 21 files changed, 59 insertions(+), 81 deletions(-) diff --git a/codecs/numcodecs.adler32/schema.json b/codecs/numcodecs.adler32/schema.json index 5bb508d..5f5f6fd 100644 --- a/codecs/numcodecs.adler32/schema.json +++ b/codecs/numcodecs.adler32/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.adler32"] + "const": "numcodecs.adler32" }, "configuration": { "type": "object", @@ -22,6 +21,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.adler32"] } + { "const": "numcodecs.adler32" } ] } diff --git a/codecs/numcodecs.astype/schema.json b/codecs/numcodecs.astype/schema.json index 2cc703f..a7c9861 100644 --- a/codecs/numcodecs.astype/schema.json +++ b/codecs/numcodecs.astype/schema.json @@ -3,8 +3,7 @@ "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.astype"] + "const": "numcodecs.astype" }, "configuration": { "type": "object", diff --git a/codecs/numcodecs.bitround/schema.json b/codecs/numcodecs.bitround/schema.json index 712408c..44896e3 100644 --- a/codecs/numcodecs.bitround/schema.json +++ b/codecs/numcodecs.bitround/schema.json @@ -3,8 +3,7 @@ "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.bitround"] + "const": "numcodecs.bitround" }, "configuration": { "type": "object", diff --git a/codecs/numcodecs.blosc/schema.json b/codecs/numcodecs.blosc/schema.json index bcff019..b3f8077 100644 --- a/codecs/numcodecs.blosc/schema.json +++ b/codecs/numcodecs.blosc/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.blosc"] + "const": "numcodecs.blosc" }, "configuration": { "type": "object", @@ -35,6 +34,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.blosc"] } + { "const": "numcodecs.blosc" } ] } diff --git a/codecs/numcodecs.bz2/schema.json b/codecs/numcodecs.bz2/schema.json index 98d773d..beea4db 100644 --- a/codecs/numcodecs.bz2/schema.json +++ b/codecs/numcodecs.bz2/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.bz2"] + "const": "numcodecs.bz2" }, "configuration": { "type": "object", @@ -24,6 +23,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.bz2"] } + { "const": "numcodecs.bz2" } ] } diff --git a/codecs/numcodecs.crc32/schema.json b/codecs/numcodecs.crc32/schema.json index 2f30273..8e6a74b 100644 --- a/codecs/numcodecs.crc32/schema.json +++ b/codecs/numcodecs.crc32/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.crc32"] + "const": "numcodecs.crc32" }, "configuration": { "type": "object", @@ -22,6 +21,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.crc32"] } + { "const": "numcodecs.crc32" } ] } diff --git a/codecs/numcodecs.crc32c/schema.json b/codecs/numcodecs.crc32c/schema.json index f342a6d..9641509 100644 --- a/codecs/numcodecs.crc32c/schema.json +++ b/codecs/numcodecs.crc32c/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.crc32c"] + "const": "numcodecs.crc32c" }, "configuration": { "type": "object", @@ -22,6 +21,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.crc32c"] } + { "const": "numcodecs.crc32c" } ] } diff --git a/codecs/numcodecs.delta/schema.json b/codecs/numcodecs.delta/schema.json index 1a017c7..118af1c 100644 --- a/codecs/numcodecs.delta/schema.json +++ b/codecs/numcodecs.delta/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.delta"] + "const": "numcodecs.delta" }, "configuration": { "type": "object", @@ -24,6 +23,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.delta"] } + { "const": "numcodecs.delta" } ] } diff --git a/codecs/numcodecs.fixedscaleoffset/schema.json b/codecs/numcodecs.fixedscaleoffset/schema.json index bf74c93..5cb1976 100644 --- a/codecs/numcodecs.fixedscaleoffset/schema.json +++ b/codecs/numcodecs.fixedscaleoffset/schema.json @@ -3,8 +3,7 @@ "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.fixedscaleoffset"] + "const": "numcodecs.fixedscaleoffset" }, "configuration": { "type": "object", diff --git a/codecs/numcodecs.fletcher32/schema.json b/codecs/numcodecs.fletcher32/schema.json index ffa0517..e028898 100644 --- a/codecs/numcodecs.fletcher32/schema.json +++ b/codecs/numcodecs.fletcher32/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.fletcher32"] + "const": "numcodecs.fletcher32" }, "configuration": { "type": "object", @@ -16,6 +15,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.fletcher32"] } + { "const": "numcodecs.fletcher32" } ] } diff --git a/codecs/numcodecs.gzip/schema.json b/codecs/numcodecs.gzip/schema.json index 2db2d61..48dfbce 100644 --- a/codecs/numcodecs.gzip/schema.json +++ b/codecs/numcodecs.gzip/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.gzip"] + "const": "numcodecs.gzip" }, "configuration": { "type": "object", @@ -23,6 +22,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.gzip"] } + { "const": "numcodecs.gzip" } ] } diff --git a/codecs/numcodecs.jenkins_lookup3/schema.json b/codecs/numcodecs.jenkins_lookup3/schema.json index 1efc61c..ff41873 100644 --- a/codecs/numcodecs.jenkins_lookup3/schema.json +++ b/codecs/numcodecs.jenkins_lookup3/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.jenkins_lookup3"] + "const": "numcodecs.jenkins_lookup3" }, "configuration": { "type": "object", @@ -16,6 +15,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.jenkins_lookup3"] } + { "const": "numcodecs.jenkins_lookup3" } ] } diff --git a/codecs/numcodecs.lz4/schema.json b/codecs/numcodecs.lz4/schema.json index 926317e..5e5cd65 100644 --- a/codecs/numcodecs.lz4/schema.json +++ b/codecs/numcodecs.lz4/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.lz4"] + "const": "numcodecs.lz4" }, "configuration": { "type": "object", @@ -21,6 +20,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.lz4"] } + { "const": "numcodecs.lz4" } ] } diff --git a/codecs/numcodecs.lzma/schema.json b/codecs/numcodecs.lzma/schema.json index 2056fe7..84fc2b8 100644 --- a/codecs/numcodecs.lzma/schema.json +++ b/codecs/numcodecs.lzma/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.lzma"] + "const": "numcodecs.lzma" }, "configuration": { "type": "object", @@ -18,7 +17,7 @@ "type": "integer" }, "preset": { - "anyOf": [ + "oneOf": [ { "type": "integer", "minimum": 0, @@ -30,7 +29,7 @@ ] }, "filters": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { @@ -49,6 +48,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.lzma"] } + { "const": "numcodecs.lzma" } ] } diff --git a/codecs/numcodecs.packbits/schema.json b/codecs/numcodecs.packbits/schema.json index bc37dc9..56a7bbf 100644 --- a/codecs/numcodecs.packbits/schema.json +++ b/codecs/numcodecs.packbits/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.packbits"] + "const": "numcodecs.packbits" }, "configuration": { "type": "object", @@ -16,6 +15,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.packbits"] } + { "const": "numcodecs.packbits" } ] } diff --git a/codecs/numcodecs.pcodec/schema.json b/codecs/numcodecs.pcodec/schema.json index 84da2a4..e3ff60c 100644 --- a/codecs/numcodecs.pcodec/schema.json +++ b/codecs/numcodecs.pcodec/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.pcodec"] + "const": "numcodecs.pcodec" }, "configuration": { "type": "object", @@ -25,11 +24,10 @@ "enum": ["auto", "none", "try_consecutive", "try_lookback"] }, "paging_spec": { - "type": "string", - "enum": ["equal_pages_up_to"] + "const": "equal_pages_up_to" }, "delta_encoding_order": { - "anyOf": [ + "oneOf": [ { "type": "integer", "minimum": 0, @@ -50,6 +48,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.pcodec"] } + { "const": "numcodecs.pcodec" } ] } diff --git a/codecs/numcodecs.quantize/schema.json b/codecs/numcodecs.quantize/schema.json index dcd1325..beef1ab 100644 --- a/codecs/numcodecs.quantize/schema.json +++ b/codecs/numcodecs.quantize/schema.json @@ -3,8 +3,7 @@ "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.quantize"] + "const": "numcodecs.quantize" }, "configuration": { "type": "object", diff --git a/codecs/numcodecs.shuffle/schema.json b/codecs/numcodecs.shuffle/schema.json index dc3721e..90b886e 100644 --- a/codecs/numcodecs.shuffle/schema.json +++ b/codecs/numcodecs.shuffle/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.shuffle"] + "const": "numcodecs.shuffle" }, "configuration": { "type": "object", @@ -21,6 +20,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.shuffle"] } + { "const": "numcodecs.shuffle" } ] } diff --git a/codecs/numcodecs.zfpy/schema.json b/codecs/numcodecs.zfpy/schema.json index cbea026..1b8227e 100644 --- a/codecs/numcodecs.zfpy/schema.json +++ b/codecs/numcodecs.zfpy/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.zfpy"] + "const": "numcodecs.zfpy" }, "configuration": { "type": "object", @@ -33,6 +32,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.zfpy"] } + { "const": "numcodecs.zfpy" } ] } diff --git a/codecs/numcodecs.zlib/schema.json b/codecs/numcodecs.zlib/schema.json index 4c446c2..ed72ea3 100644 --- a/codecs/numcodecs.zlib/schema.json +++ b/codecs/numcodecs.zlib/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.zlib"] + "const": "numcodecs.zlib" }, "configuration": { "type": "object", @@ -23,6 +22,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.zlib"] } + { "const": "numcodecs.zlib" } ] } diff --git a/codecs/numcodecs.zstd/schema.json b/codecs/numcodecs.zstd/schema.json index 325295d..152cbc2 100644 --- a/codecs/numcodecs.zstd/schema.json +++ b/codecs/numcodecs.zstd/schema.json @@ -1,12 +1,11 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "anyOf": [ + "oneOf": [ { "type": "object", "properties": { "name": { - "type": "string", - "enum": ["numcodecs.zstd"] + "const": "numcodecs.zstd" }, "configuration": { "type": "object", @@ -24,6 +23,6 @@ "required": ["name"], "additionalProperties": false }, - { "type": "string", "enum": ["numcodecs.zstd"] } + { "const": "numcodecs.zstd" } ] }