Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 2.5 KB

installation.md

File metadata and controls

68 lines (49 loc) · 2.5 KB

Installation

Python 3.10 or newer is required. Use a Python environment with compatible PyTorch and compiled extension builds.

Required dependencies

The package requires NumPy, SciPy, PyTorch, and torch-scatter.

  1. Install the PyTorch build for your Python version and CPU/CUDA environment using the official PyTorch instructions.
  2. Install a matching torch-scatter build using the PyG extension installation guide. Match the extension wheel to your PyTorch and CPU/CUDA build, including when running a CUDA-enabled PyTorch installation on the CPU.
  3. From the project root, install this package:
python -m pip install .

The import name is torch_fea_mesh; the distribution name is torch-fea-mesh.

Optional features

Extra Purpose Installation
vtk VTK I/O, VTK-based processing, and isotropic remeshing python -m pip install '.[vtk]'
chamfer Chamfer distance with PyTorch Geometric and its KNN backend python -m pip install '.[chamfer]'
dev pytest, build tools, and distribution checks python -m pip install -e '.[dev]'

For chamfer, install a matching pyg-lib build using the PyG extension guide before installing the extra. This extra requires PyTorch Geometric 2.8 or newer and pyg-lib 0.6 or newer.

VTK is optional for core mesh operations. Importing the isotropic remesher requires VTK.

Development setup

After installing matching torch-scatter and pyg-lib builds, install all test dependencies in editable mode:

python -m pip install -e '.[dev,vtk,chamfer]'
python -m pytest test/ -v

CUDA tests also require an accessible CUDA device. See testing for partial runs and optional dependency skips.

Build a distribution

With the dev extra installed:

python -m build
python -m twine check dist/*

The wheel contains the library. The source distribution also contains tests, examples, documentation, and data/data_record.json. Dataset files and generated outputs under data/ are excluded from both. Obtain shared inputs separately to run the tests that use them; see the testing guide.

To check an installed wheel, use a separate environment with matching numerical dependencies and run from outside the project directory. This ensures the source folder cannot shadow the installed package; see wheel validation.