Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: ["1.82", stable, nightly]
rust: ["1.85", stable, nightly]
lock: ["Cargo.lock", "Cargo.lock.min"]
runs-on: ${{ matrix.os }}
needs: lock
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
rust: ["1.82", stable]
rust: ["1.85", stable]
lock: ["Cargo.lock", "Cargo.lock.min"]
runs-on: ${{ matrix.os }}
needs: lock
Expand Down
40 changes: 20 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ members = [
]

[workspace.package]
edition = "2021"
edition = "2024"
authors = ["Juniper Tyree <juniper.tyree@helsinki.fi>"]
repository = "https://github.com/juntyr/numcodecs-rs"
license = "MPL-2.0"
rust-version = "1.82"
rust-version = "1.85"

[workspace.dependencies]
# workspace-internal numcodecs crates
Expand Down Expand Up @@ -76,13 +76,13 @@ numcodecs-zstd = { version = "0.3", path = "codecs/zstd", default-features = fal

# crates.io third-party dependencies
anyhow = { version = "1.0.93", default-features = false }
burn = { version = "0.16", default-features = false }
burn = { version = "0.17", default-features = false }
clap = { version = "4.5", default-features = false }
convert_case = { version = "0.8", default-features = false }
format_serde_error = { version = "0.3", default-features = false }
indexmap = { version = "2.7", default-features = false }
indexmap = { version = "2.7.1", default-features = false }
itertools = { version = "0.14", default-features = false }
log = { version = "0.4.22", default-features = false }
log = { version = "0.4.27", default-features = false }
simple_logger = { version = "5.0", default-features = false }
miniz_oxide = { version = "0.8.4", default-features = false }
ndarray = { version = "0.16.1", default-features = false } # keep in sync with numpy
Expand All @@ -93,43 +93,43 @@ openjpeg-sys = { version = "1.0", default-features = false }
pco = { version = "0.4", default-features = false }
polonius-the-crab = { version = "0.4", default-features = false }
postcard = { version = "1.0.8", default-features = false }
pyodide-webassembly-runtime-layer = { version = "0.6", default-features = false }
pyodide-webassembly-runtime-layer = { version = "0.7", default-features = false }
pyo3 = { version = "0.24", default-features = false }
pyo3-error = { version = "0.4", default-features = false }
pyo3-log = { version = "0.12.2", default-features = false }
pythonize = { version = "0.24", default-features = false }
rand = { version = "0.8.5", default-features = false }
schemars = { version = "=1.0.0-alpha.15", default-features = false }
scratch = { version = "1.0", default-features = false }
semver = { version = "1.0.22", default-features = false }
serde = { version = "1.0.217", default-features = false }
semver = { version = "1.0.23", default-features = false }
serde = { version = "1.0.218", default-features = false }
serde-transcode = { version = "1.1", default-features = false }
serde_json = { version = "1.0.135", default-features = false }
serde_json = { version = "1.0.140", default-features = false }
serde_repr = { version = "0.1.3", default-features = false }
sz3 = { version = "0.3", default-features = false }
thiserror = { version = "2.0", default-features = false }
thiserror = { version = "2.0.12", default-features = false }
tthresh = { version = "0.1", default-features = false }
twofloat = { version = "0.8", default-features = false }
vecmap-rs = { version = "0.2", default-features = false }
wac-graph = { version = "0.6", default-features = false }
wasi-sandboxed-component-provider = { version = "=0.2.3", default-features = false }
wasi-logger = { version = "0.1", default-features = false }
wasi-preview1-component-adapter-provider = { version = "31.0", default-features = false }
wasmparser = { version = "0.227", default-features = false }
wasmtime = { version = "30.0", default-features = false }
wasmtime_runtime_layer = { version = "30.0", default-features = false }
wasm-encoder = { version = "0.227", default-features = false }
wasm_runtime_layer = { version = "0.4.2", default-features = false }
wasi-preview1-component-adapter-provider = { version = "32.0", default-features = false }
wasmparser = { version = "0.229", default-features = false }
wasmtime = { version = "32.0", default-features = false }
wasmtime_runtime_layer = { version = "32.0", default-features = false }
wasm-encoder = { version = "0.229", default-features = false }
wasm_runtime_layer = { version = "0.5", default-features = false }
wit-bindgen = { version = "0.41", default-features = false }
wit-component = { version = "0.227", default-features = false }
wit-parser = { version = "0.227", default-features = false }
wit-component = { version = "0.229", default-features = false }
wit-parser = { version = "0.229", default-features = false }
wyhash = { version = "0.5", default-features = false }
zfp-sys = { version = "0.3.0", default-features = false }
zfp-sys = { version = "0.4.0", default-features = false }
zstd = { version = "0.13", default-features = false }
zstd-sys = { version = "2.0.12", default-features = false }

# git third-party dependencies with non-upstream fixes
wasm_component_layer = { git = "https://github.com/juntyr/wasm_component_layer.git", rev = "b633734", version = "0.1", default-features = false }
wasm_component_layer = { git = "https://github.com/juntyr/wasm_component_layer.git", rev = "11575ca", version = "0.1", default-features = false }

[workspace.lints.rust]
unsafe_code = "deny"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs
Expand Down
2 changes: 1 addition & 1 deletion codecs/asinh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs-asinh
Expand Down
2 changes: 1 addition & 1 deletion codecs/asinh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
//! [workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain
//!
//! [MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
//! [MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
//! [repo]: https://github.com/juntyr/numcodecs-rs
//!
//! [Latest Version]: https://img.shields.io/crates/v/numcodecs-asinh
Expand Down
2 changes: 1 addition & 1 deletion codecs/bit-round/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs-bit-round
Expand Down
2 changes: 1 addition & 1 deletion codecs/bit-round/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
//! [workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain
//!
//! [MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
//! [MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
//! [repo]: https://github.com/juntyr/numcodecs-rs
//!
//! [Latest Version]: https://img.shields.io/crates/v/numcodecs-bit-round
Expand Down
2 changes: 1 addition & 1 deletion codecs/fixed-offset-scale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs-fixed-offset-scale
Expand Down
2 changes: 1 addition & 1 deletion codecs/fixed-offset-scale/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
//! [workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain
//!
//! [MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
//! [MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
//! [repo]: https://github.com/juntyr/numcodecs-rs
//!
//! [Latest Version]: https://img.shields.io/crates/v/numcodecs-fixed-offset-scale
Expand Down
7 changes: 0 additions & 7 deletions codecs/fourier-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ schemars = { workspace = true, features = ["derive", "preserve_order"] }
serde = { workspace = true, features = ["std", "derive"] }
thiserror = { workspace = true }

# FIXME: see https://github.com/tracel-ai/burn/issues/2876
bincode = "=2.0.0-rc.3"
bincode_derive = "=2.0.0-rc.3"

# FIXME: 1.9.0 has MSRV 1.84, which our MSRV 1.82 doesn't support
bytemuck_derive = "=1.8.1"

[dev-dependencies]
serde_json = { workspace = true, features = ["std"] }
simple_logger = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion codecs/fourier-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs-fourier-network
Expand Down
22 changes: 10 additions & 12 deletions codecs/fourier-network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
//! [workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain
//!
//! [MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
//! [MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
//! [repo]: https://github.com/juntyr/numcodecs-rs
//!
//! [Latest Version]: https://img.shields.io/crates/v/numcodecs-fourier-network
Expand All @@ -22,7 +22,7 @@
use std::{borrow::Cow, num::NonZeroUsize, ops::AddAssign};

use burn::{
backend::{ndarray::NdArrayDevice, Autodiff, NdArray},
backend::{Autodiff, NdArray, ndarray::NdArrayDevice},
module::{Module, Param},
nn::loss::{MseLoss, Reduction},
optim::{AdamConfig, GradientsParams, Optimizer},
Expand All @@ -32,7 +32,7 @@ use burn::{
Record, Recorder, RecorderError,
},
tensor::{
backend::AutodiffBackend, Distribution, Element as BurnElement, Float, Tensor, TensorData,
Distribution, Element as BurnElement, Float, Tensor, TensorData, backend::AutodiffBackend,
},
};
use itertools::Itertools;
Expand All @@ -42,19 +42,13 @@ use numcodecs::{
AnyArray, AnyArrayAssignError, AnyArrayDType, AnyArrayView, AnyArrayViewMut, AnyCowArray,
Codec, StaticCodec, StaticCodecConfig, StaticCodecVersion,
};
use schemars::{json_schema, JsonSchema, Schema, SchemaGenerator};
use schemars::{JsonSchema, Schema, SchemaGenerator, json_schema};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use thiserror::Error;

#[cfg(test)]
use ::serde_json as _;

// FIXME: see https://github.com/tracel-ai/burn/issues/2876
use ::{bincode as _, bincode_derive as _};

// FIXME: 1.9.0 has MSRV 1.84, which our MSRV 1.82 doesn't support
use ::bytemuck_derive as _;

mod modules;

use modules::{Model, ModelConfig, ModelExtra, ModelRecord};
Expand Down Expand Up @@ -268,7 +262,9 @@ pub enum FourierNetworkCodecError {
},
/// [`FourierNetworkCodec`] can only decode one-dimensional byte arrays but
/// received an array of a different shape
#[error("FourierNetwork can only decode one-dimensional byte arrays but received a byte array of shape {shape:?}")]
#[error(
"FourierNetwork can only decode one-dimensional byte arrays but received a byte array of shape {shape:?}"
)]
EncodedDataNotOneDimensional {
/// The unexpected shape of the encoded array
shape: Vec<usize>,
Expand Down Expand Up @@ -586,7 +582,9 @@ fn train<T: FloatExt, B: AutodiffBackend<FloatElem = T>>(
let mae = stdv * ae_sum / <T as FloatExt>::from_usize(num_samples);
let l_inf = stdv * l_inf;

log::info!("[{epoch}/{num_epochs}]: loss={loss_mean:0.3} MAE={mae:0.3} RMSE={rmse:0.3} Linf={l_inf:0.3}");
log::info!(
"[{epoch}/{num_epochs}]: loss={loss_mean:0.3} MAE={mae:0.3} RMSE={rmse:0.3} Linf={l_inf:0.3}"
);
}

if best_epoch != num_epochs {
Expand Down
7 changes: 2 additions & 5 deletions codecs/fourier-network/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ use serde::Deserialize;
use serde_json::json;

use ::{
burn as _, bytemuck_derive as _, itertools as _, log as _, ndarray as _, num_traits as _,
schemars as _, simple_logger as _, thiserror as _,
burn as _, itertools as _, log as _, ndarray as _, num_traits as _, schemars as _,
simple_logger as _, thiserror as _,
};

// FIXME: see https://github.com/tracel-ai/burn/issues/2876
use ::{bincode as _, bincode_derive as _};

#[test]
#[should_panic(expected = "missing field `fourier_features`")]
fn empty_config() {
Expand Down
7 changes: 2 additions & 5 deletions codecs/fourier-network/tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ use numcodecs::{DynCodecType, StaticCodecType};
use numcodecs_fourier_network::FourierNetworkCodec;

use ::{
burn as _, bytemuck_derive as _, itertools as _, log as _, ndarray as _, num_traits as _,
schemars as _, serde as _, serde_json as _, simple_logger as _, thiserror as _,
burn as _, itertools as _, log as _, ndarray as _, num_traits as _, schemars as _, serde as _,
serde_json as _, simple_logger as _, thiserror as _,
};

// FIXME: see https://github.com/tracel-ai/burn/issues/2876
use ::{bincode as _, bincode_derive as _};

#[test]
fn schema() {
let schema = format!(
Expand Down
2 changes: 1 addition & 1 deletion codecs/identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs-identity
Expand Down
2 changes: 1 addition & 1 deletion codecs/identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
//! [workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain
//!
//! [MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
//! [MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
//! [repo]: https://github.com/juntyr/numcodecs-rs
//!
//! [Latest Version]: https://img.shields.io/crates/v/numcodecs-identity
Expand Down
2 changes: 1 addition & 1 deletion codecs/jpeg2000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
[workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
[MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
[repo]: https://github.com/juntyr/numcodecs-rs

[Latest Version]: https://img.shields.io/crates/v/numcodecs-jpeg2000
Expand Down
4 changes: 2 additions & 2 deletions codecs/jpeg2000/src/ffi/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Decoder {
}

#[allow(clippy::needless_pass_by_ref_mut)]
pub fn as_raw(&mut self) -> *mut openjpeg_sys::opj_codec_t {
pub const fn as_raw(&mut self) -> *mut openjpeg_sys::opj_codec_t {
self.codec.as_ptr()
}
}
Expand Down Expand Up @@ -63,7 +63,7 @@ impl Encoder {
}

#[allow(clippy::needless_pass_by_ref_mut)]
pub fn as_raw(&mut self) -> *mut openjpeg_sys::opj_codec_t {
pub const fn as_raw(&mut self) -> *mut openjpeg_sys::opj_codec_t {
self.codec.as_ptr()
}
}
Expand Down
4 changes: 2 additions & 2 deletions codecs/jpeg2000/src/ffi/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use std::ptr::NonNull;

use super::{codec::Decoder, stream::DecodeStream, Jpeg2000Element, Jpeg2000Error};
use super::{Jpeg2000Element, Jpeg2000Error, codec::Decoder, stream::DecodeStream};

pub struct Image {
image: NonNull<openjpeg_sys::opj_image_t>,
Expand Down Expand Up @@ -81,7 +81,7 @@ impl Image {
}

#[allow(clippy::needless_pass_by_ref_mut)]
pub fn as_raw(&mut self) -> *mut openjpeg_sys::opj_image_t {
pub const fn as_raw(&mut self) -> *mut openjpeg_sys::opj_image_t {
self.image.as_ptr()
}

Expand Down
4 changes: 2 additions & 2 deletions codecs/jpeg2000/src/ffi/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<'a> DecodeStream<'a> {
}

#[allow(clippy::needless_pass_by_ref_mut)]
pub fn as_raw(&mut self) -> *mut openjpeg_sys::opj_stream_t {
pub const fn as_raw(&mut self) -> *mut openjpeg_sys::opj_stream_t {
self.stream
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ impl<'a> EncodeStream<'a> {
}

#[allow(clippy::needless_pass_by_ref_mut)]
pub fn as_raw(&mut self) -> *mut openjpeg_sys::opj_stream_t {
pub const fn as_raw(&mut self) -> *mut openjpeg_sys::opj_stream_t {
self.stream
}
}
Expand Down
6 changes: 4 additions & 2 deletions codecs/jpeg2000/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/numcodecs-rs/ci.yml?branch=main
//! [workflow]: https://github.com/juntyr/numcodecs-rs/actions/workflows/ci.yml?query=branch%3Amain
//!
//! [MSRV]: https://img.shields.io/badge/MSRV-1.82.0-blue
//! [MSRV]: https://img.shields.io/badge/MSRV-1.85.0-blue
//! [repo]: https://github.com/juntyr/numcodecs-rs
//!
//! [Latest Version]: https://img.shields.io/crates/v/numcodecs-jpeg2000
Expand Down Expand Up @@ -187,7 +187,9 @@ pub enum Jpeg2000CodecError {
},
/// [`Jpeg2000Codec`] can only decode one-dimensional byte arrays but received
/// an array of a different shape
#[error("Jpeg2000 can only decode one-dimensional byte arrays but received a byte array of shape {shape:?}")]
#[error(
"Jpeg2000 can only decode one-dimensional byte arrays but received a byte array of shape {shape:?}"
)]
EncodedDataNotOneDimensional {
/// The unexpected shape of the encoded array
shape: Vec<usize>,
Expand Down
Loading
Loading