Skip to content

Commit 6a0851a

Browse files
authored
Merge pull request #23 from dancergraham/deps
deps: update dependencies. Ouff that was harder than I expected !
2 parents 5b76a51 + 2f89095 commit 6a0851a

4 files changed

Lines changed: 40 additions & 29 deletions

File tree

.github/workflows/CI.yml

36 Bytes
Binary file not shown.

Cargo.lock

Lines changed: 22 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "e57"
99
crate-type = ["cdylib"]
1010

1111
[dependencies]
12-
pyo3 = "0.20.2"
13-
e57 = { version = "0.10.3",features =["crc32c"]}
12+
pyo3 = "0.20,<=0.20.2"
13+
e57 = { version = "0.10.4",features =["crc32c"]}
1414
numpy = "0.20.0"
1515
ndarray = "0.15.6"

src/lib.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fs::File;
22
use std::io::BufReader;
33

44
use ::e57::{CartesianCoordinate, E57Reader};
5-
use ndarray::{Ix2};
5+
use ndarray::Ix2;
66
use numpy::PyArray;
77
use pyo3::prelude::*;
88

@@ -82,15 +82,27 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult<E57> {
8282
let n_colors = color_vec.len() / 3;
8383
let n_intensities = intensity_vec.len();
8484
let mut e57 = E57 {
85-
points: Py::from(PyArray::from_vec(py, point_vec).reshape((nrows, 3)).unwrap()),
85+
points: Py::from(
86+
PyArray::from_vec(py, point_vec)
87+
.reshape((nrows, 3))
88+
.unwrap(),
89+
),
8690
color: Py::from(PyArray::new(py, (0, 3), false)),
8791
intensity: Py::from(PyArray::new(py, (0, 1), false)),
8892
};
8993
if n_colors == n_points {
90-
e57.color = Py::from(PyArray::from_vec(py, color_vec).reshape((nrows, 3)).unwrap())
94+
e57.color = Py::from(
95+
PyArray::from_vec(py, color_vec)
96+
.reshape((nrows, 3))
97+
.unwrap(),
98+
)
9199
}
92100
if n_intensities == n_points {
93-
e57.intensity = Py::from(PyArray::from_vec(py, intensity_vec).reshape((nrows, 1)).unwrap())
101+
e57.intensity = Py::from(
102+
PyArray::from_vec(py, intensity_vec)
103+
.reshape((nrows, 1))
104+
.unwrap(),
105+
)
94106
}
95107
Ok(e57)
96108
}

0 commit comments

Comments
 (0)