Skip to content

Commit 89ea29d

Browse files
committed
feature(data-types): add datetime64, fixed-length-ascii, fixed-length-bytes, and fixed-length-ucs4 data-types from zarr-python
1 parent 72b77dc commit 89ea29d

File tree

8 files changed

+236
-0
lines changed

8 files changed

+236
-0
lines changed

data-types/datetime64/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Datetime64 data type
2+
3+
Defines a data type for a datetime object based on a 64-bit integer.
4+
5+
## Permitted fill values
6+
7+
The value of the `fill_value` metadata key must be a signed 64-bit integer.
8+
9+
## Example
10+
11+
For example, the array metadata below specifies that the array uses the datetime64 data type:
12+
13+
```json
14+
{
15+
"data_type": "datetime64",
16+
"fill_value": -9223372036854775808,
17+
"configuration": {
18+
"unit": "s"
19+
},
20+
}
21+
```
22+
23+
## Notes
24+
25+
Valid values for the `unit` configuration option include: `["Y", "M", "W", "D", "h", "m", "s", "ms", "us", "μs", "ns", "ps", "fs", "as"]`
26+
27+
## Change log
28+
29+
No changes yet.
30+
31+
## Current maintainers
32+
33+
* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs)

data-types/datetime64/schema.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"oneOf": [
4+
{
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"const": "datetime64"
9+
},
10+
"configuration": {
11+
"type": "object",
12+
"properties": {
13+
"unit": {
14+
"type": "string"
15+
}
16+
},
17+
"required": ["unit"],
18+
"additionalProperties": false
19+
}
20+
},
21+
"required": ["name", "configuration"],
22+
"additionalProperties": false
23+
},
24+
{ "const": "datetime64" }
25+
]
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Fixed-length ASCII data type
2+
3+
Defines a data type for fixed-length ASCII strings.
4+
5+
## Permitted fill values
6+
7+
The value of the `fill_value` metadata key must be a string.
8+
9+
## Example
10+
11+
For example, the array metadata below specifies that the array contains fixed-length ASCII strings:
12+
13+
```json
14+
{
15+
"data_type": "fixed-length-ascii",
16+
"fill_value": "",
17+
"configuration": {
18+
"length_bits": 24
19+
},
20+
}
21+
```
22+
23+
## Notes
24+
25+
TBD
26+
27+
## Change log
28+
29+
No changes yet.
30+
31+
## Current maintainers
32+
33+
* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"oneOf": [
4+
{
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"const": "fixed-length-ascii"
9+
},
10+
"configuration": {
11+
"type": "object",
12+
"properties": {
13+
"length_bits": {
14+
"type": "integer"
15+
}
16+
},
17+
"required": ["length_bits"],
18+
"additionalProperties": false
19+
}
20+
},
21+
"required": ["name", "configuration"],
22+
"additionalProperties": false
23+
},
24+
{ "const": "fixed-length-ascii" }
25+
]
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Fixed-length bytes data type
2+
3+
Defines a data type for fixed-length byte strings.
4+
5+
## Permitted fill values
6+
7+
The value of the `fill_value` metadata key must be a string.
8+
9+
## Example
10+
11+
For example, the array metadata below specifies that the array contains fixed-length byte strings:
12+
13+
```json
14+
{
15+
"data_type": "fixed-length-bytes",
16+
"fill_value": "",
17+
"configuration": {
18+
"length_bits": 24
19+
},
20+
}
21+
```
22+
23+
## Notes
24+
25+
TBD
26+
27+
## Change log
28+
29+
No changes yet.
30+
31+
## Current maintainers
32+
33+
* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"oneOf": [
4+
{
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"const": "fixed-length-bytes"
9+
},
10+
"configuration": {
11+
"type": "object",
12+
"properties": {
13+
"length_bits": {
14+
"type": "integer"
15+
}
16+
},
17+
"required": ["length_bits"],
18+
"additionalProperties": false
19+
}
20+
},
21+
"required": ["name", "configuration"],
22+
"additionalProperties": false
23+
},
24+
{ "const": "fixed-length-bytes" }
25+
]
26+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Fixed-length Unicode string data type
2+
3+
Defines a data type for fixed-length Unicode strings.
4+
5+
## Permitted fill values
6+
7+
The value of the `fill_value` metadata key must be a string.
8+
9+
## Example
10+
11+
For example, the array metadata below specifies that the array contains fixed-length unicode strings:
12+
13+
```json
14+
{
15+
"data_type": "fixed-length-ucs4",
16+
"fill_value": "",
17+
"configuration": {
18+
"length_bits": 24
19+
},
20+
}
21+
```
22+
23+
## Notes
24+
25+
TBD
26+
27+
## Change log
28+
29+
No changes yet.
30+
31+
## Current maintainers
32+
33+
* [zarr-python core development team](https://github.com/orgs/zarr-developers/teams/python-core-devs)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"oneOf": [
4+
{
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"const": "fixed-length-ucs4"
9+
},
10+
"configuration": {
11+
"type": "object",
12+
"properties": {
13+
"length_bits": {
14+
"type": "integer"
15+
}
16+
},
17+
"required": ["length_bits"],
18+
"additionalProperties": false
19+
}
20+
},
21+
"required": ["name", "configuration"],
22+
"additionalProperties": false
23+
},
24+
{ "const": "fixed-length-ucs4" }
25+
]
26+
}

0 commit comments

Comments
 (0)