feat(format): name the filter in UnsupportedFilter errors; Blosc2/ZFP stay errors
Blosc2 (32026) is out of reach for now: hdf5plugin's Blosc2 filter stores each HDF5 chunk as a Blosc2 super-chunk frame (msgpack header, a compressed chunk-offset index, trailer metalayers) and, for 2-D and larger chunks, as a B2ND array whose n-D blocks have to be reassembled - on top of the Blosc2 chunk format itself (extended header, filter pipeline, special-value chunks). ZFP (32013) is out of scope. Both keep failing with UnsupportedFilter, and the message now says what the ID is: "unsupported filter: 32026 (Blosc2, not implemented by clawhdf5)", or, for a filter this build left out, "... (Blosc; this build lacks the `blosc` feature)". filter_registry::known_filter exposes the table. tests/plugin_filters_interop.rs: hdf5plugin's Blosc2 and ZFP datasets read as an error naming the filter, never as data. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -406,9 +406,17 @@ impl fmt::Display for FormatError {
|
||||
FormatError::InvalidFilterPipelineVersion(v) => {
|
||||
write!(f, "invalid filter pipeline version: {v}")
|
||||
}
|
||||
FormatError::UnsupportedFilter(id) => {
|
||||
write!(f, "unsupported filter: {id}")
|
||||
}
|
||||
FormatError::UnsupportedFilter(id) => match crate::filter_registry::known_filter(*id) {
|
||||
Some((name, Some(feature))) => write!(
|
||||
f,
|
||||
"unsupported filter: {id} ({name}; this build lacks the `{feature}` feature)"
|
||||
),
|
||||
Some((name, None)) => write!(
|
||||
f,
|
||||
"unsupported filter: {id} ({name}, not implemented by clawhdf5)"
|
||||
),
|
||||
None => write!(f, "unsupported filter: {id}"),
|
||||
},
|
||||
FormatError::FilterError(msg) => {
|
||||
write!(f, "filter error: {msg}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user