diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0582f07..129c784 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,7 +54,7 @@ jobs: run: | python -m pip install -e . - name: Upload asdfspline.h header file - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v7 with: name: header-file-${{ matrix.os }} path: | @@ -68,7 +68,7 @@ jobs: run: | python -m nbconvert --execute --to html *.ipynb - name: Upload converted notebooks - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v7 with: name: notebooks-${{ matrix.os }} path: | @@ -99,7 +99,7 @@ jobs: msrv: strategy: matrix: - rust-version: ["1.61.0"] + rust-version: ["1.71.0"] runs-on: ubuntu-latest steps: - name: Clone Git repository diff --git a/Cargo.toml b/Cargo.toml index bd5d016..abd899e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ version = "0.0.0" authors = ["Matthias Geier "] license = "MIT OR Apache-2.0" edition = "2021" +rust-version = "1.71" publish = false @@ -12,5 +13,6 @@ members = ["ffi"] [dependencies] superslice = "1" -thiserror = "1.0" -nalgebra = "0.32" +thiserror = "2" +# 0.34 switches to edition 2024 and MSRV 1.84 +nalgebra = "0.33" diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml index 56d8a55..f0e59cb 100644 --- a/ffi/Cargo.toml +++ b/ffi/Cargo.toml @@ -10,6 +10,7 @@ crate-type = ["staticlib"] [dependencies] asdfspline = { path = ".." } -libc = "*" +libc = "0.2" # This doesn't have to be the same version as used in the main crate: -nalgebra = "0.32" +# 0.34 switches to edition 2024 and MSRV 1.84 +nalgebra = "0.33" diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index 3c9ee19..547baae 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -357,7 +357,7 @@ pub unsafe extern "C" fn asdf_monotonecubic_get_time( let values = unsafe { ffi_slice(values, count) }; let output = unsafe { ffi_slice_mut(output.cast::>(), count) }; for (val, out) in values.iter().zip(output) { - *out = MaybeUninit::new(curve.get_time(*val).unwrap_or(std::f32::NAN)); + *out = MaybeUninit::new(curve.get_time(*val).unwrap_or(f32::NAN)); } } diff --git a/python/tests/test_PiecewiseMonotoneCubicSpline.py b/python/tests/test_PiecewiseMonotoneCubicSpline.py index 22eff58..225e8e9 100644 --- a/python/tests/test_PiecewiseMonotoneCubicSpline.py +++ b/python/tests/test_PiecewiseMonotoneCubicSpline.py @@ -17,7 +17,7 @@ def test_values_errors(): def test_grid_errors(): with pytest.raises(ValueError, match='NaN.*not allowed in grid'): - PiecewiseMonotoneCubicSpline([0, 1], grid=[0, np.NaN]) + PiecewiseMonotoneCubicSpline([0, 1], grid=[0, np.nan]) with pytest.raises(ValueError, match='grid.*must be strictly ascending'): PiecewiseMonotoneCubicSpline([0, 1], grid=[0, 0]) diff --git a/src/adapters.rs b/src/adapters.rs index 40998ce..2f04a6d 100644 --- a/src/adapters.rs +++ b/src/adapters.rs @@ -193,7 +193,7 @@ where let mut u_grid = Vec::new(); let mut u_missing = Vec::new(); for (i, &u) in inner.grid().iter().enumerate() { - if missing_times.iter().any(|&x| x == i) { + if missing_times.contains(&i) { u_missing.push(u); } else { u_grid.push(u); diff --git a/src/piecewisecubiccurve.rs b/src/piecewisecubiccurve.rs index dedd18f..b776f97 100644 --- a/src/piecewisecubiccurve.rs +++ b/src/piecewisecubiccurve.rs @@ -24,7 +24,7 @@ impl PiecewiseCubicCurve { let segments = segments.into(); let grid = grid.into(); use Error::*; - if segments.len() < 1 { + if segments.is_empty() { return Err(ZeroSegments); } if segments.len() + 1 != grid.len() {