diff --git a/Cargo.lock b/Cargo.lock index 43de9609..ddc54156 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,9 +214,9 @@ dependencies = [ [[package]] name = "numpy" -version = "0.23.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94caae805f998a07d33af06e6a3891e38556051b8045c615470a71590e13e78" +checksum = "edb929bc0da91a4d85ed6c0a84deaa53d411abfb387fc271124f91bf6b89f14e" dependencies = [ "libc", "ndarray", @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.23.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc" +checksum = "f402062616ab18202ae8319da13fa4279883a2b8a9d9f83f20dbade813ce1884" dependencies = [ "cfg-if", "indoc", @@ -297,9 +297,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.23.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3927b5a78757a0d71aa9dff669f903b1eb64b54142a9bd9f757f8fde65fd7" +checksum = "b14b5775b5ff446dd1056212d778012cbe8a0fbffd368029fd9e25b514479c38" dependencies = [ "once_cell", "target-lexicon", @@ -307,9 +307,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.23.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab6bb2102bd8f991e7749f130a70d05dd557613e39ed2deeee8e9ca0c4d548d" +checksum = "9ab5bcf04a2cdcbb50c7d6105de943f543f9ed92af55818fd17b660390fc8636" dependencies = [ "libc", "pyo3-build-config", @@ -317,9 +317,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.23.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91871864b353fd5ffcb3f91f2f703a22a9797c91b9ab497b1acac7b07ae509c7" +checksum = "0fd24d897903a9e6d80b968368a34e1525aeb719d568dba8b3d4bfa5dc67d453" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -329,9 +329,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.23.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43abc3b80bc20f3facd86cd3c60beed58c3e2aa26213f3cda368de39c60a27e4" +checksum = "36c011a03ba1e50152b4b394b479826cad97e7a21eb52df179cd91ac411cbfbe" dependencies = [ "heck", "proc-macro2", @@ -418,9 +418,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.1.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustversion" diff --git a/Cargo.toml b/Cargo.toml index 2ac49160..119165dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/pyproject.toml b/pyproject.toml index 3d726509..09c88d3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/common.rs b/src/common.rs index 8bdb2ff9..0c68e863 100644 --- a/src/common.rs +++ b/src/common.rs @@ -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 type }); diff --git a/src/viewshed.rs b/src/viewshed.rs index bdb16457..fc2b1fe1 100644 --- a/src/viewshed.rs +++ b/src/viewshed.rs @@ -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())) @@ -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()) }