diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9f20c0..f98cf94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,5 +35,5 @@ jobs: - name: Publish to PyPi run: | maturin build --interpreter python${{ matrix.python-version }} - twine upload -u __token__ -p ${{ secrets.PYPI }} target/wheels/pylaz*.whl + twine upload -u __token__ -p ${{ secrets.PYPI }} target/wheels/lazrs*.whl diff --git a/Cargo.toml b/Cargo.toml index c78d421..8683652 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ description = "Python bindings for laz-rs" readme = "README.md" [lib] -name = "pylaz" +name = "lazrs" crate-type = ["cdylib"] [dependencies] diff --git a/src/lib.rs b/src/lib.rs index 3ad0ca2..10eb26e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ use pyo3::prelude::*; use pyo3::types::PyType; use pyo3::{create_exception, wrap_pyfunction}; -create_exception!(pylaz, PyLazError, pyo3::exceptions::RuntimeError); +create_exception!(pylaz, LazrsError, pyo3::exceptions::RuntimeError); #[pyclass] struct LazVlr { @@ -15,7 +15,7 @@ impl LazVlr { fn new(obj: &PyRawObject, record_data: &numpy::PyArray1) -> PyResult<()> { let vlr_data = record_data.as_slice()?; let vlr = laz::LazVlr::from_buffer(vlr_data) - .map_err(|e| PyErr::new::(format!("{}", e)))?; + .map_err(|e| PyErr::new::(format!("{}", e)))?; obj.init(LazVlr { vlr }); Ok(()) } @@ -30,7 +30,7 @@ impl LazVlr { point_format_id, num_extra_bytes, ) - .map_err(|e| PyErr::new::(format!("{}", e)))?; + .map_err(|e| PyErr::new::(format!("{}", e)))?; let vlr = laz::LazVlr::from_laz_items(items); Ok(LazVlr { vlr }) } @@ -48,7 +48,7 @@ impl LazVlr { let mut data = std::io::Cursor::new(Vec::::new()); self.vlr .write_to(&mut data) - .map_err(|e| PyErr::new::(format!("{}", e)))?; + .map_err(|e| PyErr::new::(format!("{}", e)))?; let gil = pyo3::Python::acquire_gil(); let np_array = numpy::PyArray1::::from_slice(gil.python(), data.get_ref().as_slice()); @@ -75,7 +75,7 @@ fn decompress_points( laz::par_decompress_buffer(data_slc, output, &vlr) } }) - .map_err(|e| PyErr::new::(format!("{}", e)))?; + .map_err(|e| PyErr::new::(format!("{}", e)))?; Ok(()) } @@ -92,14 +92,14 @@ fn compress_points( uncompressed_points.as_slice()?, laszip_vlr.vlr.clone(), ) - .map_err(|e| PyErr::new::(format!("{}", e)))?; + .map_err(|e| PyErr::new::(format!("{}", e)))?; } else { laz::par_compress_buffer( &mut compression_result, uncompressed_points.as_slice()?, &laszip_vlr.vlr, ) - .map_err(|e| PyErr::new::(format!("{}", e)))?; + .map_err(|e| PyErr::new::(format!("{}", e)))?; } let gil = pyo3::Python::acquire_gil(); let np_array = @@ -109,10 +109,10 @@ fn compress_points( /// This module is a python module implemented in Rust. #[pymodule] -fn pylaz(py: Python, m: &PyModule) -> PyResult<()> { +fn lazrs(py: Python, m: &PyModule) -> PyResult<()> { m.add_wrapped(wrap_pyfunction!(decompress_points))?; m.add_wrapped(wrap_pyfunction!(compress_points))?; - m.add("PyLazError", py.get_type::())?; + m.add("LazrsError", py.get_type::())?; m.add_class::()?; Ok(()) }