gon

Geometries processing

https://github.com/lycantropos/gon

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary

Keywords

computational-geometry constrained-delaunay-triangulation delaunay-triangulation polygon polygon-boolean polygon-clipping
Last synced: 6 months ago · JSON representation

Repository

Geometries processing

Basic Info
  • Host: GitHub
  • Owner: lycantropos
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage: https://gon.rtfd.io
  • Size: 1.95 MB
Statistics
  • Stars: 20
  • Watchers: 3
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Topics
computational-geometry constrained-delaunay-triangulation delaunay-triangulation polygon polygon-boolean polygon-clipping
Created over 6 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

gon

Summary

gon is a pure Python library that provides support for planar geometry objects built from discrete points, finite number of straight line segments (e.g. polylines) and areas bound by closed polylines (e.g. polygons).

Main features are - convenience: all geometric objects are immutable, hashable and implement set-like interface, i.e. support containment, equality, "is-subset" tests and boolean set operations (e.g. finding intersection). - correctness: all calculations are robust for floating point numbers & precise for integral numbers (like int), each operation corresponds to its mathematical definition and property-based tested. - efficiency: all operations are efficient in terms of both time & memory complexity, upper bound for expected time complexity is O(n * log n), for memory complexity is O(n).


In what follows python is an alias for python3.7 or pypy3.7 or any later version (python3.7, pypy3.8 and so on).

Installation

Install the latest pip & setuptools packages versions bash python -m pip install --upgrade pip setuptools

User

Download and install the latest stable version from PyPI repository bash python -m pip install --upgrade gon

Developer

Download the latest version from GitHub repository bash git clone https://github.com/lycantropos/gon.git cd gon

Install dependencies bash python -m pip install -r requirements.txt

Install bash python setup.py install

Usage

```python

from gon.base import EMPTY, Angle, Contour, Point, Polygon square = Polygon(Contour([Point(0, 0), Point(4, 0), Point(4, 4), ... Point(0, 4)])) square == square True square >= square True square <= square True square < square False square > square False square & square == square True square | square == square True square - square is EMPTY True square ^ square is EMPTY True Point(0, 0) in square True square.index() Point(0, 0) in square True len(square.border.vertices) == 4 True len(square.holes) == 0 True square.isconvex True square.convexhull == square True square.area == 16 True square.perimeter == 16 True square.centroid == Point(2, 2) True square.distanceto(Point(2, 2)) == 0 True square.distanceto(Point(7, 8)) == 5 True (square.rotate(Angle(0, 1), Point(4, 4)) ... == Polygon(Contour([Point(8, 0), Point(8, 4), Point(4, 4), Point(4, 0)]))) True (square.scale(1, 2) ... == Polygon(Contour([Point(0, 0), Point(4, 0), Point(4, 8), Point(0, 8)]))) True (square.translate(1, 2) ... == Polygon(Contour([Point(1, 2), Point(5, 2), Point(5, 6), Point(1, 6)]))) True (square.triangulate().triangles() ... == [Contour([Point(0, 4), Point(4, 0), Point(4, 4)]), ... Contour([Point(0, 0), Point(4, 0), Point(0, 4)])]) True

```

Development

Bumping version

Preparation

Install bump2version.

Pre-release

Choose which version number category to bump following semver specification.

Test bumping version bash bump2version --dry-run --verbose $CATEGORY

where $CATEGORY is the target version number category name, possible values are patch/minor/major.

Bump version bash bump2version --verbose $CATEGORY

This will set version to major.minor.patch-alpha.

Release

Test bumping version bash bump2version --dry-run --verbose release

Bump version bash bump2version --verbose release

This will set version to major.minor.patch.

Running tests

Install dependencies bash python -m pip install -r requirements-tests.txt

Plain bash pytest

Inside Docker container: - with CPython bash docker-compose --file docker-compose.cpython.yml up - with PyPy bash docker-compose --file docker-compose.pypy.yml up

Bash script: - with CPython bash ./run-tests.sh or bash ./run-tests.sh cpython

  • with PyPy bash ./run-tests.sh pypy

PowerShell script: - with CPython powershell .\run-tests.ps1 or powershell .\run-tests.ps1 cpython - with PyPy powershell .\run-tests.ps1 pypy

Owner

  • Name: Azat Ibrakov
  • Login: lycantropos
  • Kind: user
  • Location: Russia

Pythoneer

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 1,880
  • Total Committers: 2
  • Avg Commits per committer: 940.0
  • Development Distribution Score (DDS): 0.002
Past Year
  • Commits: 11
  • Committers: 1
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Azat Ibrakov a****v@g****m 1,876
Georgy s****v@p****u 4
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 13
  • Total pull requests: 46
  • Average time to close issues: 4 months
  • Average time to close pull requests: 8 days
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 0.92
  • Average comments per pull request: 1.04
  • Merged pull requests: 45
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • lycantropos (12)
  • novrain99 (1)
Pull Request Authors
  • lycantropos (44)
  • GeorgySk (2)
Top Labels
Issue Labels
enhancement (12)
Pull Request Labels
enhancement (32) documentation (8) bug (5)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 130 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 1
  • Total versions: 31
  • Total maintainers: 1
pypi.org: gon

Processing of planar geometries.

  • Homepage: https://github.com/lycantropos/gon/
  • Documentation: https://gon.readthedocs.io/
  • License: MIT License Copyright (c) 2019 Azat Ibrakov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 6.0.0
    published almost 3 years ago
  • Versions: 31
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 130 Last month
Rankings
Dependent packages count: 3.1%
Downloads: 14.4%
Stargazers count: 14.8%
Average: 16.8%
Dependent repos count: 21.7%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • Sphinx >=4.5.0,<5.0
  • sphinx-rtd-theme >=1.0.0,<2.0
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3.1.4 composite
  • pypa/gh-action-pypi-publish v1.8.7 composite
Dockerfile docker
  • ${IMAGE_NAME} ${IMAGE_VERSION} build
docker-compose.cpython.yml docker
  • lycantropos/gon-cpython 6.0.0
docker-compose.pypy.yml docker
  • lycantropos/gon-pypy 6.0.0
pyproject.toml pypi
  • bentley-ottmann >=8.0.0,<9.0
  • clipping >=6.0.0,<7.0
  • ground >=9.0.0,<10.0
  • locus >=10.0.0,<11.0
  • orient >=7.0.0,<8.0
  • reprit >=0.9.0,<1.0
  • sect >=7.0.0,<8.0
  • symba >=2.2.1,<3.0
setup.py pypi