Skip to content

Commit

Permalink
downgrades rust numpy for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
songololo committed Jan 29, 2025
1 parent 0ffb489 commit c8461f4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ crate-type = ["cdylib"]
[dependencies]
atomic_float = "1.1.0"
ndarray = "0.16.1"
numpy = "0.23.0"
numpy = "0.22.1"
petgraph = "0.7.1"
pyo3 = { version = "0.23.4", features = ["multiple-pymethods"] }
pyo3 = { version = "0.22.6", features = ["multiple-pymethods"] }
rand = "0.9.0"
rand_distr = "0.5.0"
rayon = "1.7.0"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cityseer"
version = '4.18.0'
version = '4.18.1'
description = "Computational tools for network-based pedestrian-scale urban analysis"
readme = "README.md"
requires-python = ">=3.10, <3.14"
Expand Down
2 changes: 1 addition & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl MetricResult {
.collect();
let array = Python::with_gil(|py| {
vec_f32
.into_pyarray(py)
.into_pyarray_bound(py)
.to_owned() // This gives us a PyArray, but wrapped in pyo3::Bound
.into() // Convert to the required Py<PyArray> type
});
Expand Down
8 changes: 4 additions & 4 deletions src/viewshed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ impl Viewshed {
// Convert the results back to NumPy arrays
let array_u32 = Array2::from_shape_vec((height, width), results_u32)
.unwrap()
.into_pyarray(py)
.into_pyarray_bound(py)
.to_owned();
let array_f32_a = Array2::from_shape_vec((height, width), results_f32_a)
.unwrap()
.into_pyarray(py)
.into_pyarray_bound(py)
.to_owned();
let array_f32_b = Array2::from_shape_vec((height, width), results_f32_b)
.unwrap()
.into_pyarray(py)
.into_pyarray_bound(py)
.to_owned();

Ok((array_u32.into(), array_f32_a.into(), array_f32_b.into()))
Expand All @@ -206,7 +206,7 @@ impl Viewshed {
let visibility = calculate_viewshed(raster_array, origin_x, origin_y, view_distance);
let numpy_array = Array2::from_shape_vec((height, width), visibility)
.unwrap()
.into_pyarray(py)
.into_pyarray_bound(py)
.to_owned();
Ok(numpy_array.into())
}
Expand Down

0 comments on commit c8461f4

Please sign in to comment.