Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSF 3DFin #1

Merged
merged 10 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]
os: [ubuntu-22.04, windows-2022, macOS-12]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.2
run: python -m pip install cibuildwheel==2.16.5

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
Expand All @@ -40,9 +40,9 @@ jobs:
#Only publish to PyPI when a commit is tagged
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5

- uses: actions/download-artifact@v3
with:
Expand All @@ -55,7 +55,8 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# construct the source package and upload src and wheels to PiPy
run: |
python -m pip install twine
python setup.py sdist
python -m pip install --upgrade pip
python -m pip install twine build
python -m build --sdist
twine upload dist/*
twine upload wheelhouse/*.whl
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ W. Zhang, J. Qi*, P. Wan, H. Wang, D. Xie, X. Wang, and G. Yan, “An Easy-to-Us
(http://www.mdpi.com/2072-4292/8/6/501/htm)


**This is a modified version of the Original Code for 3DFin purposes**

List of changes:

- Better handling of numpy arrays in the python bindings (avoid expensive copies)


**New feature has been implemented:**

Now, We has wrapped a Python interface for CSF with swig. It is simpler to use now. This new feature can make CSF easier to be embeded into a large project. For example, it can work with Laspy (https://github.com/laspy/laspy). What you do is just read a point cloud into a python 2D list, and pass it to CSF.
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["wheel","setuptools", "oldest-supported-numpy"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
build = "cp3{9,10,11,12}-*"
6 changes: 6 additions & 0 deletions python/CSF/CSF.i
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

%include "std_string.i"
%include "std_vector.i"
%include "numpy.i"

%init %{
import_array();
%}

namespace std
{
Expand All @@ -16,4 +21,5 @@ namespace std
%template(VecDouble) vector<double>;
}

%apply (double* IN_ARRAY2, int DIM1, int DIM2) {(double *points, int rows, int cols)};
%include "../src/CSF.h"
Loading
Loading