Skip to content

Commit

Permalink
Force ndarray 0.15 to have rayon feature enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Aug 12, 2024
1 parent 0681685 commit a9906e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ hdf5-sys = { package = "hdf5-metno-sys", version = "0.9.1" }
log = "0.4"
rayon = "1.10"
ndarray = { version = "0.16", features = [ "rayon" ] }
# Remove when https://github.com/PyO3/rust-numpy/pull/439 is addressed
ndarray_0_15 = { package = "ndarray", version = "0.15", features = ["rayon"] }
pyo3 = { version = "0.21", optional = true, features = ["anyhow", "auto-initialize", "abi3-py39"] }
numpy = { version = "0.21.0", optional = true }
netcdf = { version = "0.10.4", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl Dataset {
let arr = arr.downcast::<PyArrayDyn<T>>().unwrap();

let mut v = unsafe { arr.as_array_mut() };
v.mapv_inplace(|v| if v == cond { fv } else { v });
v.par_mapv_inplace(|v| if v == cond { fv } else { v });
}
}

Expand Down

0 comments on commit a9906e8

Please sign in to comment.