Skip to content

Commit

Permalink
Typos and fixes in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervdw committed Aug 10, 2019
1 parent 0a25af4 commit d8e7db7
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 21 deletions.
21 changes: 11 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,28 @@ PyGEOS
:alt: PyPI
:target: https://badge.fury.io/py/pygeos

Pygeos is a C/Python library that implements vectorized versions of the
geometry functions from GEOS. By wrapping the GEOS operations in Numpy
"universal functions", pygeos provides a significant performance improvement
when working with large sets of geometries.
PyGEOS is a C/Python library with vectorized geometry functions. The geometry
operations are done in the open-source geometry library GEOS. PyGEOS wraps
these operations in NumPy ufuncs providing a performance improvement when
operating on arrays of geometries.

Why ufuncs?
-----------

A universal function (or ufunc for short) is a function that operates on
n-dimensional arrays in an element-by-element fashion, supporting array
broadcasting. The for-loops that are involved are fully implmemented in C
diminishing the overhead of the python interpreter.
broadcasting. The for-loops that are involved are fully implemented in C
diminishing the overhead of the Python interpreter.


The Geometry object
-------------------

GEOS geometry objects are stored in a static attribute of the Python extension
type `pygeos.Geometry`. This keeps the python interpreter out of the ufunc
inner loop. The Geometry object keeps track of the underlying GEOSGeometry and
allows the python garbage collector to free memory when the geometry is not
The `pygeos.Geometry` object is a container of the actual GEOSGeometry object.
A C pointer to this object is stored in a static attribute of the `Geometry`
object. This keeps the python interpreter out of the ufunc inner loop. The
Geometry object keeps track of the underlying GEOSGeometry and
allows the python garbage collector to free memory when it is not
used anymore.

`Geometry` objects are immutable. Construct them as follows:
Expand Down
48 changes: 38 additions & 10 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,56 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to pygeos's documentation
=================================
Welcome to the PyGEOS documentation
===================================

Pygeos is a C/Python library that implements vectorized versions of the
geometry functions from GEOS. By wrapping the GEOS operations in Numpy
"universal functions", pygeos provides a significant performance improvement
when working with large sets of geometries.
PyGEOS is a C/Python library with vectorized geometry functions. The geometry
operations are done in the open-source geometry library GEOS. PyGEOS wraps
these operations in NumPy ufuncs providing a performance improvement when
operating on arrays of geometries.

Why ufuncs?
-----------

A universal function (or ufunc for short) is a function that operates on
n-dimensional arrays in an element-by-element fashion, supporting array
broadcasting. The for-loops that are involved are fully implmemented in C
diminishing the overhead of the python interpreter.
broadcasting. The for-loops that are involved are fully implemented in C
diminishing the overhead of the Python interpreter.

.. note::
This documentation is still work in progress: only a part of the API has
been documented.

The Geometry object
-------------------

The `pygeos.Geometry` object is a container of the actual GEOSGeometry object.
A C pointer to this object is stored in a static attribute of the `Geometry`
object. This keeps the python interpreter out of the ufunc inner loop. The
Geometry object keeps track of the underlying GEOSGeometry and
allows the python garbage collector to free memory when it is not
used anymore.

`Geometry` objects are immutable. Construct them as follows:

.. code:: python
>>> from pygeos import Geometry
>>> geometry = Geometry.from_wkt("POINT (5.2 52.1)")
Or using one of the provided (vectorized) functions:

.. code:: python
>>> from pygeos import points
>>> point = points(5.2, 52.1)
API Reference
=============

.. toctree::
:maxdepth: 2
:caption: Contents:
Expand All @@ -36,5 +66,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


2 changes: 1 addition & 1 deletion pygeos/predicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def touches(a, b, **kwargs):
Parameters
----------
a, b: Geometry or array_like
a, b : Geometry or array_like
Examples
--------
Expand Down

0 comments on commit d8e7db7

Please sign in to comment.