Skip to content

Commit

Permalink
Merge pull request #193 from cleder/develop
Browse files Browse the repository at this point in the history
release 1.2.0
  • Loading branch information
cleder authored Nov 27, 2023
2 parents a6bde2d + 11b9410 commit fe831e5
Show file tree
Hide file tree
Showing 33 changed files with 842 additions and 226 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ html/
venv/
__pycache__/
*.stderr*
docs/_*
13 changes: 4 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,16 @@ repos:
rev: v0.3.1
hooks:
- id: absolufy-imports
- repo: https://github.com/hakancelikdev/unimport
rev: 1.0.0
hooks:
- id: unimport
args: [--remove, --include-star-import, --ignore-init, --gitignore]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.1'
rev: 'v0.1.6'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -73,7 +68,7 @@ repos:
- flake8-typing-imports
- flake8-use-fstring
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.7.1
hooks:
- id: mypy
# - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
Expand All @@ -89,7 +84,7 @@ repos:
hooks:
- id: pyprojectsort
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.27.0"
rev: "0.27.2"
hooks:
- id: check-github-workflows
- id: check-github-actions
Expand Down
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
---
# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
...
80 changes: 54 additions & 26 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
Introduction
============

PyGeoIf provides a `GeoJSON-like protocol <https://gist.github.com/2217756>`_ for geo-spatial (GIS) vector data.
.. inclusion-marker-do-not-remove
Other Python programs and packages that you may have heard of already
PyGeoIf provides a `GeoJSON-like protocol <https://gist.github.com/2217756>`_
for geo-spatial (GIS) vector data.

Other Python programs and packages that you may have heard of that
implement this protocol:

* `ArcPy <https://www.esri.com/about/newsroom/arcuser/geojson/>`_
* `descartes <https://docs.descarteslabs.com/>`_
* `PySAL <http://pysal.geodacenter.org/>`_
* `Shapely <https://github.com/Toblerity/Shapely>`_
* `pyshp <https://pypi.python.org/pypi/pyshp>`_
* `GeoPandas <https://geopandas.org/>`_
* `Karta <https://github.com/fortyninemaps/karta>`_
* `mapnik <https://github.com/mapnik/mapnik>`_

When you want to write your own geospatial library with support
for this protocol you may use pygeoif as a starting point and build
Expand All @@ -32,18 +38,27 @@ It was written to provide clean and python only geometries for fastkml_

.. image:: https://github.com/cleder/pygeoif/actions/workflows/run-all-tests.yml/badge.svg?branch=main
:target: https://github.com/cleder/pygeoif/actions/workflows/run-all-tests.yml
:alt: GitHub Actions

.. image:: https://readthedocs.org/projects/pygeoif/badge/?version=latest
:target: https://pygeoif.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://codecov.io/gh/cleder/pygeoif/branch/main/graph/badge.svg?token=2EfiwBXs9X
:target: https://codecov.io/gh/cleder/pygeoif
:alt: Codecov

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:target: https://github.com/psf/
:alt: Black

.. image:: https://img.shields.io/badge/type-checker-mypy-blue
.. image:: https://img.shields.io/badge/type%20checker-mypy-blue
:target: http://mypy-lang.org/
:alt: Mypy

.. image:: https://www.openhub.net/p/pygeoif/widgets/project_thin_badge.gif
:target: https://www.openhub.net/p/pygeoif/
:alt: Openhub

.. image:: https://www.codefactor.io/repository/github/cleder/pygeoif/badge/main
:target: https://www.codefactor.io/repository/github/cleder/pygeoif/overview/main
Expand All @@ -53,6 +68,22 @@ It was written to provide clean and python only geometries for fastkml_
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit

.. image:: https://img.shields.io/pypi/pyversions/pygeoif.svg
:target: https://pypi.python.org/pypi/pygeoif/
:alt: Supported Python versions

.. image:: https://img.shields.io/pypi/implementation/pygeoif.svg
:target: https://pypi.python.org/pypi/pygeoif/
:alt: Supported Python implementations

Installation
------------

You can install PyGeoIf from pypi using pip::

pip install pygeoif


Example
========

Expand Down Expand Up @@ -302,9 +333,8 @@ Create a geometry from its WKT representation
signed_area
------------

Return the signed area enclosed by a ring using the linear time
algorithm at http://www.cgafaq.info/wiki/Polygon_Area. A value >= 0
indicates a counter-clockwise oriented ring.
Return the signed area enclosed by a ring.
A value >= 0 indicates a counter-clockwise oriented ring.


orient
Expand All @@ -330,28 +360,13 @@ Return the ``__geo_interface__`` dictionary.
Development
===========

Installation
------------

You can install PyGeoIf from pypi using pip::

pip install pygeoif

Testing
-------

Install the requirements with ``pip install -r test-requirements.txt``
and run the unit and static tests with::
Clone this repository, create a virtualenv with Python 3.8 or later with
``python3 -m venv .venv`` and activate it with ``source .venv/bin/activate``.

pytest pygeoif
pytest --doctest-glob="README.rst"
yesqa pygeoif/*.py
black pygeoif
flake8 pygeoif
mypy pygeoif
Then install the requirements with ``pip install -e ".[dev]"``.

pre-commit
~~~~~~~~~~~
----------

Install the ``pre-commit`` hook with::

Expand All @@ -362,6 +377,19 @@ and check the code with::

pre-commit run --all-files

Testing
-------

Run the unit and static tests with::

pytest tests
pytest --doctest-glob="README.rst"
black pygeoif
ruff pygeoif
flake8 pygeoif
mypy pygeoif



Acknowledgments
================
Expand Down
File renamed without changes.
35 changes: 21 additions & 14 deletions docs/HISTORY.txt → docs/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
Changelog
=========

1.1.1 (unreleased)
1.2.0 (2023/11/27)
------------------

- Use pyproject.toml instead of setup.py
- remove Python 3.7 support
- Geometries are now immutable (but not hashable)
- add ``force_2d`` and ``force_3d`` factories [Alex Svetkin]

1.1.1 (2023/10/27)
------------------

- Use ``pyproject.toml``, remove ``setup.py`` and ``MANIFEST.in``

1.1 (2023/10/13)
-----------------
Expand All @@ -22,8 +29,8 @@ Changelog
- changes to keep functionality and interface close to ``shapely``
- remove support for python 2
- minimum python version is 3.7
- rename as_shape to shape
- add box factory
- rename ``as_shape`` to ``shape``
- add ``box`` factory
- format with black
- reconstruct objects from their representation
- Parse WKT that is not in upper case.
Expand All @@ -37,7 +44,7 @@ Changelog
-----------------

- fix broken multipolygon [mindflayer]
- add "bbox" to `__geo_interface__` output [jzmiller1]
- add "bbox" to ``__geo_interface__`` output [jzmiller1]

0.6 (2015/08/04)
-----------------
Expand All @@ -47,16 +54,16 @@ Changelog
0.5 (2015/07/13)
-----------------

- Add __iter__ method to FeatureCollection and GeometryCollection [jzmiller1].
- Add ``__iter__`` method to FeatureCollection and GeometryCollection [jzmiller1].
- add pypy and pypy3 and python 3.4 to travis.
- Add tox configuration for performing local testing [Ian Lee].
- Add Travis continuous deployment.

0.4 (2013/10/25)
-----------------

- after a year in production promote it to `Development Status :: 5 - Production/Stable`
- MultiPolygons return tuples as the __geo_interface__
- after a year in production promote it to ``Development Status :: 5 - Production/Stable``
- MultiPolygons return tuples as the ``__geo_interface__``

0.3.1 (2012/11/15)
------------------
Expand All @@ -70,24 +77,24 @@ Changelog

- add GeometryCollection
- len(Multi*) and len(GeometryCollection) returns the number of contained Geometries
- add orient function to get clockwise or counterclockwise oriented polygons
- add signed_area function
- add _set_orientation method to lineStrings, Polygons and MultiPolygons
- add ``orient`` function to get clockwise or counterclockwise oriented polygons
- add ``signed_area`` function
- add ``_set_orientation`` method to lineStrings, Polygons and MultiPolygons


0.2.1 (2012/08/02)
-------------------

- as_shape also accepts an object that is neither a dictionary nor has a __geo_interface__
but can be converted into a __geo_interface__ compliant dictionary
- ``as_shape`` also accepts an object that is neither a dictionary nor has a ``__geo_interface__``
but can be converted into a ``__geo_interface__`` compliant dictionary


0.2 (2012/08/01)
-----------------

- change license to LGPL
- add wkt as a property
- as_shape also accepts a __geo_interface__ compliant dictionary
- ``as_shape`` also accepts a ``__geo_interface__`` compliant dictionary
- test with python3


Expand Down
21 changes: 21 additions & 0 deletions docs/LICENSE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

License
=======

Copyright (C) 2012 - 2023 Christian Ledermann

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (LGPL_) as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License (LGPL_) for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

.. _LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
19 changes: 0 additions & 19 deletions docs/LICENSE.txt

This file was deleted.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading

0 comments on commit fe831e5

Please sign in to comment.