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

Private method for SDF internals #34

Closed
wants to merge 10 commits into from
Closed
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
193 changes: 96 additions & 97 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,106 +1,105 @@
on: [push, pull_request]

defaults:
run:
shell: bash
run:
shell: bash

jobs:
lint-rust:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: make lint-rust

lint-rust:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: make lint-rust
lint-python:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- run: pip install $(grep -E '^(black|ruff|mypy|numpy)' requirements.txt)
- run: make lint-python

lint-python:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: pip install $(grep -E '^(black|ruff|mypy|numpy)' requirements.txt)
- run: make lint-python
test-rust:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- run: cargo test

test-rust:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- run: cargo test
test-python:
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: |
sudo apt-get install libspatialindex-dev
pip install -U pip wheel
pip install -r requirements.txt
name: Install dependencies
- run: |
mkdir -p $TGT_DIR
rm -f $TGT_DIR/*.whl
maturin build --release --interpreter python --out $TGT_DIR
pip install $TGT_DIR/*.whl
name: Install package
env:
TGT_DIR: "target/wheels/${{ matrix.python-version }}"
- run: pytest --verbose

test-python:
strategy:
fail-fast: false
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: |
sudo apt-get install libspatialindex-dev
pip install -U pip wheel
pip install -r requirements.txt
name: Install dependencies
- run: |
mkdir -p $TGT_DIR
rm -f $TGT_DIR/*.whl
maturin build --release --interpreter python --out $TGT_DIR
pip install $TGT_DIR/*.whl
name: Install package
env:
TGT_DIR: "target/wheels/${{ matrix.python-version }}"
- run: pytest --verbose

deploy:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-20.04]
needs: [lint-rust, lint-python, test-rust, test-python]
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: publish
args: -u __token__ -p ${{ secrets.MATURIN_PASSWORD }} --skip-existing --universal2
name: Deploy wheels
deploy:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-20.04]
needs: [lint-rust, lint-python, test-rust, test-python]
runs-on: ${{ matrix.os }}
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: publish
args: -u __token__ -p ${{ secrets.MATURIN_PASSWORD }} --skip-existing --universal2
name: Deploy wheels
38 changes: 19 additions & 19 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
version: 2

sphinx:
builder: html
builder: html

build:
os: "ubuntu-22.04"
tools:
python: "3.9"
apt_packages:
- curl
- build-essential
- gcc
- make
jobs:
pre_create_environment:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
pre_install:
- /bin/bash scripts/cargo_hack.sh

os: "ubuntu-22.04"
tools:
python: "3.9"
rust: "1.70"
# apt_packages:
# - curl
# - build-essential
# - gcc
# - make
# jobs:
# pre_create_environment:
# - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# pre_install:
# - /bin/bash scripts/cargo_hack.sh

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
install:
- requirements: docs/requirements.txt
- method: pip
path: .
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Sphinx==6.1.3
Sphinx==7.2.6
sphinx-rtd-theme
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "ncollpyde"
# version = "0.19.0"
description = "Point/line-mesh intersection queries in python"
readme = "README.rst"
requires-python = ">=3.8"
requires-python = ">=3.9,<4"
license = {file = "LICENSE"}
authors = [
{name = "Chris L. Barnes", email = "[email protected]"},
Expand All @@ -15,10 +15,10 @@ classifiers = [
"Natural Language :: English",
"Programming Language :: Rust",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

dependencies = [
Expand All @@ -34,7 +34,7 @@ documentation = "https://ncollpyde.readthedocs.io/"
repository = "https://github.com/clbarnes/ncollpyde/"

[build-system]
requires = ["maturin==0.14", "numpy>=1.21"]
requires = ["maturin>=1.4", "numpy>=1.21"]
build-backend = "maturin"

[tool.maturin]
Expand Down
3 changes: 3 additions & 0 deletions python/ncollpyde/_ncollpyde.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ class TriMeshWrapper:
def intersections_many_threaded(
self, src_points: Points, tgt_points: Points
) -> Tuple[List[int], Points, List[bool]]: ...
def sdf_intersections(
self, points: Points, vectors: Points, threaded: bool
) -> Tuple[npt.NDArray[np.float_], npt.NDArray[np.float_]]: ...
Loading
Loading