From 1b24a7a2ba83ffb1433c40b83e241bf317e53344 Mon Sep 17 00:00:00 2001 From: Gaute Hope Date: Thu, 8 Aug 2024 10:34:18 +0200 Subject: [PATCH] downgrade to ndarray 0.15 (because of netcdf) --- Cargo.lock | 32 ++++---------------------------- Cargo.toml | 2 +- src/python/mod.rs | 5 +++-- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3922281..07ca2ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,7 +551,7 @@ dependencies = [ "hdf5-types", "lazy_static", "libc", - "ndarray 0.15.6", + "ndarray", "parking_lot 0.12.3", "paste", ] @@ -638,7 +638,7 @@ dependencies = [ "libdeflater", "log", "lru", - "ndarray 0.16.0", + "ndarray", "netcdf", "numpy", "pyo3", @@ -994,21 +994,6 @@ dependencies = [ "num-integer", "num-traits", "rawpointer", -] - -[[package]] -name = "ndarray" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "087ee1ca8a7c22830c2bba4a96ed8e72ce0968ae944349324d52522f66aa3944" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "portable-atomic", - "portable-atomic-util", - "rawpointer", "rayon", ] @@ -1020,7 +1005,7 @@ checksum = "a8aa8799e918d05f6d5d05e08d980f5a4e5d4f4fb503904f2c35c49aed9ac75a" dependencies = [ "bitflags 2.6.0", "libc", - "ndarray 0.15.6", + "ndarray", "netcdf-sys", ] @@ -1103,7 +1088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec170733ca37175f5d75a5bea5911d6ff45d2cd52849ce98b685394e4f2f37f4" dependencies = [ "libc", - "ndarray 0.15.6", + "ndarray", "num-complex", "num-integer", "num-traits", @@ -1284,15 +1269,6 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" -[[package]] -name = "portable-atomic-util" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdd8420072e66d54a407b3316991fe946ce3ab1083a7f575b2463866624704d" -dependencies = [ - "portable-atomic", -] - [[package]] name = "ppv-lite86" version = "0.2.20" diff --git a/Cargo.toml b/Cargo.toml index 99e8dbb..b0e41b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ hdf5-sys = "0.8" hdf5-src = { version = "0.8", features = [ "threadsafe" ] } log = "0.4" rayon = "1.10" -ndarray = { version = "0.16", features = [ "rayon" ] } +ndarray = { version = "0.15", features = [ "rayon" ] } pyo3 = { version = "0.21", optional = true, features = ["anyhow", "auto-initialize", "abi3-py38"] } numpy = { version = "0.21.0", optional = true } netcdf = { version = "^0.9", optional = true } diff --git a/src/python/mod.rs b/src/python/mod.rs index 859de9b..279043f 100644 --- a/src/python/mod.rs +++ b/src/python/mod.rs @@ -2,6 +2,7 @@ use crate::filters::byteorder::ToNative; use byte_slice_cast::ToMutByteSlice; +use ndarray::parallel::prelude::*; use numpy::{PyArray, PyArray1, PyArrayDyn}; use pyo3::{ prelude::*, @@ -194,8 +195,8 @@ impl Dataset { let (mut indices, (mut counts, mut strides)): (Vec<_>, (Vec<_>, Vec<_>)) = slice .iter() .map(|el| match el { - el if el.is_instance_of::().unwrap() => el.downcast::().unwrap(), - el if el.is_instance_of::().unwrap() => { + el if el.is_instance_of::() => el.downcast::().unwrap(), + el if el.is_instance_of::() => { let ind: isize = el.downcast::().unwrap().extract().unwrap(); PySlice::new(py, ind, ind + 1, 1) }