PyGuymer3
March 21, 2026 · View on GitHub
This is a Python 3.X port of my Python 2.X module containing a bunch of random functions that I have written over the years. The documentation is on Read The Docs and the module is on PyPI.
You may browse the coverage report for running the unit tests.
Installation
To install PyGuymer3, run:
# To install the latest released version from PyPI:
pip install --user PyGuymer3
# To install the latest development version from GitHub:
pip install --user git+https://github.com/Guymer/PyGuymer3.git
... and everything should "just work".
Dependencies
PyGuymer3 requires the following Python modules to be installed and available in your PYTHONPATH:
Additionally, due to the dependency on my FORTRAN library, if you want to run the FORTRAN-based functions in the f90 sub-module then you will also require the following Python modules to be installed and available in your PYTHONPATH:
Similarly, PyGuymer3 requires the following binaries to be installed and available in your PATH:
dotexiftoolffmpegandffprobegifsiclegitjpegtranlsdvdmetaflacmp4fileoptipngtarxz
Notes
The Zen of Python
import this
To Do
- Read this good StackOverflow answer describing type-checking which also provides a quick summary on PEP 484 and PEP 3107.
Bugs
- This module has been created from my Python 2.X module using the utility
2to3. As such, there may be bugs in the code as most of it has not been tested since the port. If you find anything wrong then please raise a bug report on GitHub. - The function pyguymer3.geo.area() sometimes returns erroneous areas. This has been tracked down to the Shapely function shapely.ops.voronoi_diagram(): for certain inputs (often when a point within the shape is exactly
0.0) some of the parts of the Voronoi diagram are inverted. When it goes wrong it reliably goes wrong for those inputs. Below, the blue circle is the 1 km buffer around a point at(0.0°, 0.0°)and the orange wedges are the parts of the Voronoi diagram. Note that the orange wedges foriVoroPoly = 10andiVoroPoly = 31are inverted - they are the negative of what they are supposed to be. As a consequence, when the area of each orange wedge is calculated and summed the total is very wrong (demonstrated by the voronoi-diagram-bug.py script).
. - Another example of the same bug in the Shapely function shapely.ops.voronoi_diagram() is demonstrated by the another-voronoi-diagram-bug.py script. For a particular island in a particular dataset from the Global Self-Consistent Hierarchical High-Resolution Geography resource the area is calculated to be very wrong due to a single Polygon within the Voronoi diagram. !another bad Voronoi diagram