pointtree 0.0.0__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. pointtree-1.0.0/.clang-format +5 -0
  2. pointtree-1.0.0/.coveragerc +4 -0
  3. pointtree-1.0.0/.github/workflows/build-docker-image.yml +50 -0
  4. pointtree-1.0.0/.github/workflows/clean-up-pull-requests.yml +28 -0
  5. pointtree-1.0.0/.github/workflows/code-quality-main.yml +9 -0
  6. pointtree-1.0.0/.github/workflows/code-quality-pull-requests.yml +11 -0
  7. pointtree-1.0.0/.github/workflows/code-quality.yml +142 -0
  8. pointtree-1.0.0/.github/workflows/conventional-commits-pull-requests.yml +17 -0
  9. pointtree-1.0.0/.github/workflows/deploy-docs.yml +122 -0
  10. pointtree-1.0.0/.github/workflows/generate-docs.yml +50 -0
  11. pointtree-1.0.0/.github/workflows/release-package.yml +189 -0
  12. pointtree-1.0.0/.gitignore +167 -0
  13. pointtree-1.0.0/.mypy.ini +24 -0
  14. pointtree-1.0.0/.pre-commit-config.yaml +52 -0
  15. pointtree-1.0.0/.rcfile +13 -0
  16. pointtree-1.0.0/CHANGELOG.md +189 -0
  17. pointtree-1.0.0/CMakeLists.txt +84 -0
  18. pointtree-1.0.0/Dockerfile +7 -0
  19. {pointtree-0.0.0 → pointtree-1.0.0}/LICENSE +21 -21
  20. pointtree-1.0.0/PKG-INFO +196 -0
  21. pointtree-1.0.0/README.md +112 -0
  22. pointtree-1.0.0/citation.cff +25 -0
  23. pointtree-1.0.0/csrc/include/PointTree/evaluation/instance_segmentation_metrics.h +227 -0
  24. pointtree-1.0.0/csrc/include/PointTree/instance_segmentation/coarse_to_fine_algorithm.h +156 -0
  25. pointtree-1.0.0/csrc/include/PointTree/instance_segmentation/tree_x_algorithm.h +484 -0
  26. pointtree-1.0.0/csrc/include/PointTree/operations/distance_to_dtm.h +60 -0
  27. pointtree-1.0.0/csrc/include/PointTree/operations/fit_ellipse.h +189 -0
  28. pointtree-1.0.0/csrc/include/PointTree/operations/points_in_ellipse.h +32 -0
  29. pointtree-1.0.0/csrc/include/PointTree/operations/stddev.h +19 -0
  30. pointtree-1.0.0/csrc/include/PointTree/type_aliases.h +90 -0
  31. pointtree-1.0.0/csrc/pybind/evaluation_pybind.cpp +38 -0
  32. pointtree-1.0.0/csrc/pybind/instance_segmentation/coarse_to_fine_algorithm_pybind.cpp +27 -0
  33. pointtree-1.0.0/csrc/pybind/instance_segmentation/tree_x_algorithm_pybind.cpp +67 -0
  34. pointtree-1.0.0/csrc/pybind/operations_pybind.cpp +46 -0
  35. pointtree-1.0.0/docs/Makefile +20 -0
  36. pointtree-1.0.0/docs/_templates/module.rst_t +10 -0
  37. pointtree-1.0.0/docs/_templates/package.rst_t +49 -0
  38. pointtree-1.0.0/docs/_templates/toc.rst_t +8 -0
  39. pointtree-1.0.0/docs/make.bat +35 -0
  40. pointtree-1.0.0/docs/source/_static/autoclass.css +15 -0
  41. pointtree-1.0.0/docs/source/_templates/404.html +109 -0
  42. pointtree-1.0.0/docs/source/_templates/index.html +5 -0
  43. pointtree-1.0.0/docs/source/_templates/module.rst_t +9 -0
  44. pointtree-1.0.0/docs/source/_templates/package.rst_t +49 -0
  45. pointtree-1.0.0/docs/source/_templates/toc.rst_t +8 -0
  46. pointtree-1.0.0/docs/source/_templates/version.html +6 -0
  47. pointtree-1.0.0/docs/source/_templates/versions.html +65 -0
  48. pointtree-1.0.0/docs/source/changelog/index.rst +7 -0
  49. pointtree-1.0.0/docs/source/conf.py +163 -0
  50. pointtree-1.0.0/docs/source/develop/index.rst +38 -0
  51. pointtree-1.0.0/docs/source/how-to/install/includes/clone.sh +1 -0
  52. pointtree-1.0.0/docs/source/how-to/install/includes/install.sh +1 -0
  53. pointtree-1.0.0/docs/source/index.rst +54 -0
  54. pointtree-1.0.0/docs/source/modules.rst +8 -0
  55. pointtree-1.0.0/docs/source/pointtree.config.rst +6 -0
  56. pointtree-1.0.0/docs/source/pointtree.evaluation.rst +6 -0
  57. pointtree-1.0.0/docs/source/pointtree.instance_segmentation.rst +17 -0
  58. pointtree-1.0.0/docs/source/pointtree.operations.rst +6 -0
  59. pointtree-1.0.0/docs/source/pointtree.rst +17 -0
  60. pointtree-1.0.0/docs/source/pointtree.visualization.rst +6 -0
  61. pointtree-1.0.0/docs/source/robots.txt +3 -0
  62. pointtree-1.0.0/mypy_stubs/sklearn/cluster.pyi +22 -0
  63. pointtree-1.0.0/mypy_stubs/sklearn/decomposition.pyi +38 -0
  64. pointtree-1.0.0/mypy_stubs/sklearn/linear_model.pyi +20 -0
  65. pointtree-1.0.0/mypy_stubs/torch_scatter/__init__.py +4 -0
  66. pointtree-1.0.0/mypy_stubs/torch_scatter/scatter_max.pyi +7 -0
  67. pointtree-1.0.0/mypy_stubs/torch_scatter/segment_csr.pyi +7 -0
  68. pointtree-1.0.0/notebooks/0_evaluate_semantic_segmentation_old.ipynb +388 -0
  69. pointtree-1.0.0/notebooks/0_preprocess_semantic_segmentation.ipynb +254 -0
  70. pointtree-1.0.0/notebooks/1_evaluate_semantic_segmentation.ipynb +254 -0
  71. pointtree-1.0.0/notebooks/2_color_semantic_segmentation.ipynb +250 -0
  72. pointtree-1.0.0/notebooks/3_evaluate_instance_segmentation.ipynb +475 -0
  73. pointtree-1.0.0/notebooks/4_color_instance_segmentation.ipynb +305 -0
  74. pointtree-1.0.0/notebooks/4_evaluate_instance_segmentation_old.ipynb +388 -0
  75. pointtree-1.0.0/pyproject.toml +94 -0
  76. {pointtree-0.0.0 → pointtree-1.0.0}/setup.py +2 -2
  77. pointtree-1.0.0/src/pointtree/__init__.py +0 -0
  78. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/config/__init__.py +5 -5
  79. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/config/_config.py +19 -19
  80. pointtree-1.0.0/src/pointtree/evaluation/__init__.py +9 -0
  81. pointtree-1.0.0/src/pointtree/evaluation/_instance_segmentation_metrics.py +657 -0
  82. pointtree-1.0.0/src/pointtree/evaluation/_match_instances.py +197 -0
  83. pointtree-1.0.0/src/pointtree/evaluation/_performance_tracker.py +69 -0
  84. pointtree-1.0.0/src/pointtree/evaluation/_profiler.py +49 -0
  85. pointtree-1.0.0/src/pointtree/evaluation/_semantic_segmentation_metrics.py +106 -0
  86. pointtree-1.0.0/src/pointtree/instance_segmentation/__init__.py +8 -0
  87. pointtree-0.0.0/src/pointtree/instance_segmentation/_multi_stage_algorithm.py → pointtree-1.0.0/src/pointtree/instance_segmentation/_coarse_to_fine_algorithm.py +1232 -1218
  88. pointtree-1.0.0/src/pointtree/instance_segmentation/_instance_segmentation_algorithm.py +48 -0
  89. pointtree-1.0.0/src/pointtree/instance_segmentation/_tree_x_algorithm.py +2223 -0
  90. pointtree-1.0.0/src/pointtree/instance_segmentation/filters.py +254 -0
  91. pointtree-1.0.0/src/pointtree/instance_segmentation/tree_x_presets.py +129 -0
  92. pointtree-1.0.0/src/pointtree/operations/__init__.py +12 -0
  93. pointtree-1.0.0/src/pointtree/operations/_cloth_simulation_filtering.py +72 -0
  94. pointtree-1.0.0/src/pointtree/operations/_create_digital_terrain_model.py +91 -0
  95. pointtree-1.0.0/src/pointtree/operations/_distance_to_dtm.py +61 -0
  96. pointtree-1.0.0/src/pointtree/operations/_estimate_with_linear_model.py +49 -0
  97. pointtree-1.0.0/src/pointtree/operations/_fit_ellipse.py +55 -0
  98. pointtree-1.0.0/src/pointtree/operations/_no_stdout.py +22 -0
  99. pointtree-1.0.0/src/pointtree/operations/_points_in_ellipse.py +52 -0
  100. pointtree-1.0.0/src/pointtree/operations/_polygon_area.py +32 -0
  101. pointtree-1.0.0/src/pointtree/operations/_statistical_outlier_removal.py +59 -0
  102. pointtree-1.0.0/src/pointtree/py.typed +0 -0
  103. pointtree-1.0.0/src/pointtree/type_aliases.py +12 -0
  104. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/visualization/__init__.py +9 -7
  105. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/visualization/_color_palette.py +39 -39
  106. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/visualization/_color_point_cloud.py +101 -107
  107. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/visualization/_hex_to_rgb.py +29 -29
  108. pointtree-1.0.0/src/pointtree/visualization/_plot_fitted_shape.py +115 -0
  109. {pointtree-0.0.0 → pointtree-1.0.0}/src/pointtree/visualization/_save_tree_map.py +86 -85
  110. pointtree-1.0.0/test/__init__.py +0 -0
  111. pointtree-1.0.0/test/evaluation/__init__.py +0 -0
  112. pointtree-1.0.0/test/evaluation/test_instance_segmentation_metrics.py +1124 -0
  113. pointtree-1.0.0/test/evaluation/test_match_instances.py +224 -0
  114. pointtree-1.0.0/test/evaluation/test_performance_tracker.py +31 -0
  115. pointtree-1.0.0/test/evaluation/test_profiler.py +42 -0
  116. pointtree-1.0.0/test/evaluation/test_semantic_segmentation_metrics.py +97 -0
  117. pointtree-1.0.0/test/instance_segmentation/__init__.py +0 -0
  118. pointtree-1.0.0/test/instance_segmentation/test_coarse_to_fine_algorithm.py +919 -0
  119. pointtree-1.0.0/test/instance_segmentation/test_filters.py +192 -0
  120. pointtree-1.0.0/test/instance_segmentation/test_tree_x_algorithm.py +1057 -0
  121. pointtree-1.0.0/test/instance_segmentation/test_tree_x_presets.py +34 -0
  122. pointtree-1.0.0/test/operations/__init__.py +0 -0
  123. pointtree-1.0.0/test/operations/test_cloth_simulation_filtering.py +38 -0
  124. pointtree-1.0.0/test/operations/test_create_digital_terrain_model.py +27 -0
  125. pointtree-1.0.0/test/operations/test_distance_to_dtm.py +47 -0
  126. pointtree-1.0.0/test/operations/test_estimate_with_linear_model.py +29 -0
  127. pointtree-1.0.0/test/operations/test_fit_ellipse.py +58 -0
  128. pointtree-1.0.0/test/operations/test_points_in_ellipse.py +54 -0
  129. pointtree-1.0.0/test/operations/test_polygon_area.py +39 -0
  130. pointtree-1.0.0/test/operations/test_statistical_outlier_removal.py +45 -0
  131. pointtree-1.0.0/test/utils/__init__.py +6 -0
  132. pointtree-1.0.0/test/utils/_generate_points.py +183 -0
  133. pointtree-1.0.0/test/utils/_generate_tree_point_cloud.py +103 -0
  134. pointtree-1.0.0/test/visualization/__init__.py +0 -0
  135. pointtree-1.0.0/test/visualization/test_plot_fitted_shape.py +91 -0
  136. pointtree-0.0.0/PKG-INFO +0 -114
  137. pointtree-0.0.0/README.md +0 -33
  138. pointtree-0.0.0/pyproject.toml +0 -81
  139. pointtree-0.0.0/setup.cfg +0 -4
  140. pointtree-0.0.0/src/pointtree/evaluation/__init__.py +0 -7
  141. pointtree-0.0.0/src/pointtree/evaluation/_metrics.py +0 -233
  142. pointtree-0.0.0/src/pointtree/evaluation/_time_tracker.py +0 -45
  143. pointtree-0.0.0/src/pointtree/evaluation/_timer.py +0 -29
  144. pointtree-0.0.0/src/pointtree/instance_segmentation/__init__.py +0 -7
  145. pointtree-0.0.0/src/pointtree/instance_segmentation/_instance_segmentation_algorithm.py +0 -232
  146. pointtree-0.0.0/src/pointtree/instance_segmentation/_priority_queue.py +0 -107
  147. pointtree-0.0.0/src/pointtree/instance_segmentation/_utils.py +0 -45
  148. pointtree-0.0.0/src/pointtree/io/__init__.py +0 -19
  149. pointtree-0.0.0/src/pointtree/io/_base_point_cloud_reader.py +0 -88
  150. pointtree-0.0.0/src/pointtree/io/_base_point_cloud_writer.py +0 -90
  151. pointtree-0.0.0/src/pointtree/io/_csv_reader.py +0 -83
  152. pointtree-0.0.0/src/pointtree/io/_csv_writer.py +0 -76
  153. pointtree-0.0.0/src/pointtree/io/_las_reader.py +0 -103
  154. pointtree-0.0.0/src/pointtree/io/_las_writer.py +0 -145
  155. pointtree-0.0.0/src/pointtree/io/_point_cloud_io_data.py +0 -19
  156. pointtree-0.0.0/src/pointtree/io/_point_cloud_reader.py +0 -46
  157. pointtree-0.0.0/src/pointtree/io/_point_cloud_writer.py +0 -45
  158. pointtree-0.0.0/src/pointtree/operations/__init__.py +0 -9
  159. pointtree-0.0.0/src/pointtree/operations/_knn_search.py +0 -277
  160. pointtree-0.0.0/src/pointtree/operations/_make_labels_consecutive.py +0 -64
  161. pointtree-0.0.0/src/pointtree/operations/_pack_batch.py +0 -61
  162. pointtree-0.0.0/src/pointtree/operations/_ravel_index.py +0 -121
  163. pointtree-0.0.0/src/pointtree/operations/_voxel_downsampling.py +0 -170
  164. pointtree-0.0.0/src/pointtree.egg-info/PKG-INFO +0 -114
  165. pointtree-0.0.0/src/pointtree.egg-info/SOURCES.txt +0 -42
  166. pointtree-0.0.0/src/pointtree.egg-info/dependency_links.txt +0 -1
  167. pointtree-0.0.0/src/pointtree.egg-info/requires.txt +0 -34
  168. pointtree-0.0.0/src/pointtree.egg-info/top_level.txt +0 -1
  169. /pointtree-0.0.0/src/pointtree/__init__.py → /pointtree-1.0.0/mypy_stubs/sklearn/__init__.pyi +0 -0
@@ -0,0 +1,5 @@
1
+ BasedOnStyle: Google
2
+ ColumnLimit: 120
3
+ Language: Cpp
4
+ BinPackParameters: false
5
+ AlignAfterOpenBracket: AlwaysBreak
@@ -0,0 +1,4 @@
1
+ [run]
2
+ omit =
3
+ # excludes tests from coverage measurements
4
+ test/*
@@ -0,0 +1,50 @@
1
+ name: Build of Docker images
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ # Allows to run this workflow manually from the Actions tab
7
+ workflow_dispatch:
8
+
9
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
10
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
11
+ concurrency:
12
+ group: build-docker-image
13
+ cancel-in-progress: false
14
+
15
+ jobs:
16
+ build-docker-image:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - name: Clean working directory
20
+ uses: AutoModality/action-clean@v1.1.0
21
+ - name: Delete unnecessary folders to free disk space
22
+ run: |
23
+ rm -rf /opt/hostedtoolcache
24
+ rm -rf /usr/local/android /usr/share/dotnet /usr/local/share/boost /opt/ghc
25
+ docker system prune --all --volumes --force
26
+ - name: Checkout out repository
27
+ uses: actions/checkout@v6
28
+ with:
29
+ fetch-depth: 0
30
+ - name: Get latest package version
31
+ shell: bash
32
+ run: |
33
+ latest_version=$(git tag -l 'v[0-9]*\.[0-9]*\.[0-9]*' | sort | tail -1)
34
+ echo "latest_version=${latest_version:1}" >> $GITHUB_ENV
35
+ - name: Log in to Docker Hub
36
+ uses: docker/login-action@v3
37
+ with:
38
+ username: ${{ secrets.DOCKER_HUB_USER }}
39
+ password: ${{ secrets.DOCKER_HUB_PASSWORD }}
40
+ - name: Build and push Docker image
41
+ uses: docker/build-push-action@v6
42
+ with:
43
+ context: .
44
+ file: Dockerfile
45
+ push: true
46
+ tags: |
47
+ josafatburmeister/pointtree:${{ env.latest_version }}-torch2.10.0-cuda12.9
48
+ josafatburmeister/pointtree:latest
49
+ - name: Clean up docker build remains
50
+ run: docker system prune --all --volumes --force
@@ -0,0 +1,28 @@
1
+ # This workflow runs a clean up after a pull request is closed or merged
2
+
3
+ name: Clean up after closing or merging a pull request
4
+
5
+ on:
6
+ pull_request:
7
+ types: [closed]
8
+
9
+ # Allow only one concurrent run, skipping runs queued between the run in-progress and latest queued.
10
+ # However, do NOT cancel in-progress runs as we want to allow these runs to complete.
11
+ # Unfortunately, there is no option to disable skipping runs queued between the run in-progress and latest queued.
12
+ concurrency:
13
+ group: clean-up-pr
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ clean-up-pr:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - name: Setup Rclone
21
+ uses: AnimMouse/setup-rclone@v1
22
+ - name: Remove documentation deployment
23
+ shell: bash
24
+ run: |
25
+ rclone config create --non-interactive docs-cloud webdav url=${{ secrets.DOCS_CLOUD_URL }} \
26
+ pass=${{ secrets.DOCS_CLOUD_PASSWORD }} vendor=${{ secrets.DOCS_CLOUD_VENDOR }} \
27
+ user=${{ secrets.DOCS_CLOUD_USER }}
28
+ rclone purge docs-cloud:pointtree-docs/pr${{ github.event.number }}
@@ -0,0 +1,9 @@
1
+ name: CI pipeline for main branch
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ jobs:
8
+ ci:
9
+ uses: ./.github/workflows/code-quality.yml
@@ -0,0 +1,11 @@
1
+
2
+ name: CI pipeline for pull requests
3
+
4
+ on:
5
+ pull_request:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ ci:
11
+ uses: ./.github/workflows/code-quality.yml
@@ -0,0 +1,142 @@
1
+ name: Code Quality Checks
2
+
3
+ on:
4
+ workflow_call:
5
+
6
+ permissions:
7
+ contents: read
8
+ id-token: write
9
+
10
+ jobs:
11
+ black:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Clean up potential remnants of past jobs
15
+ uses: AutoModality/action-clean@v1.1.0
16
+ - name: Checkout out repository
17
+ uses: actions/checkout@v6
18
+ - name: Setup up Python
19
+ uses: actions/setup-python@v6
20
+ with:
21
+ python-version: '3.12'
22
+ - name: Analysing the code with black
23
+ shell: bash
24
+ run: |
25
+ python -m pip install black
26
+ black src --check --verbose --diff --color --line-length 120
27
+ black test --check --verbose --diff --color --line-length 120
28
+ clang-format:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - name: Clean up potential remnants of past jobs
32
+ uses: AutoModality/action-clean@v1.1.0
33
+ - name: Checkout out repository
34
+ uses: actions/checkout@v6
35
+ - name: Format C++ code with clang-format
36
+ shell: bash
37
+ run: |
38
+ python -m pip install clang-format
39
+ find csrc/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format --dry-run --Werror
40
+ mypy:
41
+ runs-on: ubuntu-latest
42
+ container:
43
+ image: josafatburmeister/pointtree:latest
44
+ volumes:
45
+ - ${{ github.workspace }}:/github/workspace
46
+ steps:
47
+ - name: Clean up potential remnants of past jobs
48
+ uses: AutoModality/action-clean@v1.1.0
49
+ - name: Checkout out repository
50
+ uses: actions/checkout@v6
51
+ - name: Analysing the code with mypy
52
+ shell: bash
53
+ run: |
54
+ cd /github/workspace/
55
+ pip install torch==2.10.0
56
+ pip install torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
57
+ pip install torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
58
+ pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
59
+ python -m pip install -v --upgrade -e .'[dev, docs]'
60
+ mypy . --warn-unused-ignores --show-error-codes --no-incremental
61
+ pylint:
62
+ runs-on: ubuntu-latest
63
+ container:
64
+ image: josafatburmeister/pointtree:latest
65
+ volumes:
66
+ - ${{ github.workspace }}:/github/workspace
67
+ steps:
68
+ - name: Clean up potential remnants of past jobs
69
+ uses: AutoModality/action-clean@v1.1.0
70
+ - name: Checkout out repository
71
+ uses: actions/checkout@v6
72
+ - name: Analysing the code with pylint
73
+ shell: bash
74
+ run: |
75
+ cd /github/workspace/
76
+ pip install torch==2.10.0
77
+ pip install torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
78
+ pip install torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
79
+ pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
80
+ python -m pip install -v --upgrade .'[dev, docs]'
81
+ pylint src --rcfile=.rcfile
82
+ pylint test --rcfile=.rcfile --disable duplicate-code --disable missing-function-docstring
83
+ test:
84
+ runs-on: ubuntu-latest
85
+ strategy:
86
+ matrix:
87
+ version: [
88
+ {python: "3.11", torch: "2.7.0", image: "python:3.11-trixie"},
89
+ {python: "3.12", torch: "2.8.0", image: "python:3.12-trixie"},
90
+ {python: "3.13", torch: "2.9.0", image: "python:3.13-trixie"},
91
+ {python: "3.14", torch: "2.10.0", image: "python:3.14-trixie"}
92
+ ]
93
+ container:
94
+ image: ${{ matrix.version.image }}
95
+ volumes:
96
+ - ${{ github.workspace }}:/github/workspace
97
+ steps:
98
+ - name: Clean up potential remnants of past jobs
99
+ uses: AutoModality/action-clean@v1.1.0
100
+ - name: Checkout out repository
101
+ uses: actions/checkout@v6
102
+ with:
103
+ ref: ${{ github.head_ref }}
104
+ fetch-depth: 0
105
+ - name: Install package and dependencies
106
+ if: ${{ matrix.version.python < '3.14'}}
107
+ shell: bash
108
+ run: |
109
+ python -m pip install torch==${{ matrix.version.torch }}
110
+ python -m pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
111
+ python -m pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
112
+ pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
113
+ python -m pip install --upgrade -e .'[dev, docs]'
114
+ - name: Install package and dependencies
115
+ if: ${{ matrix.version.python >= '3.14'}}
116
+ shell: bash
117
+ run: |
118
+ python -m pip install torch==${{ matrix.version.torch }}
119
+ python -m pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
120
+ python -m pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.version.torch }}+cpu.html
121
+ pip install --force-reinstall git+https://github.com/ai4trees/pointtorch.git
122
+ cd /github/workspace/
123
+ python -m pip install --upgrade -e .'[dev, docs]'
124
+ - name: Execute tests
125
+ if: matrix.version.python < '3.14'
126
+ shell: bash
127
+ run: |
128
+ cd /github/workspace/
129
+ pytest
130
+ - name: Execute tests (without numba JIT) and measure code coverage
131
+ if: matrix.version.python == '3.14'
132
+ shell: bash
133
+ run: |
134
+ cd /github/workspace/
135
+ NUMBA_DISABLE_JIT=1 pytest --cov --cov-report=xml
136
+ - name: Upload results to Codecov
137
+ if: matrix.version.python == '3.14'
138
+ uses: codecov/codecov-action@v5
139
+ with:
140
+ fail_ci_if_error: true
141
+ use_oidc: true
142
+ verbose: true
@@ -0,0 +1,17 @@
1
+ # This workflow checks that pull request titles adhere to the conventional commits format
2
+
3
+ name: PR Conventional Commit Validation
4
+
5
+ on:
6
+ pull_request:
7
+ types: [opened, synchronize, reopened, edited]
8
+
9
+ jobs:
10
+ validate-pr-title:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: PR Conventional Commit Validation
14
+ uses: ytanikin/pr-conventional-commits@1.4.2
15
+ with:
16
+ task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
17
+ add_label: 'true'
@@ -0,0 +1,122 @@
1
+ # This workflow deploys the package documentation on GitHub Pages when a new package release is published, a new commit
2
+ # is pushed to main, or a pull request is created
3
+
4
+ name: Deploy documentation
5
+
6
+ on:
7
+ release:
8
+ types: [published]
9
+ push:
10
+ branches:
11
+ - main
12
+ pull_request:
13
+ branches:
14
+ - main
15
+
16
+ # Allows to run this workflow manually from the Actions tab
17
+ workflow_dispatch:
18
+
19
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
20
+ permissions:
21
+ contents: read
22
+ pages: write
23
+ id-token: write
24
+ pull-requests: write
25
+
26
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
27
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
28
+ concurrency:
29
+ group: deploy-docs
30
+ cancel-in-progress: false
31
+
32
+ jobs:
33
+ deploy-docs:
34
+ if: github.repository == 'ai4trees/pointtree' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: github-pages
38
+ url: ${{ steps.deployment.outputs.page_url }}
39
+ container:
40
+ image: josafatburmeister/pointtree:latest
41
+ volumes:
42
+ - ${{ github.workspace }}:/github/workspace
43
+
44
+ steps:
45
+ - name: Clean up potential remnants of past jobs
46
+ uses: AutoModality/action-clean@v1.1.0
47
+ - name: Checkout out repository
48
+ uses: actions/checkout@v6
49
+ with:
50
+ fetch-depth: 0
51
+ - name: Prepare docs build
52
+ shell: bash
53
+ run: |
54
+ cd /github/workspace
55
+ python -m pip install --upgrade -e .'[dev, docs]'
56
+ cd docs
57
+ rm -rf all_builds
58
+ mkdir all_builds
59
+ rm -rf build
60
+ rclone config create --non-interactive docs-cloud webdav url=${{ secrets.DOCS_CLOUD_URL }} \
61
+ pass=${{ secrets.DOCS_CLOUD_PASSWORD }} vendor=${{ secrets.DOCS_CLOUD_VENDOR }} \
62
+ user=${{ secrets.DOCS_CLOUD_USER }}
63
+ rclone copy docs-cloud:pointtree-docs/ all_builds
64
+ - name: Build docs for package release
65
+ if: github.event_name == 'release'
66
+ shell: bash
67
+ run: |
68
+ cd /github/workspace/
69
+ git config --global --add safe.directory $(realpath .)
70
+ cd docs
71
+ latest_version=$(git tag -l "v[0-9]*\.[0-9]*\.[0-9]*" | sort | tail -1)
72
+ git checkout "$latest_version"
73
+ make clean
74
+ make html
75
+ mv build/html "all_builds/$latest_version"
76
+ rm -f all_builds/404.html
77
+ cp ./source/_templates/404.html all_builds/404.html
78
+ sed -i -e "s/LATEST_VERSION = \"v0.0.0\";/LATEST_VERSION = \"$latest_version\";/g" all_builds/404.html
79
+ rclone sync all_builds docs-cloud:pointtree-docs
80
+ - name: Build docs for main branch
81
+ if: github.event_name == 'push' && github.ref_name == 'main'
82
+ shell: bash
83
+ run: |
84
+ cd /github/workspace/
85
+ git config --global --add safe.directory $(realpath .)
86
+ cd docs
87
+ git checkout ${{ github.head_ref }}
88
+ export POINTTREE_VERSION="main (unstable)"
89
+ make clean
90
+ make html
91
+ rm -rf all_builds/main
92
+ mv build/html all_builds/main
93
+ rclone sync all_builds docs-cloud:pointtree-docs
94
+ - name: Build docs for pull request
95
+ if: github.event_name == 'pull_request'
96
+ shell: bash
97
+ run: |
98
+ cd /github/workspace/
99
+ git config --global --add safe.directory $(realpath .)
100
+ cd docs
101
+ git checkout ${{ github.head_ref }}
102
+ export POINTTREE_VERSION="pr${{ github.event.number }}"
103
+ make clean
104
+ make html
105
+ rm -rf "all_builds/pr${{ github.event.number }}"
106
+ mv build/html "all_builds/pr${{ github.event.number }}"
107
+ rclone sync all_builds docs-cloud:pointtree-docs
108
+ - uses: marocchino/sticky-pull-request-comment@v2
109
+ if: github.event_name == 'pull_request'
110
+ with:
111
+ message: |
112
+ The documentation for this pull request was deployed at https://ai4trees.github.io/pointtree/pr${{ github.event.number }}.
113
+ - name: Setup Pages
114
+ uses: actions/configure-pages@v5
115
+ - name: Upload artifact
116
+ uses: actions/upload-pages-artifact@v4
117
+ with:
118
+ # Upload entire repository
119
+ path: './docs/all_builds'
120
+ - name: Deploy to GitHub Pages
121
+ id: deployment
122
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,50 @@
1
+ # This workflow updates the sources of the Sphinx documentation based on the Python docstrings
2
+
3
+ name: Update Sphinx Documentation
4
+ on:
5
+ pull_request:
6
+ branches:
7
+ - main
8
+
9
+ # Allows to run this workflow manually from the Actions tab
10
+ workflow_dispatch:
11
+
12
+ concurrency:
13
+ group: generate-docs
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ generate-docs:
18
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
19
+ runs-on: ubuntu-latest
20
+ container:
21
+ image: josafatburmeister/pointtree:latest
22
+ volumes:
23
+ - ${{ github.workspace }}:/github/workspace
24
+ steps:
25
+ - name: Clean up potential remnants of past jobs
26
+ uses: AutoModality/action-clean@v1.1.0
27
+ - name: Checkout out repository
28
+ uses: actions/checkout@v6
29
+ with:
30
+ ref: ${{ github.head_ref }}
31
+ fetch-depth: 0
32
+ - name: Generate sphinx documentation sources from docstrings
33
+ shell: bash
34
+ run: |
35
+ cd /github/workspace/
36
+ python -m pip install --upgrade .'[dev, docs]'
37
+ sphinx-apidoc --force --module-first -t ./docs/source/_templates/ -o ./docs/source ./src
38
+ - name: Commit and push documentation sources
39
+ run: |
40
+ cd /github/workspace/
41
+ git config --global --add safe.directory $(realpath .)
42
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
43
+ git config --global user.name "github-actions[bot]"
44
+
45
+ if [[ -n "$(git status --porcelain)" ]]; then
46
+ git add docs/source/*
47
+ git pull
48
+ git commit -m "docs: update docs [${{ github.event.pull_request.title }}] [skip-ci]"
49
+ git push
50
+ fi
@@ -0,0 +1,189 @@
1
+ # This workflow creates a release of the package and publishes it on PyPI when commits are pushed to the main branch
2
+ name: Release package
3
+
4
+ on:
5
+ # Allows to run this workflow manually from the Actions tab
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: write
11
+
12
+ concurrency:
13
+ group: release
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ build-wheels:
18
+ name: Build wheels for ${{ matrix.os }}
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ matrix:
22
+ os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest]
23
+ steps:
24
+ # Note: we need to checkout the repository at the workflow sha in case during the workflow
25
+ # the branch was updated. To keep PSR working with the configured release branches,
26
+ # we force a checkout of the desired release branch but at the workflow sha HEAD.
27
+ - name: Check out repository at workflow sha
28
+ uses: actions/checkout@v6
29
+ with:
30
+ fetch-depth: 0
31
+ ref: ${{ github.sha }}
32
+ - name: Force correct release branch on workflow sha
33
+ run: git checkout -B ${{ github.ref_name }} ${{ github.sha }}
34
+ # to build the package, a preview of the released version is created but not committed
35
+ - name: Create release preview
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ pip install build wheel python-semantic-release
39
+ semantic-release version --no-commit --skip-build --no-vcs-release --no-tag
40
+ - name: Install OpenMP on MacOS
41
+ if: ${{ startsWith(matrix.os, 'macos') }}
42
+ run: |
43
+ git clone --depth 1 https://github.com/llvm/llvm-project.git
44
+
45
+ cmake -S llvm-project/runtimes -B llvm-project/build-openmp \
46
+ -DLLVM_ENABLE_RUNTIMES=openmp \
47
+ -DCMAKE_BUILD_TYPE=Release \
48
+ -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/llvm-project/openmp/install" \
49
+ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
50
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
51
+ -DLIBOMP_ENABLE_SHARED=ON
52
+
53
+ cmake --build llvm-project/build-openmp -j
54
+ cmake --install llvm-project/build-openmp
55
+ - name: Build wheels
56
+ uses: pypa/cibuildwheel@v3.3.0
57
+ env:
58
+ CIBW_SKIP: "*-win32 cp314t-* *-musllinux_*"
59
+ CIBW_CONFIG_SETTINGS_MACOS: >
60
+ cmake.args=-DOPENMP_ROOT=${{ github.workspace }}/llvm-project/openmp/install
61
+ CIBW_ENVIRONMENT_MACOS: >
62
+ MACOSX_DEPLOYMENT_TARGET=10.15
63
+ DYLD_LIBRARY_PATH="${{ github.workspace }}/llvm-project/openmp/install/lib"
64
+ CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel"
65
+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}"
66
+ CIBW_TEST_COMMAND: pytest {package}/test
67
+ CIBW_TEST_REQUIRES: pytest
68
+ CIBW_BEFORE_TEST_LINUX: >
69
+ ARCH=$(python -c "import platform; print(platform.machine())") &&
70
+ if [ "$ARCH" = "aarch64" ]; then
71
+ python -m pip install --upgrade pip setuptools wheel ninja build meson-python &&
72
+ python -m pip install torch==2.10.0 &&
73
+ python -m pip install --no-build-isolation --no-binary=torch-scatter torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
74
+ python -m pip install --no-build-isolation --no-binary=torch-cluster torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html;
75
+ else
76
+ python -m pip install --upgrade pip setuptools wheel build &&
77
+ python -m pip install torch==2.10.0 &&
78
+ python -m pip install --no-build-isolation --no-binary=torch-scatter torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
79
+ python -m pip install --no-build-isolation --no-binary=torch-cluster torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html;
80
+ fi
81
+ CIBW_BEFORE_TEST_MACOS: >
82
+ python -m pip install --upgrade pip "setuptools<81" &&
83
+ python -m pip install torch==2.10.0 &&
84
+ python -m pip install --no-build-isolation torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
85
+ python -m pip install --no-build-isolation torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
86
+ CIBW_BEFORE_TEST_WINDOWS: >
87
+ python -m pip install --upgrade pip &&
88
+ python -m pip install torch==2.10.0 &&
89
+ python -m pip install --no-build-isolation torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html &&
90
+ python -m pip install --no-build-isolation torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html
91
+ - uses: actions/upload-artifact@v6
92
+ with:
93
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
94
+ path: ./wheelhouse/*.whl
95
+
96
+ build-sdist:
97
+ name: Build source distribution
98
+ runs-on: ubuntu-latest
99
+ steps:
100
+ - name: Check out repository at workflow sha
101
+ uses: actions/checkout@v6
102
+ with:
103
+ fetch-depth: 0
104
+ ref: ${{ github.sha }}
105
+ - name: Force correct release branch on workflow sha
106
+ run: git checkout -B ${{ github.ref_name }} ${{ github.sha }}
107
+ - name: Setup up Python
108
+ uses: actions/setup-python@v6
109
+ with:
110
+ python-version: '3.14'
111
+ # to build the package, a preview of the released version is created but not committed
112
+ - name: Create release preview
113
+ run: |
114
+ python -m pip install --upgrade pip
115
+ pip install build wheel python-semantic-release
116
+ semantic-release version --no-commit --skip-build --no-vcs-release --no-tag
117
+ - name: Install build dependencies
118
+ run: |
119
+ python -m pip install --upgrade pip
120
+ pip install build
121
+ - name: Build sdist
122
+ run: python -m build --sdist
123
+ - uses: actions/upload-artifact@v6
124
+ with:
125
+ name: cibw-sdist
126
+ path: dist/*.tar.gz
127
+
128
+ release-package:
129
+ needs: [build-wheels, build-sdist]
130
+ if: github.repository == 'ai4trees/pointtree' && github.ref_name == 'main'
131
+ runs-on: 'ubuntu-latest'
132
+ steps:
133
+ - name: Clean up potential remnants of past jobs
134
+ uses: AutoModality/action-clean@v1.1.0
135
+ - name: Check out repository at workflow sha
136
+ uses: actions/checkout@v6
137
+ with:
138
+ fetch-depth: 0
139
+ ref: ${{ github.sha }}
140
+ - name: Force correct release branch on workflow sha
141
+ run: |
142
+ git config --global --add safe.directory $(realpath .)
143
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
144
+ git config --global user.name "github-actions[bot]"
145
+ git checkout -B ${{ github.ref_name }} ${{ github.sha }}
146
+ - uses: actions/download-artifact@v4
147
+ with:
148
+ # unpacks all CIBW artifacts into dist/
149
+ pattern: cibw-*
150
+ path: dist
151
+ merge-multiple: true
152
+ - name: Setup up Python
153
+ uses: actions/setup-python@v6
154
+ with:
155
+ python-version: '3.14'
156
+ - name: Install build dependencies
157
+ run: |
158
+ python -m pip install --upgrade pip
159
+ pip install build wheel python-semantic-release
160
+ - name: Create release
161
+ id: release
162
+ run: |
163
+ git config --global --add safe.directory $(realpath .)
164
+ semantic-release version --skip-build
165
+ env:
166
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167
+ - name: Publish package to TestPyPI
168
+ uses: pypa/gh-action-pypi-publish@release/v1
169
+ if: steps.release.outputs.released == 'true'
170
+ with:
171
+ repository-url: https://test.pypi.org/legacy/
172
+ user: __token__
173
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
174
+ - name: Test install from TestPyPI
175
+ run: |
176
+ python -m pip install --upgrade pip setuptools wheel build && \
177
+ python -m pip install torch==2.10.0 && \
178
+ python -m pip install --no-build-isolation --no-binary=torch-scatter torch-scatter -f https://data.pyg.org/whl/torch-2.10.0+cpu.html && \
179
+ python -m pip install --no-build-isolation --no-binary=torch-cluster torch-cluster -f https://data.pyg.org/whl/torch-2.10.0+cpu.html && \
180
+ python -m pip install \
181
+ --index-url https://test.pypi.org/simple/ \
182
+ --extra-index-url https://pypi.org/simple \
183
+ pointtree
184
+ - name: Publish to PyPI
185
+ uses: pypa/gh-action-pypi-publish@release/v1
186
+ if: steps.release.outputs.released == 'true'
187
+ with:
188
+ user: __token__
189
+ password: ${{ secrets.PYPI_API_TOKEN }}