generated from cubao/cmake_example
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/fix ci, export LineSegment, release 0.1.0 (#4)
* trigger wheels * update pip, install numpy * fix pyproject.toml; export LineSegment * disable all pp * change version * ready to PR * fix tests Co-authored-by: TANG ZHIXIONG <[email protected]>
1 parent
1fb6eea
commit 79a1640
Showing
8 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,8 @@ jobs: | |
- uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: auto universal2 | ||
# https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip | ||
CIBW_SKIP: pp* | ||
|
||
- name: Verify clean directory | ||
run: git diff --exit-code | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package: | ||
name: pybind11_rdp | ||
version: 0.0.2 | ||
version: 0.1.0 | ||
|
||
source: | ||
path: .. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ def build_extension(self, ext): | |
# logic and declaration, and simpler if you include description/version in a file. | ||
setup( | ||
name="pybind11_rdp", | ||
version="0.0.2", | ||
version="0.1.0", | ||
author="tzx", | ||
author_email="[email protected]", | ||
url="https://github.com/cubao/pybind11-rdp", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
import pybind11_rdp as m | ||
from pybind11_rdp import LineSegment, rdp | ||
|
||
|
||
def test_main(): | ||
assert m.rdp([[1, 1], [2, 2], [3, 3], [4, 4]]).shape == (2, 2) | ||
def test_segment(): | ||
seg = LineSegment([0, 0, 0], [10, 0, 0]) | ||
assert 4.0 == seg.distance([5.0, 4.0, 0.0]) | ||
assert 5.0 == seg.distance([-4.0, 3.0, 0.0]) | ||
assert 5.0 == seg.distance([14.0, 3.0, 0.0]) | ||
seg = LineSegment([0, 0, 0], [0, 0, 0]) | ||
assert 5.0 == seg.distance([3.0, 4.0, 0.0]) | ||
assert 5.0 == seg.distance([-4.0, 3.0, 0.0]) | ||
assert 13.0 == seg.distance([5.0, 12.0, 0.0]) | ||
|
||
|
||
def test_rdp(): | ||
assert rdp([[1, 1], [2, 2], [3, 3], [4, 4]], epsilon=1e-9).shape == (2, 2) | ||
assert rdp([[0, 0], [5, 1 + 1e-3], [10, 0]], epsilon=1).shape == (3, 2) | ||
assert rdp([[0, 0], [5, 1 - 1e-3], [10, 0]], epsilon=1).shape == (2, 2) |