diff --git a/numcodecs_fixed_offset_scale/enum.FixedOffsetScaleCodecError.html b/numcodecs_fixed_offset_scale/enum.FixedOffsetScaleCodecError.html index 497f67c6..86fbeef1 100644 --- a/numcodecs_fixed_offset_scale/enum.FixedOffsetScaleCodecError.html +++ b/numcodecs_fixed_offset_scale/enum.FixedOffsetScaleCodecError.html @@ -37,15 +37,15 @@

Enum FixedOffsetScaleCodecError

Source
pub enum FixedOffsetScaleCodecError {
-    UnsupportedDtype(AnyArrayDType),
+    UnsupportedDtype(AnyArrayDType),
     MismatchedDecodeIntoArray {
-        source: AnyArrayAssignError,
+        source: AnyArrayAssignError,
     },
 }
Expand description

Errors that may occur when applying the FixedOffsetScaleCodec.

-

Variants§

§

UnsupportedDtype(AnyArrayDType)

FixedOffsetScaleCodec does not support the dtype

+

Variants§

§

UnsupportedDtype(AnyArrayDType)

FixedOffsetScaleCodec does not support the dtype

§

MismatchedDecodeIntoArray

FixedOffsetScaleCodec cannot decode into the provided array

-

Fields

§source: AnyArrayAssignError

The source of the error

-

Trait Implementations§

Source§

impl Debug for FixedOffsetScaleCodecError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for FixedOffsetScaleCodecError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for FixedOffsetScaleCodecError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AnyArrayAssignError> for FixedOffsetScaleCodecError

Source§

fn from(source: AnyArrayAssignError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Fields

§source: AnyArrayAssignError

The source of the error

+

Trait Implementations§

Source§

impl Debug for FixedOffsetScaleCodecError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for FixedOffsetScaleCodecError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for FixedOffsetScaleCodecError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AnyArrayAssignError> for FixedOffsetScaleCodecError

Source§

fn from(source: AnyArrayAssignError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/numcodecs_fixed_offset_scale/index.html b/numcodecs_fixed_offset_scale/index.html index 4b145397..8919aa6c 100644 --- a/numcodecs_fixed_offset_scale/index.html +++ b/numcodecs_fixed_offset_scale/index.html @@ -37,7 +37,7 @@

Crate numcodecs_fixed_offset_scale

Source
Expand description

CI Status MSRV Latest Version Rust Doc Crate Rust Doc Main

-

$\frac{x - o}{s}$ codec implementation for the numcodecs API.

+

$\frac{x - o}{s}$ codec implementation for the numcodecs API.

Structs§

FixedOffsetScaleCodec
Fixed offset-scale codec which calculates $c = \frac{x - o}{s}$ on encoding and $d = (c \cdot s) + o$ on decoding.

Enums§

FixedOffsetScaleCodecError
Errors that may occur when applying the FixedOffsetScaleCodec.

Functions§

scale
Compute $\frac{x - o}{s}$ over the elements of the input data array.
unscale
Compute $(x \cdot s) + o$ over the elements of the input data array.
unscale_into
Compute $(x \cdot s) + o$ over the elements of the input data array and write them into the output array.
\ No newline at end of file diff --git a/numcodecs_fixed_offset_scale/struct.FixedOffsetScaleCodec.html b/numcodecs_fixed_offset_scale/struct.FixedOffsetScaleCodec.html index 53abeab2..831f25f4 100644 --- a/numcodecs_fixed_offset_scale/struct.FixedOffsetScaleCodec.html +++ b/numcodecs_fixed_offset_scale/struct.FixedOffsetScaleCodec.html @@ -50,26 +50,26 @@

The codec only supports floating point numbers.

Fields§

§offset: f64

The offset of the data.

§scale: f64

The scale of the data.

-

Trait Implementations§

Source§

impl Clone for FixedOffsetScaleCodec

Source§

fn clone(&self) -> FixedOffsetScaleCodec

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Codec for FixedOffsetScaleCodec

Source§

type Error = FixedOffsetScaleCodecError

Error type that may be returned during encodeing -and decodeing.
Source§

fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>

Encodes the data and returns the result. Read more
Source§

fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>

Decodes the encoded data and returns the result. Read more
Source§

fn decode_into( +

Trait Implementations§

Source§

impl Clone for FixedOffsetScaleCodec

Source§

fn clone(&self) -> FixedOffsetScaleCodec

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Codec for FixedOffsetScaleCodec

Source§

type Error = FixedOffsetScaleCodecError

Error type that may be returned during encodeing +and decodeing.
Source§

fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>

Encodes the data and returns the result. Read more
Source§

fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>

Decodes the encoded data and returns the result. Read more
Source§

fn decode_into( &self, - encoded: AnyArrayView<'_>, - decoded: AnyArrayViewMut<'_>, -) -> Result<(), Self::Error>

Decodes the encoded data and writes the result into the provided -decoded output. Read more
Source§

impl<'de> Deserialize<'de> for FixedOffsetScaleCodec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where + encoded: AnyArrayView<'_>, + decoded: AnyArrayViewMut<'_>, +) -> Result<(), Self::Error>

Decodes the encoded data and writes the result into the provided +decoded output. Read more
Source§

impl<'de> Deserialize<'de> for FixedOffsetScaleCodec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for FixedOffsetScaleCodec

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
§

fn always_inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for FixedOffsetScaleCodec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StaticCodec for FixedOffsetScaleCodec

Source§

const CODEC_ID: &'static str = "fixed-offset-scale"

Codec identifier.
Source§

type Config<'de> = FixedOffsetScaleCodec

Configuration type, from which the codec can be created infallibly. Read more
Source§

fn from_config(config: Self::Config<'_>) -> Self

Instantiate a codec from its configuration.
Source§

fn get_config(&self) -> StaticCodecConfig<'_, Self>

Get the configuration for this codec. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StaticCodec for FixedOffsetScaleCodec

Source§

const CODEC_ID: &'static str = "fixed-offset-scale"

Codec identifier.
Source§

type Config<'de> = FixedOffsetScaleCodec

Configuration type, from which the codec can be created infallibly. Read more
Source§

fn from_config(config: Self::Config<'_>) -> Self

Instantiate a codec from its configuration.
Source§

fn get_config(&self) -> StaticCodecConfig<'_, Self>

Get the configuration for this codec. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where - T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> DynCodec for T
where - T: StaticCodec,

Source§

type Type = StaticCodecType<T>

Type object type for this codec.
Source§

fn ty(&self) -> <T as DynCodec>::Type

Returns the type object for this codec.
Source§

fn get_config<S>( + T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> DynCodec for T
where + T: StaticCodec,

Source§

type Type = StaticCodecType<T>

Type object type for this codec.
Source§

fn ty(&self) -> <T as DynCodec>::Type

Returns the type object for this codec.
Source§

fn get_config<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where - S: Serializer,

Serializes the configuration parameters for this codec. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

+ S: Serializer,
Serializes the configuration parameters for this codec. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of diff --git a/numcodecs_zfp/enum.ZfpCodecError.html b/numcodecs_zfp/enum.ZfpCodecError.html index e4123eed..56c9a9e8 100644 --- a/numcodecs_zfp/enum.ZfpCodecError.html +++ b/numcodecs_zfp/enum.ZfpCodecError.html @@ -37,7 +37,7 @@

Enum ZfpCodecError

Source
pub enum ZfpCodecError {
-    UnsupportedDtype(AnyArrayDType),
+    UnsupportedDtype(AnyArrayDType),
     FixedAccuracyModeIntegerData,
     ExcessiveDimensionality {
         shape: Vec<usize>,
@@ -48,19 +48,19 @@
     HeaderEncodeFailed,
     ZfpEncodeFailed,
     EncodedDataNotBytes {
-        dtype: AnyArrayDType,
+        dtype: AnyArrayDType,
     },
     EncodedDataNotOneDimensional {
         shape: Vec<usize>,
     },
     HeaderDecodeFailed,
     MismatchedDecodeIntoArray {
-        source: AnyArrayAssignError,
+        source: AnyArrayAssignError,
     },
     DecodeUnknownDtype(u32),
     ZfpDecodeFailed,
 }
Expand description

Errors that may occur when applying the ZfpCodec.

-

Variants§

§

UnsupportedDtype(AnyArrayDType)

ZfpCodec does not support the dtype

+

Variants§

§

UnsupportedDtype(AnyArrayDType)

ZfpCodec does not support the dtype

§

FixedAccuracyModeIntegerData

ZfpCodec does not support the fixed accuracy mode for integer data

§

ExcessiveDimensionality

ZfpCodec only supports 1-4 dimensional data

Fields

§shape: Vec<usize>

The unexpected shape of the data

@@ -70,16 +70,16 @@
§

ZfpEncodeFailed

ZfpCodec failed to encode the data

§

EncodedDataNotBytes

ZfpCodec can only decode one-dimensional byte arrays but received an array of a different dtype

-

Fields

§dtype: AnyArrayDType

The unexpected dtype of the encoded array

+

Fields

§dtype: AnyArrayDType

The unexpected dtype of the encoded array

§

EncodedDataNotOneDimensional

ZfpCodec can only decode one-dimensional byte arrays but received an array of a different shape

Fields

§shape: Vec<usize>

The unexpected shape of the encoded array

§

HeaderDecodeFailed

ZfpCodec failed to decode the header

§

MismatchedDecodeIntoArray

ZfpCodec cannot decode into the provided array

-

Fields

§source: AnyArrayAssignError

The source of the error

+

Fields

§source: AnyArrayAssignError

The source of the error

§

DecodeUnknownDtype(u32)

ZfpCodec failed to decode the data with the unknown dtype

§

ZfpDecodeFailed

ZfpCodec failed to decode the data

-

Trait Implementations§

Source§

impl Debug for ZfpCodecError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ZfpCodecError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ZfpCodecError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AnyArrayAssignError> for ZfpCodecError

Source§

fn from(source: AnyArrayAssignError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Trait Implementations§

Source§

impl Debug for ZfpCodecError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ZfpCodecError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ZfpCodecError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<AnyArrayAssignError> for ZfpCodecError

Source§

fn from(source: AnyArrayAssignError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

diff --git a/numcodecs_zfp/fn.decompress.html b/numcodecs_zfp/fn.decompress.html index bd90173c..dee87644 100644 --- a/numcodecs_zfp/fn.decompress.html +++ b/numcodecs_zfp/fn.decompress.html @@ -36,7 +36,7 @@ }); -

Function decompress

Source
pub fn decompress(encoded: &[u8]) -> Result<AnyArray, ZfpCodecError>
Expand description

Decompress the encoded data into an array using ZFP.

+

Function decompress

Source
pub fn decompress(encoded: &[u8]) -> Result<AnyArray, ZfpCodecError>
Expand description

Decompress the encoded data into an array using ZFP.

§Errors

Errors with

Source§

impl<T> DynCodec for T
where + T: StaticCodec,

Source§

type Type = StaticCodecType<T>

Type object type for this codec.
Source§

fn ty(&self) -> <T as DynCodec>::Type

Returns the type object for this codec.
Source§

fn get_config<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where - S: Serializer,

Serializes the configuration parameters for this codec. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

+ S: Serializer,
Serializes the configuration parameters for this codec. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of diff --git a/src/numcodecs_fixed_offset_scale/lib.rs.html b/src/numcodecs_fixed_offset_scale/lib.rs.html index 16a48232..b3a0eace 100644 --- a/src/numcodecs_fixed_offset_scale/lib.rs.html +++ b/src/numcodecs_fixed_offset_scale/lib.rs.html @@ -295,8 +295,8 @@ use ndarray::{Array, ArrayBase, ArrayView, ArrayViewMut, Data, Dimension}; use num_traits::Float; use numcodecs::{ - AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayView, AnyArrayViewMut, AnyCowArray, - Codec, StaticCodec, StaticCodecConfig, + AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayView, AnyArrayViewMut, AnyCowArray, + Codec, StaticCodec, StaticCodecConfig, }; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -320,45 +320,45 @@ pub scale: f64, } -impl Codec for FixedOffsetScaleCodec { +impl Codec for FixedOffsetScaleCodec { type Error = FixedOffsetScaleCodecError; - fn encode(&self, data: AnyCowArray) -> Result<AnyArray, Self::Error> { + fn encode(&self, data: AnyCowArray) -> Result<AnyArray, Self::Error> { match data { #[allow(clippy::cast_possible_truncation)] - AnyCowArray::F32(data) => Ok(AnyArray::F32(scale( + AnyCowArray::F32(data) => Ok(AnyArray::F32(scale( data, self.offset as f32, self.scale as f32, ))), - AnyCowArray::F64(data) => Ok(AnyArray::F64(scale(data, self.offset, self.scale))), + AnyCowArray::F64(data) => Ok(AnyArray::F64(scale(data, self.offset, self.scale))), encoded => Err(FixedOffsetScaleCodecError::UnsupportedDtype( - encoded.dtype(), + encoded.dtype(), )), } } - fn decode(&self, encoded: AnyCowArray) -> Result<AnyArray, Self::Error> { + fn decode(&self, encoded: AnyCowArray) -> Result<AnyArray, Self::Error> { match encoded { #[allow(clippy::cast_possible_truncation)] - AnyCowArray::F32(encoded) => Ok(AnyArray::F32(unscale( + AnyCowArray::F32(encoded) => Ok(AnyArray::F32(unscale( encoded, self.offset as f32, self.scale as f32, ))), - AnyCowArray::F64(encoded) => { - Ok(AnyArray::F64(unscale(encoded, self.offset, self.scale))) + AnyCowArray::F64(encoded) => { + Ok(AnyArray::F64(unscale(encoded, self.offset, self.scale))) } encoded => Err(FixedOffsetScaleCodecError::UnsupportedDtype( - encoded.dtype(), + encoded.dtype(), )), } } fn decode_into( &self, - encoded: AnyArrayView, - decoded: AnyArrayViewMut, + encoded: AnyArrayView, + decoded: AnyArrayViewMut, ) -> Result<(), Self::Error> { match (encoded, decoded) { #[allow(clippy::cast_possible_truncation)] @@ -370,20 +370,20 @@ } (encoded @ (AnyArrayView::F32(_) | AnyArrayView::F64(_)), decoded) => { Err(FixedOffsetScaleCodecError::MismatchedDecodeIntoArray { - source: AnyArrayAssignError::DTypeMismatch { - src: encoded.dtype(), - dst: decoded.dtype(), + source: AnyArrayAssignError::DTypeMismatch { + src: encoded.dtype(), + dst: decoded.dtype(), }, }) } (encoded, _decoded) => Err(FixedOffsetScaleCodecError::UnsupportedDtype( - encoded.dtype(), + encoded.dtype(), )), } } } -impl StaticCodec for FixedOffsetScaleCodec { +impl StaticCodec for FixedOffsetScaleCodec { const CODEC_ID: &'static str = "fixed-offset-scale"; type Config<'de> = Self; @@ -392,7 +392,7 @@ config } - fn get_config(&self) -> StaticCodecConfig<Self> { + fn get_config(&self) -> StaticCodecConfig<Self> { StaticCodecConfig::from(self) } } @@ -402,13 +402,13 @@ pub enum FixedOffsetScaleCodecError { /// [`FixedOffsetScaleCodec`] does not support the dtype #[error("FixedOffsetScale does not support the dtype {0}")] - UnsupportedDtype(AnyArrayDType), + UnsupportedDtype(AnyArrayDType), /// [`FixedOffsetScaleCodec`] cannot decode into the provided array #[error("FixedOffsetScale cannot decode into the provided array")] MismatchedDecodeIntoArray { /// The source of the error #[from] - source: AnyArrayAssignError, + source: AnyArrayAssignError, }, } @@ -455,7 +455,7 @@ ) -> Result<(), FixedOffsetScaleCodecError> { if data.shape() != out.shape() { return Err(FixedOffsetScaleCodecError::MismatchedDecodeIntoArray { - source: AnyArrayAssignError::ShapeMismatch { + source: AnyArrayAssignError::ShapeMismatch { src: data.shape().to_vec(), dst: out.shape().to_vec(), }, diff --git a/src/numcodecs_zfp/ffi.rs.html b/src/numcodecs_zfp/ffi.rs.html index 86013334..74b4736b 100644 --- a/src/numcodecs_zfp/ffi.rs.html +++ b/src/numcodecs_zfp/ffi.rs.html @@ -434,7 +434,7 @@ use std::{marker::PhantomData, mem::ManuallyDrop}; use ndarray::{ArrayView, Dimension}; -use numcodecs::{AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayViewMut}; +use numcodecs::{AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayViewMut}; use crate::{ZfpCodecError, ZfpCompressionMode}; @@ -710,12 +710,12 @@ } impl ZfpDecompressionStreamWithHeader<'_> { - pub fn decompress(self) -> Result<AnyArray, ZfpCodecError> { + pub fn decompress(self) -> Result<AnyArray, ZfpCodecError> { let dtype = match unsafe { (*self.field).type_ } { - zfp_sys::zfp_type_zfp_type_int32 => AnyArrayDType::I32, - zfp_sys::zfp_type_zfp_type_int64 => AnyArrayDType::I64, - zfp_sys::zfp_type_zfp_type_float => AnyArrayDType::F32, - zfp_sys::zfp_type_zfp_type_double => AnyArrayDType::F64, + zfp_sys::zfp_type_zfp_type_int32 => AnyArrayDType::I32, + zfp_sys::zfp_type_zfp_type_int64 => AnyArrayDType::I64, + zfp_sys::zfp_type_zfp_type_float => AnyArrayDType::F32, + zfp_sys::zfp_type_zfp_type_double => AnyArrayDType::F64, dtype => return Err(ZfpCodecError::DecodeUnknownDtype(dtype)), }; @@ -729,7 +729,7 @@ .filter(|s| *s > 0) .collect::<Vec<usize>>(); - let (decompressed, result) = AnyArray::with_zeros_bytes(dtype, &shape, |bytes| { + let (decompressed, result) = AnyArray::with_zeros_bytes(dtype, &shape, |bytes| { unsafe { zfp_sys::zfp_field_set_pointer(self.field, bytes.as_mut_ptr().cast()); } @@ -744,20 +744,20 @@ result.map(|()| decompressed) } - pub fn decompress_into(self, mut decompressed: AnyArrayViewMut) -> Result<(), ZfpCodecError> { + pub fn decompress_into(self, mut decompressed: AnyArrayViewMut) -> Result<(), ZfpCodecError> { let dtype = match unsafe { (*self.field).type_ } { - zfp_sys::zfp_type_zfp_type_int32 => AnyArrayDType::I32, - zfp_sys::zfp_type_zfp_type_int64 => AnyArrayDType::I64, - zfp_sys::zfp_type_zfp_type_float => AnyArrayDType::F32, - zfp_sys::zfp_type_zfp_type_double => AnyArrayDType::F64, + zfp_sys::zfp_type_zfp_type_int32 => AnyArrayDType::I32, + zfp_sys::zfp_type_zfp_type_int64 => AnyArrayDType::I64, + zfp_sys::zfp_type_zfp_type_float => AnyArrayDType::F32, + zfp_sys::zfp_type_zfp_type_double => AnyArrayDType::F64, dtype => return Err(ZfpCodecError::DecodeUnknownDtype(dtype)), }; if decompressed.dtype() != dtype { return Err(ZfpCodecError::MismatchedDecodeIntoArray { - source: AnyArrayAssignError::DTypeMismatch { + source: AnyArrayAssignError::DTypeMismatch { src: dtype, - dst: decompressed.dtype(), + dst: decompressed.dtype(), }, }); } @@ -774,14 +774,14 @@ if decompressed.shape() != shape { return Err(ZfpCodecError::MismatchedDecodeIntoArray { - source: AnyArrayAssignError::ShapeMismatch { + source: AnyArrayAssignError::ShapeMismatch { src: shape, - dst: decompressed.shape().to_vec(), + dst: decompressed.shape().to_vec(), }, }); } - decompressed.with_bytes_mut(|bytes| { + decompressed.with_bytes_mut(|bytes| { unsafe { zfp_sys::zfp_field_set_pointer(self.field, bytes.as_mut_ptr().cast()); } diff --git a/src/numcodecs_zfp/lib.rs.html b/src/numcodecs_zfp/lib.rs.html index ac3c9774..a56fc1ec 100644 --- a/src/numcodecs_zfp/lib.rs.html +++ b/src/numcodecs_zfp/lib.rs.html @@ -359,8 +359,8 @@ use ndarray::{Array1, ArrayView, Dimension}; use numcodecs::{ - AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayView, AnyArrayViewMut, AnyCowArray, - Codec, StaticCodec, StaticCodecConfig, + AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayView, AnyArrayViewMut, AnyCowArray, + Codec, StaticCodec, StaticCodecConfig, }; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; @@ -428,10 +428,10 @@ Reversible, } -impl Codec for ZfpCodec { +impl Codec for ZfpCodec { type Error = ZfpCodecError; - fn encode(&self, data: AnyCowArray) -> Result<AnyArray, Self::Error> { + fn encode(&self, data: AnyCowArray) -> Result<AnyArray, Self::Error> { if matches!(data.dtype(), AnyArrayDType::I32 | AnyArrayDType::I64) && matches!( self.mode, @@ -442,26 +442,26 @@ } match data { - AnyCowArray::I32(data) => Ok(AnyArray::U8( + AnyCowArray::I32(data) => Ok(AnyArray::U8( Array1::from(compress(data.view(), &self.mode)?).into_dyn(), )), - AnyCowArray::I64(data) => Ok(AnyArray::U8( + AnyCowArray::I64(data) => Ok(AnyArray::U8( Array1::from(compress(data.view(), &self.mode)?).into_dyn(), )), - AnyCowArray::F32(data) => Ok(AnyArray::U8( + AnyCowArray::F32(data) => Ok(AnyArray::U8( Array1::from(compress(data.view(), &self.mode)?).into_dyn(), )), - AnyCowArray::F64(data) => Ok(AnyArray::U8( + AnyCowArray::F64(data) => Ok(AnyArray::U8( Array1::from(compress(data.view(), &self.mode)?).into_dyn(), )), - encoded => Err(ZfpCodecError::UnsupportedDtype(encoded.dtype())), + encoded => Err(ZfpCodecError::UnsupportedDtype(encoded.dtype())), } } - fn decode(&self, encoded: AnyCowArray) -> Result<AnyArray, Self::Error> { - let AnyCowArray::U8(encoded) = encoded else { + fn decode(&self, encoded: AnyCowArray) -> Result<AnyArray, Self::Error> { + let AnyCowArray::U8(encoded) = encoded else { return Err(ZfpCodecError::EncodedDataNotBytes { - dtype: encoded.dtype(), + dtype: encoded.dtype(), }); }; @@ -471,17 +471,17 @@ }); } - decompress(&AnyCowArray::U8(encoded).as_bytes()) + decompress(&AnyCowArray::U8(encoded).as_bytes()) } fn decode_into( &self, - encoded: AnyArrayView, - decoded: AnyArrayViewMut, + encoded: AnyArrayView, + decoded: AnyArrayViewMut, ) -> Result<(), Self::Error> { - let AnyArrayView::U8(encoded) = encoded else { + let AnyArrayView::U8(encoded) = encoded else { return Err(ZfpCodecError::EncodedDataNotBytes { - dtype: encoded.dtype(), + dtype: encoded.dtype(), }); }; @@ -491,11 +491,11 @@ }); } - decompress_into(&AnyArrayView::U8(encoded).as_bytes(), decoded) + decompress_into(&AnyArrayView::U8(encoded).as_bytes(), decoded) } } -impl StaticCodec for ZfpCodec { +impl StaticCodec for ZfpCodec { const CODEC_ID: &'static str = "zfp"; type Config<'de> = Self; @@ -504,7 +504,7 @@ config } - fn get_config(&self) -> StaticCodecConfig<Self> { + fn get_config(&self) -> StaticCodecConfig<Self> { StaticCodecConfig::from(self) } } @@ -514,7 +514,7 @@ pub enum ZfpCodecError { /// [`ZfpCodec`] does not support the dtype #[error("Zfp does not support the dtype {0}")] - UnsupportedDtype(AnyArrayDType), + UnsupportedDtype(AnyArrayDType), /// [`ZfpCodec`] does not support the fixed accuracy mode for integer data #[error("Zfp does not support the fixed accuracy mode for integer data")] FixedAccuracyModeIntegerData, @@ -543,7 +543,7 @@ )] EncodedDataNotBytes { /// The unexpected dtype of the encoded array - dtype: AnyArrayDType, + dtype: AnyArrayDType, }, /// [`ZfpCodec`] can only decode one-dimensional byte arrays but received /// an array of a different shape @@ -560,7 +560,7 @@ MismatchedDecodeIntoArray { /// The source of the error #[from] - source: AnyArrayAssignError, + source: AnyArrayAssignError, }, /// [`ZfpCodec`] failed to decode the data with the unknown dtype #[error("Zfp failed to decode the data with an unknown dtype #{0}")] @@ -609,7 +609,7 @@ /// - [`ZfpCodecError::DecodeUnknownDtype`] if the encoded data uses an unknown /// dtype /// - [`ZfpCodecError::ZfpDecodeFailed`] if an opaque decoding error occurred -pub fn decompress(encoded: &[u8]) -> Result<AnyArray, ZfpCodecError> { +pub fn decompress(encoded: &[u8]) -> Result<AnyArray, ZfpCodecError> { // Setup zfp structs to begin decompression let stream = ffi::ZfpDecompressionStream::new(encoded); @@ -631,7 +631,7 @@ /// - [`ZfpCodecError::MismatchedDecodeIntoArray`] if the `decoded` array is of /// the wrong dtype or shape /// - [`ZfpCodecError::ZfpDecodeFailed`] if an opaque decoding error occurred -pub fn decompress_into(encoded: &[u8], decoded: AnyArrayViewMut) -> Result<(), ZfpCodecError> { +pub fn decompress_into(encoded: &[u8], decoded: AnyArrayViewMut) -> Result<(), ZfpCodecError> { // Setup zfp structs to begin decompression let stream = ffi::ZfpDecompressionStream::new(encoded); diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js index a9bd5f3e..33762428 100644 --- a/trait.impl/core/convert/trait.From.js +++ b/trait.impl/core/convert/trait.From.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["numcodecs",[["impl<'a, T: StaticCodec> From<&<T as StaticCodec>::Config<'a>> for StaticCodecConfig<'a, T>

where\n T::Config<'a>: Clone,
"]]],["numcodecs_asinh",[["impl From<AnyArrayAssignError> for AsinhCodecError"]]],["numcodecs_bit_round",[["impl From<AnyArrayAssignError> for BitRoundCodecError"]]],["numcodecs_fixed_offset_scale",[["impl From<AnyArrayAssignError> for FixedOffsetScaleCodecError"]]],["numcodecs_fourier_network",[["impl From<AnyArrayAssignError> for FourierNetworkCodecError"],["impl From<NeuralNetworkError> for FourierNetworkCodecError"]]],["numcodecs_identity",[["impl From<AnyArrayAssignError> for IdentityCodecError"]]],["numcodecs_linear_quantize",[["impl From<ShapeError> for LinearQuantizeCodecError"]]],["numcodecs_log",[["impl From<AnyArrayAssignError> for LogCodecError"]]],["numcodecs_pco",[["impl From<AnyArrayAssignError> for PcodecError"],["impl From<ShapeError> for PcodecError"]]],["numcodecs_random_projection",[["impl From<AnyArrayAssignError> for RandomProjectionCodecError"],["impl From<ShapeError> for RandomProjectionCodecError"]]],["numcodecs_reinterpret",[["impl From<AnyArrayAssignError> for ReinterpretCodecError"]]],["numcodecs_round",[["impl From<AnyArrayAssignError> for RoundCodecError"]]],["numcodecs_swizzle_reshape",[["impl From<AnyArrayAssignError> for SwizzleReshapeCodecError"]]],["numcodecs_sz3",[["impl From<AnyArrayAssignError> for Sz3CodecError"],["impl From<ShapeError> for Sz3CodecError"]]],["numcodecs_uniform_noise",[["impl From<AnyArrayAssignError> for UniformNoiseCodecError"]]],["numcodecs_wasm_host",[["impl From<Error> for RuntimeError"]]],["numcodecs_zfp",[["impl From<AnyArrayAssignError> for ZfpCodecError"]]],["numcodecs_zlib",[["impl From<AnyArrayAssignError> for ZlibCodecError"]]],["numcodecs_zstd",[["impl From<AnyArrayAssignError> for ZstdCodecError"]]]]); + var implementors = Object.fromEntries([["numcodecs",[["impl<'a, T: StaticCodec> From<&<T as StaticCodec>::Config<'a>> for StaticCodecConfig<'a, T>
where\n T::Config<'a>: Clone,
"]]],["numcodecs_asinh",[["impl From<AnyArrayAssignError> for AsinhCodecError"]]],["numcodecs_bit_round",[["impl From<AnyArrayAssignError> for BitRoundCodecError"]]],["numcodecs_fixed_offset_scale",[["impl From<AnyArrayAssignError> for FixedOffsetScaleCodecError"]]],["numcodecs_fourier_network",[["impl From<AnyArrayAssignError> for FourierNetworkCodecError"],["impl From<NeuralNetworkError> for FourierNetworkCodecError"]]],["numcodecs_identity",[["impl From<AnyArrayAssignError> for IdentityCodecError"]]],["numcodecs_linear_quantize",[["impl From<ShapeError> for LinearQuantizeCodecError"]]],["numcodecs_log",[["impl From<AnyArrayAssignError> for LogCodecError"]]],["numcodecs_pco",[["impl From<AnyArrayAssignError> for PcodecError"],["impl From<ShapeError> for PcodecError"]]],["numcodecs_random_projection",[["impl From<AnyArrayAssignError> for RandomProjectionCodecError"],["impl From<ShapeError> for RandomProjectionCodecError"]]],["numcodecs_reinterpret",[["impl From<AnyArrayAssignError> for ReinterpretCodecError"]]],["numcodecs_round",[["impl From<AnyArrayAssignError> for RoundCodecError"]]],["numcodecs_swizzle_reshape",[["impl From<AnyArrayAssignError> for SwizzleReshapeCodecError"]]],["numcodecs_sz3",[["impl From<AnyArrayAssignError> for Sz3CodecError"],["impl From<ShapeError> for Sz3CodecError"]]],["numcodecs_uniform_noise",[["impl From<AnyArrayAssignError> for UniformNoiseCodecError"]]],["numcodecs_wasm_host",[["impl From<Error> for RuntimeError"]]],["numcodecs_zfp",[["impl From<AnyArrayAssignError> for ZfpCodecError"]]],["numcodecs_zlib",[["impl From<AnyArrayAssignError> for ZlibCodecError"]]],["numcodecs_zstd",[["impl From<AnyArrayAssignError> for ZstdCodecError"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[1081,503,524,537,1072,521,526,491,916,1076,539,503,560,890,548,449,453,497,497]} \ No newline at end of file +//{"start":57,"fragment_lengths":[1081,503,524,575,1072,521,526,491,916,1076,539,503,560,890,548,449,491,497,497]} \ No newline at end of file diff --git a/trait.impl/numcodecs/codec/trait.Codec.js b/trait.impl/numcodecs/codec/trait.Codec.js index f70e0f95..223ceec1 100644 --- a/trait.impl/numcodecs/codec/trait.Codec.js +++ b/trait.impl/numcodecs/codec/trait.Codec.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["numcodecs_asinh",[["impl Codec for AsinhCodec"]]],["numcodecs_bit_round",[["impl Codec for BitRoundCodec"]]],["numcodecs_fixed_offset_scale",[["impl Codec for FixedOffsetScaleCodec"]]],["numcodecs_fourier_network",[["impl Codec for FourierNetworkCodec"]]],["numcodecs_identity",[["impl Codec for IdentityCodec"]]],["numcodecs_linear_quantize",[["impl Codec for LinearQuantizeCodec"]]],["numcodecs_log",[["impl Codec for LogCodec"]]],["numcodecs_pco",[["impl Codec for Pcodec"]]],["numcodecs_python",[["impl Codec for PyCodecAdapter"]]],["numcodecs_random_projection",[["impl Codec for RandomProjectionCodec"]]],["numcodecs_reinterpret",[["impl Codec for ReinterpretCodec"]]],["numcodecs_round",[["impl Codec for RoundCodec"]]],["numcodecs_swizzle_reshape",[["impl Codec for SwizzleReshapeCodec"]]],["numcodecs_sz3",[["impl Codec for Sz3Codec"]]],["numcodecs_uniform_noise",[["impl Codec for UniformNoiseCodec"]]],["numcodecs_wasm_host_reproducible",[["impl<E: WasmEngine> Codec for ReproducibleWasmCodec<E>
where\n Store<(), ValidatedEngine<E>>: Send,
"]]],["numcodecs_wasm_logging",[["impl<T: StaticCodec> Codec for LoggingCodec<T>"]]],["numcodecs_zfp",[["impl Codec for ZfpCodec"]]],["numcodecs_zlib",[["impl Codec for ZlibCodec"]]],["numcodecs_zstd",[["impl Codec for ZstdCodec"]]]]); + var implementors = Object.fromEntries([["numcodecs_asinh",[["impl Codec for AsinhCodec"]]],["numcodecs_bit_round",[["impl Codec for BitRoundCodec"]]],["numcodecs_fixed_offset_scale",[["impl Codec for FixedOffsetScaleCodec"]]],["numcodecs_fourier_network",[["impl Codec for FourierNetworkCodec"]]],["numcodecs_identity",[["impl Codec for IdentityCodec"]]],["numcodecs_linear_quantize",[["impl Codec for LinearQuantizeCodec"]]],["numcodecs_log",[["impl Codec for LogCodec"]]],["numcodecs_pco",[["impl Codec for Pcodec"]]],["numcodecs_python",[["impl Codec for PyCodecAdapter"]]],["numcodecs_random_projection",[["impl Codec for RandomProjectionCodec"]]],["numcodecs_reinterpret",[["impl Codec for ReinterpretCodec"]]],["numcodecs_round",[["impl Codec for RoundCodec"]]],["numcodecs_swizzle_reshape",[["impl Codec for SwizzleReshapeCodec"]]],["numcodecs_sz3",[["impl Codec for Sz3Codec"]]],["numcodecs_uniform_noise",[["impl Codec for UniformNoiseCodec"]]],["numcodecs_wasm_host_reproducible",[["impl<E: WasmEngine> Codec for ReproducibleWasmCodec<E>
where\n Store<(), ValidatedEngine<E>>: Send,
"]]],["numcodecs_wasm_logging",[["impl<T: StaticCodec> Codec for LoggingCodec<T>"]]],["numcodecs_zfp",[["impl Codec for ZfpCodec"]]],["numcodecs_zlib",[["impl Codec for ZlibCodec"]]],["numcodecs_zstd",[["impl Codec for ZstdCodec"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[311,333,346,369,330,369,300,294,327,381,348,312,369,262,357,735,525,262,306,306]} \ No newline at end of file +//{"start":57,"fragment_lengths":[311,333,384,369,330,369,300,294,327,381,348,312,369,262,357,735,525,300,306,306]} \ No newline at end of file diff --git a/trait.impl/numcodecs/codec/trait.StaticCodec.js b/trait.impl/numcodecs/codec/trait.StaticCodec.js index 6771042c..41bc5684 100644 --- a/trait.impl/numcodecs/codec/trait.StaticCodec.js +++ b/trait.impl/numcodecs/codec/trait.StaticCodec.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["numcodecs_asinh",[["impl StaticCodec for AsinhCodec"]]],["numcodecs_bit_round",[["impl StaticCodec for BitRoundCodec"]]],["numcodecs_fixed_offset_scale",[["impl StaticCodec for FixedOffsetScaleCodec"]]],["numcodecs_fourier_network",[["impl StaticCodec for FourierNetworkCodec"]]],["numcodecs_identity",[["impl StaticCodec for IdentityCodec"]]],["numcodecs_linear_quantize",[["impl StaticCodec for LinearQuantizeCodec"]]],["numcodecs_log",[["impl StaticCodec for LogCodec"]]],["numcodecs_pco",[["impl StaticCodec for Pcodec"]]],["numcodecs_random_projection",[["impl StaticCodec for RandomProjectionCodec"]]],["numcodecs_reinterpret",[["impl StaticCodec for ReinterpretCodec"]]],["numcodecs_round",[["impl StaticCodec for RoundCodec"]]],["numcodecs_swizzle_reshape",[["impl StaticCodec for SwizzleReshapeCodec"]]],["numcodecs_sz3",[["impl StaticCodec for Sz3Codec"]]],["numcodecs_uniform_noise",[["impl StaticCodec for UniformNoiseCodec"]]],["numcodecs_wasm_logging",[["impl<T: StaticCodec> StaticCodec for LoggingCodec<T>"]]],["numcodecs_zfp",[["impl StaticCodec for ZfpCodec"]]],["numcodecs_zlib",[["impl StaticCodec for ZlibCodec"]]],["numcodecs_zstd",[["impl StaticCodec for ZstdCodec"]]]]); + var implementors = Object.fromEntries([["numcodecs_asinh",[["impl StaticCodec for AsinhCodec"]]],["numcodecs_bit_round",[["impl StaticCodec for BitRoundCodec"]]],["numcodecs_fixed_offset_scale",[["impl StaticCodec for FixedOffsetScaleCodec"]]],["numcodecs_fourier_network",[["impl StaticCodec for FourierNetworkCodec"]]],["numcodecs_identity",[["impl StaticCodec for IdentityCodec"]]],["numcodecs_linear_quantize",[["impl StaticCodec for LinearQuantizeCodec"]]],["numcodecs_log",[["impl StaticCodec for LogCodec"]]],["numcodecs_pco",[["impl StaticCodec for Pcodec"]]],["numcodecs_random_projection",[["impl StaticCodec for RandomProjectionCodec"]]],["numcodecs_reinterpret",[["impl StaticCodec for ReinterpretCodec"]]],["numcodecs_round",[["impl StaticCodec for RoundCodec"]]],["numcodecs_swizzle_reshape",[["impl StaticCodec for SwizzleReshapeCodec"]]],["numcodecs_sz3",[["impl StaticCodec for Sz3Codec"]]],["numcodecs_uniform_noise",[["impl StaticCodec for UniformNoiseCodec"]]],["numcodecs_wasm_logging",[["impl<T: StaticCodec> StaticCodec for LoggingCodec<T>"]]],["numcodecs_zfp",[["impl StaticCodec for ZfpCodec"]]],["numcodecs_zlib",[["impl StaticCodec for ZlibCodec"]]],["numcodecs_zstd",[["impl StaticCodec for ZstdCodec"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[329,351,364,387,348,387,318,312,399,366,330,387,280,375,543,280,324,324]} \ No newline at end of file +//{"start":57,"fragment_lengths":[329,351,402,387,348,387,318,312,399,366,330,387,280,375,543,318,324,324]} \ No newline at end of file