Skip to content

Commit 56013f0

Browse files
committed
add _ prefix to extension module
1 parent 0e1edfa commit 56013f0

5 files changed

Lines changed: 10 additions & 3 deletions

File tree

cg_rustpy/proj_rs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from numpy.typing import NDArray
2+
from ._cg_rustpy import project_points_rs as _project_points_rs
3+
4+
5+
def project_points_rs(points: NDArray, k: NDArray, dist_coeffs: NDArray):
6+
return _project_points_rs(points, k, dist_coeffs)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies = [
2222
]
2323

2424

25+
2526
[project.optional-dependencies]
2627
mlx = ["mlx"]
2728
dev = ["ruff", "pytest", "pytest-benchmark", "jupyterlab"]

rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[pyo3::pymodule]
1+
#[pyo3::pymodule(name = "_cg_rustpy")]
22
mod cg_rustpy {
33
use numpy::ndarray::{
44
Array, Array2, ArrayView1, ArrayView2

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
packages=["cg"],
88
rust_extensions=[
99
RustExtension(
10-
"cg_rustpy.cg_rustpy", binding=Binding.PyO3, path="rust/Cargo.toml"
10+
"cg_rustpy._cg_rustpy", binding=Binding.PyO3, path="rust/Cargo.toml"
1111
)
1212
],
1313
# rust extensions are not zip safe, just like C-extensions.

tests/test_project_points.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from cg.proj_jax import project_points_jax
1010
from cg.proj_cv import project_points_cv
1111

12-
from cg_rustpy.cg_rustpy import project_points_rs
12+
from cg_rustpy.proj_rs import project_points_rs
1313

1414

1515
DATA_DIR = Path(__file__).parent.parent / "data"

0 commit comments

Comments
 (0)