Skip to content

Commit a52175a

Browse files
committed
[ci skip] clearer readme
1 parent bc2cb76 commit a52175a

1 file changed

Lines changed: 35 additions & 11 deletions

File tree

README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
[![PyPI version](https://badge.fury.io/py/libigl.svg)](https://pypi.org/project/libigl/)
33
[![buildwheels](https://github.com/libigl/libigl-python-bindings/actions/workflows/wheels.yml/badge.svg)](https://github.com/libigl/libigl-python-bindings/actions/workflows/wheels.yml?query=branch%3Amain)
44

5-
6-
This repository contains the source code for the libigl Python bindings. These bindings are fully compatible with NumPy and SciPy and offer a convenient interface similar to functions in those libraries.
7-
8-
These bindings are still under active development and should still be considered alpha quality. We encourage users to post issues so we can improve the bindings!
5+
This repository contains the source code for the libigl Python bindings written
6+
using [nanobind](https://nanobind.readthedocs.io/en/latest/). Functions allow
7+
NumPy arrays as input and output for dense matrices and vectors and SciPy sparse
8+
matrices for sparse matrices.
99

1010
## Installation
1111

1212
```
1313
python -m pip install libigl
1414
```
1515

16-
If you wish to install the current development code, you can compile the library from scratch. Clone this repo and issue
17-
18-
```
19-
python -m pip install ./
20-
```
21-
22-
2316
## [Help/Documentation](https://libigl.github.io/libigl-python-bindings/)
2417

18+
| :warning: WARNING |
19+
|:----------------------------|
20+
| This documentation is perennially out of date and will likely be removed/changed. |
21+
2522
* A tutorial on how to use the bindings can be found [here](https://libigl.github.io/libigl-python-bindings/tutorials/)
2623
* A function reference can be found [here](https://libigl.github.io/libigl-python-bindings/igl_docs/)
2724

@@ -50,9 +47,36 @@ According to the [scikit-build-core documentation](https://scikit-build-core.rea
5047
python -m pip install --no-build-isolation --config-settings=editable.rebuild=true -Cbuild-dir=build -ve.
5148
```
5249

50+
### Adding a missing binding
51+
52+
Bindings are fairly mechanical to write. For example, suppose we didn't have a
53+
binding for the c++ function `igl::moments`. The first step would be to look at
54+
the corresponding `.h` header file in the C++ libigl library:
55+
[moments.h](https://github.com/libigl/libigl/blob/main/include/igl/moments.h).
56+
57+
Then we would create the [src/moments.cpp](src/moments.cpp) file in this project
58+
which uses `Eigen::MatrixXN` for numeric types and `Eigen::MatrixXI` for integer
59+
types. Typically this requires a simple wrapper around the function matching
60+
its signature to these types and some boilerplate `void bind_moments(...` code which adds the function to the python module.
61+
62+
Simply adding this `.cpp` file will be enough to add the bindings on the next
63+
build.
64+
65+
If submitting a pull request with a new binding, please also add an execution
66+
test in `tests/test_all.py` to ensure the binding can at least be called as
67+
expected.
68+
69+
5370
## Testing cibuildwheel locally
5471

5572
Install whichever version of Python from the [official website](https://www.python.org/downloads/) and then run:
5673

5774
/Library/Frameworks/Python.framework/Versions/[version]/bin/python -m pip install cibuildwheel
5875
CIBW_BUILD="cp311-*" python -m cibuildwheel --output-dir wheelhouse --platform macos
76+
77+
## Acknowledgements
78+
79+
The original python bindings were generated and maintained by @teseoch,
80+
@KarlLeell, @fwilliams, @skoch9, @danielepanozzo.
81+
82+
The modern python bindings (since 2.5.4.dev0) can largely be blamed on @alecjacobson.

0 commit comments

Comments
 (0)