Python port of mapbox/wagyu library.
Project description
wagyu
In what follows python
is an alias
for python3.5
or pypy3.5
or any later version
(python3.6
, pypy3.6
and so on).
Installation
Install the latest pip
& setuptools
packages versions:
python -m pip install --upgrade pip setuptools
User
Download and install the latest stable version from PyPI
repository:
python -m pip install --upgrade wagyu
Developer
Download the latest version from GitHub
repository
git clone https://github.com/lycantropos/wagyu.git
cd wagyu
Install setup dependencies:
python -m pip install --force-reinstall -r requirements-setup.txt
Install:
python setup.py install
Usage
>>> from wagyu.enums import PolygonKind
>>> from wagyu.linear_ring import LinearRing
>>> from wagyu.point import Point
>>> from wagyu.polygon import Multipolygon, Polygon
>>> from wagyu.wagyu import Wagyu
>>> lower_triangle = Polygon([LinearRing([Point(0, 0), Point(6, 0), Point(3, 3), Point(0, 0)])])
>>> upper_triangle = Polygon([LinearRing([Point(3, 1), Point(6, 4), Point(0, 4), Point(3, 1)])])
>>> wagyu = Wagyu()
>>> wagyu.add_polygon(lower_triangle, PolygonKind.SUBJECT)
True
>>> wagyu.add_polygon(upper_triangle, PolygonKind.CLIP)
True
>>> (wagyu.intersect()
... == Multipolygon([Polygon([LinearRing([Point(3, 1), Point(4, 2), Point(3, 3), Point(2, 2), Point(3, 1)])])]))
True
>>> (wagyu.unite()
... == Multipolygon([Polygon([LinearRing([Point(6, 0), Point(4, 2), Point(6, 4), Point(0, 4), Point(2, 2), Point(0, 0), Point(6, 0)])])]))
True
>>> (wagyu.symmetric_subtract()
... == Multipolygon([Polygon([LinearRing([Point(4, 2), Point(3, 1), Point(2, 2), Point(0, 0), Point(6, 0), Point(4, 2)])]),
... Polygon([LinearRing([Point(4, 2), Point(6, 4), Point(0, 4), Point(2, 2), Point(3, 3), Point(4, 2)])])]))
True
>>> (wagyu.subtract()
... == Multipolygon([Polygon([LinearRing([Point(6, 0), Point(4, 2), Point(3, 1), Point(2, 2), Point(0, 0), Point(6, 0)])])]))
True
for CPython
original C++ implementation can be invoked by importing from _wagyu
module instead.
Development
Bumping version
Preparation
Install bump2version.
Pre-release
Choose which version number category to bump following semver specification.
Test bumping version
bump2version --dry-run --verbose $CATEGORY
where $CATEGORY
is the target version number category name, possible
values are patch
/minor
/major
.
Bump version
bump2version --verbose $CATEGORY
This will set version to major.minor.patch-alpha
.
Release
Test bumping version
bump2version --dry-run --verbose release
Bump version
bump2version --verbose release
This will set version to major.minor.patch
.
Running tests
Install dependencies:
python -m pip install --force-reinstall -r requirements-tests.txt
Plain
pytest
Inside Docker
container:
- with
CPython
docker-compose --file docker-compose.cpython.yml up
- with
PyPy
docker-compose --file docker-compose.pypy.yml up
Bash
script (e.g. can be used in Git
hooks):
-
with
CPython
./run-tests.sh
or
./run-tests.sh cpython
-
with
PyPy
./run-tests.sh pypy
PowerShell
script (e.g. can be used in Git
hooks):
- with
CPython
.\run-tests.ps1
or.\run-tests.ps1 cpython
- with
PyPy
.\run-tests.ps1 pypy
Project details
None NoneRelease history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for wagyu-0.2.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b3ae589d85fbd908e1c2e59ad825c01b1cdc795e1f0c1cef0457c3ebcdc4b9a |
|
MD5 | 0cb5916e2c23ae9d291387ed870ff08b |
|
BLAKE2b-256 | 02689e0cc6278a6f759a6eaaf57f2837172b66b5676c107957571c798c6de2f4 |
Hashes for wagyu-0.2.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7257568f26db0e2773d7d295beec1578c8cb2a3aa2922d3f38df96f783e67703 |
|
MD5 | 2adf22e76b51ca748bc4b99372b17c58 |
|
BLAKE2b-256 | 2586c60a3a2c46d5d75c1ce0d39770a2255eeed9005c0f1fa99b6dddfae10e21 |
Hashes for wagyu-0.2.2-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 480765c7075ad7a102f632784231ede9d2e2f0698ac5dc62d4ed63aa0e14c350 |
|
MD5 | 81c7e6b3fb8f6ed3111a4a806af6bf84 |
|
BLAKE2b-256 | d67f81add943028a424e436df9c45c60955a2a77c7c5abc9d9bca75c00039294 |
Hashes for wagyu-0.2.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65016dc31f8a99e799f2308d8eb19e9b95a3ce140734217767c62babddd3dac9 |
|
MD5 | 5535fcee4dc590de22b35433bb8082fd |
|
BLAKE2b-256 | c20b60d2d5b0086d87382178ee7f96c219d43db573d4ecc8599deeae75abbc1e |
Hashes for wagyu-0.2.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdb0a44affc6f9fca41baf5ab3f065cf013776c75013493de808128198c55692 |
|
MD5 | 6c6aac6f2a40d9dd12bd4a1eca3a6e6f |
|
BLAKE2b-256 | a236ea71d463994cdf1e1d6eec1e174adc53aa9488abd7eebfca56162abff719 |
Hashes for wagyu-0.2.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cefaa1214698fc67bc2695a596db611d30af757d73b3938d17b6e5163116cfc |
|
MD5 | 0d0d8c316f80b1433d41864ecc1e9aec |
|
BLAKE2b-256 | caf9057d587a61c6b07bc418f725cc2abe745e8af07f6b546c36a74102ee00dc |
Hashes for wagyu-0.2.2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3f36273293aa2dbef84d9d36b75a1ea9d85250e865e60eb27aefeffc152747c |
|
MD5 | 9244b813b33af6fa2842bf4e199a05ce |
|
BLAKE2b-256 | e9a82f46b8e04c52d4c9e36e3105fb5eeb13157dd810d260eb305b76ab9c1e7d |
Hashes for wagyu-0.2.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a42e51437e252fcb414ea8f393c236b4296c5c02624114e0be94a36852615f7 |
|
MD5 | eb320e4075398fb9df080d7846bd628e |
|
BLAKE2b-256 | ca99cce544ff2bd32042e65f73b3a1b2f063155126c6124009c41a9589de4b57 |
Hashes for wagyu-0.2.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d7187f9b4be7fa98ca0b85f9a8c97840422ea0cd5921a6e5d3900efbfdeeaa |
|
MD5 | b7334053e693d25d1f36ea6ea9ae29c4 |
|
BLAKE2b-256 | a48243bf1813944b4eebb6ef953e2a44fd077f9367ccb2ad9f8eed1f2e32193b |
Hashes for wagyu-0.2.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2557a9800bb51ab13ad9c55e4f4b15aabb15d10b4140d3490ec72952cdac62b6 |
|
MD5 | ac63c6d68d0a479e406b15889190f510 |
|
BLAKE2b-256 | 2a989333f4846b008e65268e0394ab4688adb28d9dd3c783f4f2d3a54f202789 |
Hashes for wagyu-0.2.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59ec44eb92c9ccc141b0ad8920c44bd434e9f898dfb9b9b44e701022417b5b96 |
|
MD5 | b8c2d5679e58468f178d27c168c34c85 |
|
BLAKE2b-256 | 831f355cbed9e4d7ae52cf4987ef506a266ae879a8adff037740c02c738bae03 |
Hashes for wagyu-0.2.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e698d71cd73d1115dc899ff15a82ced52e4be24b8479a9b4345ac6ee3a94077 |
|
MD5 | aab413034161847109ac5ffcc087257e |
|
BLAKE2b-256 | e77b40eaaad086f282429e5d91d6285fc56eb2500b0878060130cb520af424f6 |
Hashes for wagyu-0.2.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 165c166987c5e6bd32bc5bf4ea4f07b8e84530b4607b27720e83be29a53b5604 |
|
MD5 | 478e9a551414c01324abef3af738ff73 |
|
BLAKE2b-256 | c43d7731dbd8b5772a4799b55b67200f2b1c92fc27d208f47e999c65c0403dac |
Hashes for wagyu-0.2.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31973ded0bee3b81e43dd85e4f0e6e2af2a7a5f41c196337092e3c50bc96aeaa |
|
MD5 | c55f436a73d8914f6b3c8dc2f927fe63 |
|
BLAKE2b-256 | 2d7ce51c5184de30980087f7b5ffb2d1390a58ad231a41563bd454bb01e29962 |
Hashes for wagyu-0.2.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96da77ceb67d555055d40a13be5f4396eb1bc7035005f2d44e0613f995b3db32 |
|
MD5 | 4c1feabf0baac516026061c2d31fb60c |
|
BLAKE2b-256 | 43a73e331762147034433f0dd74674890d79352190b8d77747e1e6478831d048 |
Hashes for wagyu-0.2.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 341b33e6872b0fb0c835d9a5fffc4908cb2e5d885232fc8cb6b794ce175ef5cb |
|
MD5 | 66c788a9d9c7253cf2ab1990677454a2 |
|
BLAKE2b-256 | be4bccc03d8464293342ab5502a5fea61160ea89414a835431bbfa146c86457b |
Hashes for wagyu-0.2.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9fe077e331d298eb3c9cdecadeac0d6b96483eb05df11cf497429455520ae8b |
|
MD5 | 90c57677e7b01fa46c65292fa2674913 |
|
BLAKE2b-256 | ab537db394d6e9e6992e254044c6b4a5fb99c8c375e84d144450c53bf3d6989d |
Hashes for wagyu-0.2.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e725141c149b95ac424a5ba87e90f810aea1486c7286de8f135f68a405ab1ed7 |
|
MD5 | 0c959667fe3f2e786a8a953da6b3ef99 |
|
BLAKE2b-256 | 9da039ca7dfe5717842a2393cc4e3dff6a6c70159f09b4da3d1f904b4869d165 |
Hashes for wagyu-0.2.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0506230e2810809e8cd3cbe20c30618be5a44eda7f918731a94c04d8a30da56f |
|
MD5 | 8cfd58646e3e057bb6910cd2e0715b0d |
|
BLAKE2b-256 | 867aeebfbc07b953d3c0d6059e9d725c10eb64983b3cce7be43b9310abb84e53 |
Hashes for wagyu-0.2.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa11911ecb2f7620acda813162e3116b16b0cd3917c2ed4c8eb4f2a97c4b23a5 |
|
MD5 | 8fad599e5813af71662e6b63fb4dd288 |
|
BLAKE2b-256 | d8efb526fdd63e092db5cf44b530ae5e2a1786e82aa8090e1bd7bd2aaa3d6974 |
Hashes for wagyu-0.2.2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f27bf1974c1e2b1b376528eec2b2c51a5fe21522f2efcfb54586e1afc7eb3e76 |
|
MD5 | d7982c7d35a6966ee636c6e9ab95f640 |
|
BLAKE2b-256 | b3ecd667795f8efc34b3e42a217b5cff7fbfe4ee7a54a1faa5c442a778e79318 |
Hashes for wagyu-0.2.2-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb3ae84a44ec1c5098836d09945ef749a77ee176fcea38beac21784925cfa2a |
|
MD5 | 0510cd1f676c8167f6a1f543df889cc2 |
|
BLAKE2b-256 | 9f7bd93c4af32c91013b9831295afb320115e9d7b3c6080ac2099d446209d292 |
Hashes for wagyu-0.2.2-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c806e0f453407728b2539c0a06342531d6cfc9c2f984912b353cb568b6cb5dd |
|
MD5 | b1ba55cc47323b74e561b775828602fb |
|
BLAKE2b-256 | d3183c89dbb8296157cd6b184c5c32488e5adf7f1a5fb58f36dcf90e51774dda |