Skip to content

Commit

Permalink
deps: update dependencies
Browse files Browse the repository at this point in the history
format: reformat code
  • Loading branch information
dancergraham committed Feb 26, 2024
1 parent 5b76a51 commit 2f8106c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 39 deletions.
73 changes: 40 additions & 33 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 @@ -9,7 +9,7 @@ name = "e57"
crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.20.2"
e57 = { version = "0.10.3",features =["crc32c"]}
pyo3 = "0.20.3"
e57 = { version = "0.10.4",features =["crc32c"]}
numpy = "0.20.0"
ndarray = "0.15.6"
20 changes: 16 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fs::File;
use std::io::BufReader;

use ::e57::{CartesianCoordinate, E57Reader};
use ndarray::{Ix2};
use ndarray::Ix2;
use numpy::PyArray;
use pyo3::prelude::*;

Expand Down Expand Up @@ -82,15 +82,27 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult<E57> {
let n_colors = color_vec.len() / 3;
let n_intensities = intensity_vec.len();
let mut e57 = E57 {
points: Py::from(PyArray::from_vec(py, point_vec).reshape((nrows, 3)).unwrap()),
points: Py::from(
PyArray::from_vec(py, point_vec)
.reshape((nrows, 3))
.unwrap(),
),
color: Py::from(PyArray::new(py, (0, 3), false)),
intensity: Py::from(PyArray::new(py, (0, 1), false)),
};
if n_colors == n_points {
e57.color = Py::from(PyArray::from_vec(py, color_vec).reshape((nrows, 3)).unwrap())
e57.color = Py::from(
PyArray::from_vec(py, color_vec)
.reshape((nrows, 3))
.unwrap(),
)
}
if n_intensities == n_points {
e57.intensity = Py::from(PyArray::from_vec(py, intensity_vec).reshape((nrows, 1)).unwrap())
e57.intensity = Py::from(
PyArray::from_vec(py, intensity_vec)
.reshape((nrows, 1))
.unwrap(),
)
}
Ok(e57)
}
Expand Down

0 comments on commit 2f8106c

Please sign in to comment.