-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
281 lines (245 loc) · 10.3 KB
/
Copy pathpyproject.toml
File metadata and controls
281 lines (245 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
[project]
name = "splax"
dynamic = ["version"]
description = "High-performance vectorized gaussian splatting rendering in JAX"
authors = [{ name = "Martin Schuck" }]
readme = "README.md"
license = "MIT"
license-files = ["LICENSE", "licenses/*"]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
]
requires-python = ">=3.11"
dependencies = [
"jax[cuda]>=0.10",
"imageio",
"plyfile",
"warp-lang>=1.14.0",
]
[project.optional-dependencies]
viewer = ["viser>=1.0"]
# pycolmap loads a sparse reconstruction for the training toolkit. torch stays below 2.11 because
# newer versions target CUDA 13, while jax and the nvcc that compiles gsplat run on CUDA 12.8.
tests = ["splax[viewer]", "pytest", "pytest-markdown-docs", "torch>=2.8,<2.11", "gsplat>=1.5", "optax>=0.2.8", "dm-pix>=0.4.5", "pycolmap>=4.1", "matplotlib"]
[project.urls]
Homepage = "https://github.com/learnsyslab/splax"
Repository = "https://github.com/learnsyslab/splax"
[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages]
find = {include = ["splax*"]}
# PEP 561 marker, so type checkers use the inline annotations of the installed package.
[tool.setuptools.package-data]
splax = ["py.typed"]
[tool.setuptools.dynamic]
version = {attr = "splax.__version__"}
[tool.pytest.ini_options]
pythonpath = ["scripts", "tests"]
# unit/ and integration/ hold same-named modules, which collide under the default prepend mode
addopts = "--import-mode=importlib"
markers = [
"unit: test of a single function. Applied automatically to everything under tests/unit",
"integration: test of several components. Applied automatically to tests/integration",
"gsplat: test needs the gsplat CUDA reference",
"colmap: test needs pycolmap and the COLMAP training toolkit under scripts/",
]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = [
{ name = "linux-64", platform = "linux-64" },
{ name = "linux-64-cuda", platform = "linux-64", cuda = "12.9" },
]
[tool.pixi.dependencies]
pip = "*"
ruff = "*"
[tool.pixi.feature.cuda]
platforms = ["linux-64-cuda"]
[tool.pixi.pypi-dependencies]
splax = { path = "./", editable = true, extras = ["viewer"] }
# The training scripts need an optimizer, SSIM, and a COLMAP scene loader. The library does not.
optax = ">=0.2.8"
pycolmap = ">=4.1"
dm-pix = ">=0.4.5"
[tool.pixi.feature.docs.dependencies]
python = ">=3.11"
properdocs = ">=1.5.0"
mkdocs-material = ">=9.5.0"
[tool.pixi.feature.docs]
platforms = ["linux-64", "linux-64-cuda"]
[tool.pixi.feature.docs.pypi-dependencies]
mkdocstrings = { extras = ["python"], version = ">=0.26.0" }
mkdocs-gen-files = ">=0.5.0"
mkdocs-literate-nav = ">=0.6.0"
mkdocs-section-index = ">=0.3.0"
mkdocs-autorefs = ">=1.2.0"
[tool.pixi.feature.docs.tasks]
docs-build = { cmd = "properdocs build --strict", description = "Build the documentation" }
docs-serve = { cmd = "properdocs serve --livereload", description = "Serve the documentation locally" }
# COLMAP feature: SfM preprocessing tools in a dedicated environment.
#
# The CasPAR GPU bundle adjustment backend is experimental in colmap 4.1 and disabled in every
# official binary. The only way to get it is to compile colmap with -DCASPAR_ENABLED=ON. This
# environment therefore carries the build toolchain and colmap's host dependencies, and the
# colmap-build task compiles colmap 4.1.0 from source into the environment prefix. The pipeline
# tasks depend on colmap-build, which exits immediately while the binary exists and rebuilds
# automatically when the environment was recreated. To force a rebuild, delete
# .pixi/envs/colmap/bin/colmap.
[tool.pixi.feature.colmap.dependencies]
python = ">=3.11"
# Build toolchain
c-compiler = "*"
cxx-compiler = "*"
cuda-nvcc = "12.9.*"
cuda-cudart-dev = "12.9.*"
cuda-version = "12.9.*"
libcurand-dev = "*"
# Runtime CUDA libs for the onnxruntime-gpu execution provider (ALIKED/LightGlue).
libcufft = "*"
libcublas = "*"
cudnn = "*"
cmake = "*"
ninja = "*"
pkg-config = "*"
git = "*"
# colmap host dependencies
libgl-devel = "*"
libopengl-devel = "*"
libglu = "*"
glew = "*"
libblas = "*"
libcblas = "*"
libboost-devel = "*"
suitesparse = "*"
eigen = "*"
eigen-abi-devel = "*"
freeimage = "*"
glog = "*"
gflags = "*"
ceres-solver = "*"
flann = "*"
sqlite = "*"
vlfeat = "*"
lz4-c = "*"
metis = "*"
openimageio = "*"
fmt = "*"
poselib = "*"
# openblas variant: the mkl variant links MKL 2025 sonames (.so.2) which conflict with the
# current conda-forge mkl 2026 (.so.3).
libfaiss = { version = "*", build = "cuda*openblas*" }
libgomp = "*"
[tool.pixi.feature.colmap]
platforms = ["linux-64-cuda"]
[tool.pixi.feature.colmap.tasks]
colmap-build = { cmd = "bash -lc 'set -euo pipefail; if [ -x \"$CONDA_PREFIX/bin/colmap\" ]; then echo \"colmap already installed, skipping build (delete $CONDA_PREFIX/bin/colmap to force a rebuild)\"; exit 0; fi; src=.pixi-src/colmap; if [ ! -d \"$src\" ]; then git clone --depth 1 --branch 4.1.0 https://github.com/colmap/colmap.git \"$src\"; fi; cmake -S \"$src\" -B \"$src/build\" -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"$CONDA_PREFIX\" -DCUDA_ENABLED=ON -DCASPAR_ENABLED=ON -DCMAKE_CUDA_ARCHITECTURES=native -DGUI_ENABLED=OFF -DOPENGL_ENABLED=OFF -DCGAL_ENABLED=OFF -DLSD_ENABLED=OFF -DONNX_ENABLED=ON -DFETCH_ONNX=ON -DFETCH_FAISS=OFF -DFETCH_POSELIB=OFF; cmake --build \"$src/build\" --target install'", description = "Compile colmap 4.1.0 with CasPAR from source into the pixi environment (skipped if already installed)" }
colmap-features = { cmd = "bash -lc 'set -euo pipefail; d=\"$1\"; cd \"$d\"; colmap feature_extractor --database_path ./database.db --image_path ./images --ImageReader.single_camera 1 --ImageReader.camera_model SIMPLE_RADIAL' --", depends-on = ["colmap-build"], description = "Run COLMAP feature extraction in a scene folder" }
colmap-match = { cmd = "bash -lc 'set -euo pipefail; d=\"$1\"; cd \"$d\"; colmap sequential_matcher --database_path ./database.db' --", depends-on = ["colmap-build"], description = "Run COLMAP sequential matching in a scene folder" }
colmap-map = { cmd = "bash -lc 'set -euo pipefail; d=\"$1\"; cd \"$d\"; mkdir -p ./sparse; colmap mapper --database_path ./database.db --image_path ./images --output_path ./sparse --Mapper.ba_local_backend CASPAR --Mapper.ba_global_backend CASPAR' --", depends-on = ["colmap-build"], description = "Run COLMAP mapper in a scene folder" }
# Tests feature: the pypi test dependencies come from the "tests" extra, which pixi
# merges into this feature by name. gsplat JIT-compiles its CUDA extension on first
# use, so the environment carries the matching CUDA 12.8 compiler and headers
# (torch 2.8-2.10 on PyPI is built for cu128). Everything stays inside the pixi env.
[tool.pixi.feature.tests.dependencies]
python = ">=3.11"
pytest = "*"
cuda-nvcc = "12.8.*"
cuda-cudart-dev = "12.8.*"
cuda-cccl = "12.8.*"
matplotlib = "*"
[tool.pixi.feature.tests]
platforms = ["linux-64-cuda"]
[tool.pixi.feature.tests.activation.env]
# gsplat's JIT build needs an explicit arch. torch 2.10 defaults include arches
TORCH_CUDA_ARCH_LIST = "8.9;12.0"
# conda-forge keeps the CUDA headers under targets/, torch's extension builder
# expects them on the host compiler search path.
CPATH = "$CONDA_PREFIX/targets/x86_64-linux/include"
# Required for scipy.spatial.transform's Rotation / RigidTransform to work with JAX
SCIPY_ARRAY_API = "1"
[tool.pixi.feature.tests.tasks]
tests = { cmd = "pytest -v tests", description = "Run tests" }
test-docs = { cmd = "pytest -v --markdown-docs --markdown-docs-syntax=superfences splax/ docs/ --ignore=docs/gen_ref_pages.py", description = "Run the code blocks in the docs and docstrings" }
# Lint feature: ty type checking of the library.
[tool.pixi.feature.lint.pypi-dependencies]
ty = "==0.0.56"
[tool.pixi.feature.lint.tasks]
ty = { cmd = "ty check splax", description = "Type check the library" }
ruff-check = { cmd = "ruff check splax scripts tests", description = "Check formatting and linting" }
ruff-format-check = { cmd = "ruff format --check --diff .", description = "Check code formatting" }
# Dist feature: build the wheel/sdist and publish.
[tool.pixi.feature.dist.pypi-dependencies]
build = "*"
twine = "*"
[tool.pixi.feature.dist.tasks]
build = { cmd = "python -m build && twine check dist/*", description = "Build the sdist and wheel" }
upload_test = { cmd = "twine upload --repository testpypi dist/*", description = "Upload to TestPyPI" }
upload = { cmd = "twine upload dist/*", description = "Upload to PyPI" }
[tool.pixi.environments]
default = { features = ["cuda"], solve-group = "default" }
docs = { features = ["docs"], solve-group = "docs" }
colmap = { features = ["colmap"], solve-group = "colmap" }
tests = { features = ["cuda", "tests"], solve-group = "tests" }
lint = { features = ["lint"], solve-group = "lint" }
dist = { features = ["cuda", "dist"], solve-group = "dist" }
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".git-rewrite",
".ipynb_checkpoints",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".venv",
".vscode",
"__pypackages__",
"_build",
"build",
"dist",
"site-packages",
"venv",
"docs/conf.py",
]
line-length = 100
indent-width = 4
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "D", "TCH", "ANN"]
ignore = ["ANN401"]
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.isort] # Prevent ruff from reporting conflicting settings with isort
split-on-trailing-comma = false
[tool.ruff.lint.per-file-ignores]
"benchmark/*" = ["D100", "D103"]
"tests/*" = ["D100", "D103", "D104"]
"examples/*" = ["D100", "D103"]
"tutorials/*" = ["D", "ANN"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.flake8-annotations]
suppress-dummy-args = true
suppress-none-returning = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = true
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
[tool.ty.src]
# The Warp-DSL kernel modules are excluded. Their kernel bodies are written in warp's kernel
# language, which warp's type stubs cannot type.
exclude = [
"splax/_intersect.py",
"splax/_project/_kernels.py",
"splax/_rasterize/_kernels.py",
"splax/_rasterize/_sort/_kernels.py",
]