-
Notifications
You must be signed in to change notification settings - Fork 7
adds codecs that numcodecs defines #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
normanrz
wants to merge
6
commits into
main
Choose a base branch
from
numcodecs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"const": "numcodecs.adler32" | ||
}, | ||
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"location": { | ||
"type": "string", | ||
"enum": ["start", "end"] | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["name"], | ||
"additionalProperties": false | ||
}, | ||
{ "const": "numcodecs.adler32" } | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"const": "numcodecs.astype" | ||
}, | ||
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"encode_dtype": { | ||
"type": "string" | ||
}, | ||
"decode_dtype": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": ["encode_dtype"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["name", "configuration"], | ||
"additionalProperties": false | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"const": "numcodecs.bitround" | ||
}, | ||
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"keepbits": { | ||
"type": "integer" | ||
} | ||
}, | ||
"required": ["keepbits"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["name", "configuration"], | ||
"additionalProperties": false | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"const": "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 | ||
}, | ||
{ "const": "numcodecs.blosc" } | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# BZ2 codec | ||
|
||
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 `numcodecs.bz2`. | ||
|
||
## Configuration parameters | ||
|
||
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 bzip2 compressed chunks: | ||
|
||
```json | ||
{ | ||
"codecs": [{ "name": "bytes" }, { | ||
"name": "numcodecs.bz2", | ||
"configuration": { | ||
"level": 1 | ||
} | ||
}], | ||
} | ||
``` | ||
|
||
|
||
## Format and algorithm | ||
|
||
See https://numcodecs.readthedocs.io/en/stable/compression/bz2.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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"const": "numcodecs.bz2" | ||
}, | ||
"configuration": { | ||
"type": "object", | ||
"properties": { | ||
"level": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 9 | ||
} | ||
}, | ||
"required": ["level"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["name"], | ||
"additionalProperties": false | ||
}, | ||
{ "const": "numcodecs.bz2" } | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to be clear about which data type identifiers are permitted here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2 style codecs will use numpy-style dtype identifiers, which are not valid in v3