Skip to content

Commit

Permalink
downgrade to ndarray 0.15 (because of netcdf)
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Aug 8, 2024
1 parent 3429f9d commit 8a90997
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
32 changes: 4 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
5 changes: 3 additions & 2 deletions src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use crate::filters::byteorder::ToNative;
use byte_slice_cast::ToMutByteSlice;
use numpy::{PyArray, PyArray1, PyArrayDyn};
use ndarray::parallel::prelude::*;
use pyo3::{
prelude::*,
types::{PyInt, PySlice, PyTuple},
Expand Down Expand Up @@ -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::<PySlice>().unwrap() => el.downcast::<PySlice>().unwrap(),
el if el.is_instance_of::<PyInt>().unwrap() => {
el if el.is_instance_of::<PySlice>() => el.downcast::<PySlice>().unwrap(),
el if el.is_instance_of::<PyInt>() => {
let ind: isize = el.downcast::<PyInt>().unwrap().extract().unwrap();
PySlice::new(py, ind, ind + 1, 1)
}
Expand Down

0 comments on commit 8a90997

Please sign in to comment.