Skip to content

Commit 4102aa9

Browse files
authored
Merge pull request #18 from 3DFin/dev_v0.3.1
v0.3.1 and v0.3.2
2 parents 1cb9c71 + fbb9116 commit 4102aa9

File tree

10 files changed

+73
-58
lines changed

10 files changed

+73
-58
lines changed

.github/workflows/wheels.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525

2626
# Used to host cibuildwheel
2727
- uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.13"
2830

2931
- name: Install cibuildwheel
30-
run: python -m pip install cibuildwheel==2.20.0
32+
run: python -m pip install cibuildwheel==2.22.0
3133

3234
- name: Build wheels
3335
run: python -m cibuildwheel --output-dir wheelhouse

CMakeLists.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,24 @@ execute_process(
1212
COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
1313
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NB_DIR)
1414
list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}")
15+
1516
find_package(nanobind CONFIG REQUIRED)
17+
find_package(Threads REQUIRED)
18+
19+
if(MSVC)
20+
# Static link of MSVC rt for optimal compatibility
21+
# It avoids to mess with embedded MSVC rt coming from other packages (see PyQT5)
22+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
23+
# Same, enabling LTO (LTGC for MS) give less ABI compatibility, so we dissable it.
24+
# see https://learn.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=msvc-170
25+
# for more details.
26+
nanobind_add_module(pgeof_ext NOMINSIZE STABLE_ABI src/pgeof_ext.cpp)
27+
else()
28+
# we enable LTO on Linux and MacOS.
29+
nanobind_add_module(pgeof_ext NOMINSIZE STABLE_ABI LTO src/pgeof_ext.cpp)
30+
endif()
1631

17-
nanobind_add_module(pgeof_ext NOMINSIZE STABLE_ABI LTO src/pgeof_ext.cpp)
32+
target_link_libraries(pgeof_ext PRIVATE Threads::Threads)
1833

1934
nanobind_add_stub(
2035
pgeof_ext_stub
@@ -25,10 +40,10 @@ nanobind_add_stub(
2540
DEPENDS pgeof_ext
2641
)
2742

28-
# All lib are headeer only.
29-
# it's faster to include like this than using exported targets
43+
# All lib are header only.
44+
# it's faster to include like this than using exported targets
3045
# (i.e add_subdirectories(...))
31-
target_include_directories(pgeof_ext PRIVATE "include" "third_party/eigen" "third_party/nanoflann/include" "third_party/taskflow")
46+
target_include_directories(pgeof_ext PRIVATE "include" "third_party/eigen" "third_party/nanoflann/include" "third_party/taskflow")
3247

3348
install(TARGETS pgeof_ext LIBRARY DESTINATION pgeof)
34-
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pgeof_ext.pyi ${CMAKE_CURRENT_BINARY_DIR}/py.typed DESTINATION pgeof)
49+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pgeof_ext.pyi ${CMAKE_CURRENT_BINARY_DIR}/py.typed DESTINATION pgeof)

pyproject.toml

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
[build-system]
2-
requires = ["scikit-build-core >=0.4.3",
3-
"nanobind == 2.1.0",
4-
"typing_extensions;python_version < '3.11'"
2+
requires = [
3+
"scikit-build-core >=0.4.3",
4+
"nanobind == 2.1.0",
5+
"typing_extensions;python_version < '3.11'",
56
]
67
build-backend = "scikit_build_core.build"
78

89
[project]
910
name = "pgeof"
10-
version = "0.3.0"
11+
version = "0.3.2"
1112
readme = "README.md"
1213
description = "Compute the geometric features associated with each point's neighborhood:"
13-
requires-python = ">=3.8,<3.13"
14-
license = {file = "LICENSE"}
14+
requires-python = ">=3.8,<3.14"
15+
license = { file = "LICENSE" }
1516
authors = [
16-
{name = "Loic Landrieu", email = "[email protected]"},
17-
{name = "Damien Robert", email = "[email protected]"}
17+
{ name = "Loic Landrieu", email = "[email protected]" },
18+
{ name = "Damien Robert", email = "[email protected]" },
1819
]
1920
keywords = ["point clouds", "features", "3D", "LiDAR"]
2021
classifiers = [
21-
"Development Status :: 3 - Alpha",
22-
"Programming Language :: Python",
23-
"Topic :: Scientific/Engineering"
24-
]
25-
dependencies = [
26-
"numpy >= 1.7, < 2"
22+
"Development Status :: 3 - Alpha",
23+
"Programming Language :: Python",
24+
"Topic :: Scientific/Engineering",
2725
]
26+
dependencies = ["numpy >= 1.7"]
2827

2928
[project.urls]
3029
homepage = "https://github.com/drprojects/point_geometric_features"
@@ -42,16 +41,16 @@ cmake.build-type = "Release"
4241
# make sdist a lot lighter by removing some useless files from third_party
4342
# ⚠️ be sure to keep copyrights and license file
4443
sdist.exclude = [
45-
"third_party/eigen/bench",
46-
"third_party/eigen/demos",
47-
"third_party/eigen/doc",
48-
"third_party/taskflow/3rd-party",
49-
"third_party/taskflow/benchmarks",
50-
"third_party/taskflow/docs",
51-
"third_party/taskflow/doxygen",
52-
"third_party/taskflow/examples",
53-
"third_party/taskflow/sandbox",
54-
"third_party/taskflow/unittests",
44+
"third_party/eigen/bench",
45+
"third_party/eigen/demos",
46+
"third_party/eigen/doc",
47+
"third_party/taskflow/3rd-party",
48+
"third_party/taskflow/benchmarks",
49+
"third_party/taskflow/docs",
50+
"third_party/taskflow/doxygen",
51+
"third_party/taskflow/examples",
52+
"third_party/taskflow/sandbox",
53+
"third_party/taskflow/unittests",
5554
]
5655

5756
[tool.ruff]
@@ -61,20 +60,20 @@ line-length = 120
6160
[tool.ruff.lint]
6261
# TODO Add D, PTH, RET, disabled for now as they collides with intial choices
6362
select = ["E", "W", "YTT", "NPY", "PYI", "Q", "F", "B", "I", "SIM", "RUF"]
64-
# TODO: for now we ignore "Line too long error (E501)"
63+
# TODO: for now we ignore "Line too long error (E501)"
6564
# because our comments are too longs
6665
# code formatting will take care of the line length in code anyway
6766
ignore = [
68-
"E501",
69-
# Ignore docstring in public package and module
70-
"D100",
71-
"D104",
72-
# Blank line before class
73-
"D203",
74-
# multiline summary second line
75-
"D213",
76-
# yoda conditions
77-
"SIM300",
67+
"E501",
68+
# Ignore docstring in public package and module
69+
"D100",
70+
"D104",
71+
# Blank line before class
72+
"D203",
73+
# multiline summary second line
74+
"D213",
75+
# yoda conditions
76+
"SIM300",
7877
]
7978

8079
[tool.ruff.lint.isort]
@@ -86,28 +85,31 @@ legacy_tox_ini = """
8685
8786
[gh-actions]
8887
python =
88+
3.8: py39
8989
3.9: py39
9090
3.10: py310
9191
3.11: py311
9292
3.12: py312
93+
3.13: py313
9394
9495
[testenv]
9596
deps =
9697
pytest >= 7.4
9798
pytest-benchmark ~= 4.0
98-
numpy >= 1.7, < 2
99+
numpy >= 1.7
99100
scipy
100-
jakteristics;platform_system=="Windows" or platform_system=="Linux"
101+
jakteristics;platform_system=="Windows" or platform_system=="Linux"
101102
commands = pytest --basetemp="{envtmpdir}" {posargs}
102103
103104
[testenv:bench]
104105
# globs/wildcards do not work with tox
105-
commands = pytest -s --basetemp="{envtmpdir}" {posargs:tests/bench_knn.py tests/bench_jakteristics.py}
106+
commands = pytest -s --basetemp="{envtmpdir}" {posargs:tests/bench_knn.py tests/bench_jakteristics.py}
106107
"""
107108

108109
[tool.cibuildwheel]
109-
build = "cp3{9,10,11,12}-*"
110-
archs = ["auto64"] # limit to 64bits builds
110+
build = "cp3{8,9,10,11,12,13}-*"
111+
archs = ["auto64"] # limits to 64bits builds
112+
skip = "cp38-macosx_arm64"
111113

112114
# Needed for full C++17 support
113115
[tool.cibuildwheel.macos.environment]

tests/bench_jakteristics.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
@pytest.fixture
1313
def random_point_cloud():
1414
rng = np.random.default_rng()
15-
return rng.random(0, 100, size=((1000000, 3)))
16-
15+
return rng.uniform(0.0, 200.0, size=(10000, 3))
1716

1817
@pytest.mark.benchmark(group="feature-computation-jak", disable_gc=True, warmup=True)
1918
def test_bench_jak(benchmark, random_point_cloud):

tests/bench_knn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
@pytest.fixture
99
def random_point_cloud():
1010
rng = np.random.default_rng()
11-
return rng.random(0, 100, size=((1000000, 3))).astype("float32")
12-
11+
return rng.uniform(0.0, 200.0, size=(1000000, 3)).astype(np.float32)
1312

1413
@pytest.mark.benchmark(group="knn", disable_gc=True, warmup=True)
1514
def test_knn_scipy(benchmark, random_point_cloud):

tests/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def random_nn(num_points, k):
66
# Generate a random synthetic point cloud
77
rng = np.random.default_rng()
8-
xyz = rng.random(size=(num_points, 3))
8+
xyz = rng.uniform(0.0, 200.0, size=(num_points, 3)).astype(np.float32)
99

1010
# Converting k-nearest neighbors to CSR format
1111
kneigh = KDTree(xyz).query(xyz, k=k, workers=-1)

tests/test_pgeof.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
def test_knn():
99
knn = 10
1010
rng = np.random.default_rng()
11-
xyz = rng.random(size=(1000, 3))
12-
xyz = xyz.astype("float32")
11+
xyz = rng.uniform(0.0, 200.0, size=(1000, 3)).astype(np.float32)
1312
tree = KDTree(xyz)
1413
_, k_legacy = tree.query(xyz, k=knn, workers=-1)
1514
k_new, _ = pgeof.knn_search(xyz, xyz, knn)
@@ -20,8 +19,7 @@ def test_radius_search():
2019
knn = 10
2120
radius = 0.2
2221
rng = np.random.default_rng()
23-
xyz = rng.random(size=(1000, 3))
24-
xyz = xyz.astype("float32")
22+
xyz = rng.random(size=(1000, 3), dtype=np.float32)
2523
tree = KDTree(xyz)
2624
_, k_legacy = tree.query(xyz, k=knn, distance_upper_bound=radius, workers=-1)
2725
k_legacy[k_legacy == xyz.shape[0]] = -1

third_party/eigen

Submodule eigen updated from 287c801 to 3147391

third_party/taskflow

Submodule taskflow updated 816 files

0 commit comments

Comments
 (0)