Skip to content

Commit a23173b

Browse files
authored
Bump numcodecs-qpet-sperr to v0.2.0 with support for flexible QoI block sizes (#34)
* Bump numcodecs-qpet-sperr to v0.2.0 with support for flexible QoI block sizes * Bump wac-graph to v0.8.1
1 parent dbb2721 commit a23173b

File tree

4 files changed

+41
-25
lines changed

4 files changed

+41
-25
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ numcodecs-jpeg2000 = { version = "0.3", path = "codecs/jpeg2000", default-featur
6565
numcodecs-linear-quantize = { version = "0.5", path = "codecs/linear-quantize", default-features = false }
6666
numcodecs-log = { version = "0.5", path = "codecs/log", default-features = false }
6767
numcodecs-pco = { version = "0.3", path = "codecs/pco", default-features = false }
68-
numcodecs-qpet-sperr = { version = "0.1", path = "codecs/qpet-sperr", default-features = false }
68+
numcodecs-qpet-sperr = { version = "0.2", path = "codecs/qpet-sperr", default-features = false }
6969
numcodecs-random-projection = { version = "0.4", path = "codecs/random-projection", default-features = false }
7070
numcodecs-reinterpret = { version = "0.4", path = "codecs/reinterpret", default-features = false }
7171
numcodecs-round = { version = "0.5", path = "codecs/round", default-features = false }
@@ -103,7 +103,7 @@ pyo3 = { version = "0.26", default-features = false }
103103
pyo3-error = { version = "0.6", default-features = false }
104104
pyo3-log = { version = "0.13.0", default-features = false }
105105
pythonize = { version = "0.26", default-features = false }
106-
qpet-sperr = { version = "0.1", default-features = false }
106+
qpet-sperr = { version = "0.2", default-features = false }
107107
rand = { version = "0.9.1", default-features = false }
108108
schemars = { version = "1.0.3", default-features = false }
109109
scratch = { version = "1.0", default-features = false }
@@ -119,7 +119,7 @@ thiserror = { version = "2.0.12", default-features = false }
119119
tthresh = { version = "0.1", default-features = false }
120120
twofloat = { version = "0.8", default-features = false }
121121
vecmap-rs = { version = "0.2", default-features = false }
122-
wac-graph = { version = "0.8", default-features = false }
122+
wac-graph = { version = "0.8.1", default-features = false }
123123
wasi-sandboxed-component-provider = { version = "=0.2.6", default-features = false }
124124
wasi-logger = { version = "0.1", default-features = false }
125125
wasi-preview1-component-adapter-provider = { version = "37.0", default-features = false }

codecs/qpet-sperr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "numcodecs-qpet-sperr"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
edition = { workspace = true }
55
authors = { workspace = true }
66
repository = { workspace = true }

codecs/qpet-sperr/src/lib.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ use ::zstd_sys as _;
2626
#[cfg(test)]
2727
use ::serde_json as _;
2828

29-
use std::{
30-
borrow::Cow,
31-
fmt,
32-
num::{NonZeroU16, NonZeroUsize},
33-
};
29+
use std::{borrow::Cow, fmt, num::NonZeroUsize};
3430

3531
use ndarray::{Array, Array1, ArrayBase, Axis, Data, Dimension, IxDyn, ShapeError};
3632
use num_traits::{Float, identities::Zero};
@@ -42,7 +38,7 @@ use schemars::{JsonSchema, Schema, SchemaGenerator, json_schema};
4238
use serde::{Deserialize, Deserializer, Serialize, Serializer};
4339
use thiserror::Error;
4440

45-
type QpetSperrCodecVersion = StaticCodecVersion<0, 1, 0>;
41+
type QpetSperrCodecVersion = StaticCodecVersion<0, 2, 0>;
4642

4743
#[derive(Clone, Serialize, Deserialize, JsonSchema)]
4844
// serde cannot deny unknown fields because of the flatten
@@ -72,14 +68,14 @@ pub enum QpetSperrCompressionMode {
7268
SymbolicQuantityOfInterest {
7369
/// quantity of interest expression
7470
qoi: String,
75-
/// block size over which the quantity of interest errors are averaged,
76-
/// 1 for pointwise
71+
/// 3D block size (z,y,x) over which the quantity of interest errors
72+
/// are averaged, 1x1x1 for pointwise
7773
#[serde(default = "default_qoi_block_size")]
78-
qoi_block_size: NonZeroU16,
74+
qoi_block_size: (NonZeroUsize, NonZeroUsize, NonZeroUsize),
7975
/// positive (pointwise) absolute error bound over the quantity of
8076
/// interest
8177
qoi_pwe: Positive<f64>,
82-
/// 3D size of the chunks (z, y, x) that SPERR uses internally
78+
/// 3D size of the chunks (z,y,x) that SPERR uses internally
8379
#[serde(default = "default_sperr_chunks")]
8480
sperr_chunks: (NonZeroUsize, NonZeroUsize, NonZeroUsize),
8581
/// optional positive pointwise absolute error bound over the data
@@ -94,10 +90,10 @@ pub enum QpetSperrCompressionMode {
9490
},
9591
}
9692

97-
const fn default_qoi_block_size() -> NonZeroU16 {
98-
const NON_ZERO_ONE: NonZeroU16 = NonZeroU16::MIN;
93+
const fn default_qoi_block_size() -> (NonZeroUsize, NonZeroUsize, NonZeroUsize) {
94+
const NON_ZERO_ONE: NonZeroUsize = NonZeroUsize::MIN;
9995
// 1: pointwise
100-
NON_ZERO_ONE
96+
(NON_ZERO_ONE, NON_ZERO_ONE, NON_ZERO_ONE)
10197
}
10298

10399
const fn default_sperr_chunks() -> (NonZeroUsize, NonZeroUsize, NonZeroUsize) {

codecs/qpet-sperr/tests/schema.json

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,32 @@
1010
"description": "quantity of interest expression"
1111
},
1212
"qoi_block_size": {
13-
"type": "integer",
14-
"format": "uint16",
15-
"minimum": 1,
16-
"maximum": 65535,
17-
"description": "block size over which the quantity of interest errors are averaged,\n1 for pointwise",
18-
"default": 1
13+
"type": "array",
14+
"prefixItems": [
15+
{
16+
"type": "integer",
17+
"format": "uint",
18+
"minimum": 1
19+
},
20+
{
21+
"type": "integer",
22+
"format": "uint",
23+
"minimum": 1
24+
},
25+
{
26+
"type": "integer",
27+
"format": "uint",
28+
"minimum": 1
29+
}
30+
],
31+
"minItems": 3,
32+
"maxItems": 3,
33+
"description": "3D block size (z,y,x) over which the quantity of interest errors\nare averaged, 1x1x1 for pointwise",
34+
"default": [
35+
1,
36+
1,
37+
1
38+
]
1939
},
2040
"qoi_pwe": {
2141
"type": "number",
@@ -43,7 +63,7 @@
4363
],
4464
"minItems": 3,
4565
"maxItems": 3,
46-
"description": "3D size of the chunks (z, y, x) that SPERR uses internally",
66+
"description": "3D size of the chunks (z,y,x) that SPERR uses internally",
4767
"default": [
4868
256,
4969
256,
@@ -89,7 +109,7 @@
89109
"type": "string",
90110
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
91111
"description": "The codec's encoding format version. Do not provide this parameter explicitly.",
92-
"default": "0.1.0"
112+
"default": "0.2.0"
93113
}
94114
},
95115
"title": "QpetSperrCodec",

0 commit comments

Comments
 (0)