Skip to content

Commit 3a72591

Browse files
authored
Refactor python package: unify f32/f64 implementations & zero copy views where possible (#229)
* Remove local lockfile * Py: Fix local build on macOS * Py: WIP: Combine f32 & f64 pipeline and mesh types * Py: Fix cast of usize for Numpy arrays on 32 bit architectures * Py: WIP: Further mesh refactoring * Py: Simplify code * Automatically set global neighborhood lists in pipeline * Py: Fixes in pipeline * Make zero constructor of UniformGrid public for Python API * Py: Implement generic reconstruct surf., remove old pipeline functions * Py: Implement check_mesh_consistency, remove old code * Py: Clean up * Py: Refactor * Rename argument * Py: Re-Implement tris_to_quads * Py: Update decimation * Py: Reimplement smoothing functions * Use slices for normal smoothing * Py: Refactor * WIP: Signed Index type * Py: Use views for mesh vertices & triangles * Implement normals * Py: Refactor MeshWithData wrapper * Py: Get triangle and quad cells from mixed mesh * Py: Refactor, fix MeshWithData constructor * Py: WIP: Mesh attributes * Py: Getter for data of mesh attributes * Py: Add basic AABB, update neighborhood search * Py: Remove old code * Py: Access methods for neighborhood lists * Add method to interpolator * Py: Update SphInterpolator * Make fields of SurfaceReconstruction public, refactor pipeline return * Py: Refactoring * Py: Fix re-shaping in interpolator * Py: Reimplement reconstruction wrapper without copies * Py: Update pyo3 crates, bump minimum Python version to 3.10 * Py: Update AABB * Py: Update write_to_file and attribute getters (return dicts) * Py: Add annotations import to stub file * Py: Update doc strings * Py: Update sphinx templates and doc strings * Py: Update documentation * Py: Move mesh writing to rust code * Py: Add attributes to MeshWithData * Py: Mesh copy and Mesh to MeshWithData constructor * Py: Fix tests, fix bugs * Py: Fix CI stub gen * Py: Fix splashsurf path in CI * CI: Only publish on main * Py: Fix build.rs on CI * Py: Documentation fixes * Update changelog * Py: Documentation fixes * Update changelog * Py: Refactor * Py: Refactor tests * Py: Methods for UniformGrid, add tests for many functions * Add missing test data * Py: Add plain marching cubes functionality * Support borrowed data for DensityMap * Update comment * Update changelog
1 parent 9d34fb9 commit 3a72591

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3311
-5099
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
publish:
8787
name: Publish to crates.io
8888
runs-on: ubuntu-latest
89-
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}
89+
if: ${{ (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }}
9090
needs: [check_format, build_workspace, build_lib_all_features, build_lib_no_default_features]
9191
steps:
9292
- uses: actions/checkout@v4

.github/workflows/pysplashsurf_CI.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@v3
3030
- uses: moonrepo/setup-rust@v1
3131
- run: |
32-
cargo run --bin stub_gen
32+
cargo run --bin stub_gen --no-default-features
3333
working-directory: pysplashsurf
3434
- name: Upload stub as artifact
3535
uses: actions/upload-artifact@v4
@@ -316,7 +316,7 @@ jobs:
316316
publish:
317317
name: Publish to PyPI
318318
runs-on: ubuntu-latest
319-
if: ${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}
319+
if: ${{ (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }}
320320
needs: [linux_wheels, macos_wheels, windows_wheels, sdist, tests, docs]
321321
steps:
322322
- uses: actions/download-artifact@v4
@@ -426,7 +426,7 @@ jobs:
426426
path: dist/
427427
- run: pip install dist/${{ needs.build_wheel_dev.outputs.filename }}
428428
- name: Install splashsurf CLI
429-
run: cargo install splashsurf
429+
run: cargo install splashsurf --path ./splashsurf
430430
- name: Run pytest
431431
uses: pavelzw/pytest-action@v2
432432
with:

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22

33
The following changes are present in the `main` branch of the repository and are not yet part of a release:
44

5-
- N/A
5+
- Py: Major refactor of the Python bindings, interface is simplified and more "pythonic"
6+
- Merged distinct F64/F32 classes and functions and infer data type automatically
7+
- Nearly all inputs and outputs are now zero-copy (e.g. mesh vertices and faces can be accessed as attributes without copies)
8+
- Py: Add a function for a plain marching cubes reconstruction without any SPH interpolation
9+
- Lib: Add support for "dense" density maps (borrowed & owned) as input for the marching cubes triangulation, useful for the Python bindings
10+
- Lib: Enforce that `Index` types are signed integers implementing the `num_traits::Signed` trait. Currently, the reconstruction does not work (correctly) with unsigned integers.
11+
- Lib: Make most fields of `SurfaceReconstruction` public
12+
- CLI: Add some tests for the `reconstruction_pipeline` function
13+
- CLI: Fix post-processing when particle AABB filtering is enabled
14+
- Lib: Support subdomain "ghost particle" margins to be up to the size of the subdomain itself (previously limited to half the size)
15+
- CLI/Lib: Option to automatically disable subdomain decomposition for very small grids
16+
- Lib: Support for non-owned data in `MeshAttribute`, avoids copies in CLI and Python package
617

718
## Version 0.12.0
819

Cargo.lock

Lines changed: 50 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)