Why is my shapely source code different to the github repo?

Viewed 13

My shapely version is:

shapely.__version__
'1.8.4'

The most recent version on github is 1.8.4

However when I look at the source code locally for say, shapely/predicates.py, my code looks like:

"""
Support for GEOS spatial predicates
"""

from shapely.geos import PredicateError
from shapely.topology import Delegating


class BinaryPredicate(Delegating):

    def __call__(self, this, other, *args):
        self._validate(this)
        self._validate(other, stop_prepared=True)
        try:
            return self.fn(this._geom, other._geom, *args)
        except PredicateError as err:
            # Dig deeper into causes of errors.
            self._check_topology(err, this, other)


class UnaryPredicate(Delegating):

    def __call__(self, this):
        self._validate(this)
        return self.fn(this._geom)

And when I look on the github repo, the source code looks like:

import warnings

from . import lib
from .decorators import multithreading_enabled, requires_geos

__all__ = [
    "has_z",
    "is_ccw",
    "is_closed",
    "is_empty",
    "is_geometry",
    "is_missing",
    "is_prepared",
    "is_ring",
    "is_simple",
    "is_valid",
    "is_valid_input",
    "is_valid_reason",
    "crosses",
    "contains",
    "contains_properly",
    "covered_by",
    "covers",
    "disjoint",
    "dwithin",
    "equals",
    "intersects",
    "overlaps",
    "touches",
    "within",
    "equals_exact",
    "relate",
    "relate_pattern",
]


@multithreading_enabled
def has_z(geometry, **kwargs):
    """Returns True if a geometry has a Z coordinate.
    Note that this function returns False if the (first) Z coordinate equals NaN or
    if the geometry is empty.
    Parameters
    ----------
    geometry : Geometry or array_like
    **kwargs
        For other keyword-only arguments, see the
        `NumPy ufunc docs <https://numpy.org/doc/stable/reference/ufuncs.html#ufuncs-kwargs>`_.
    See also
    --------
    get_coordinate_dimension
    Examples
    --------
    >>> from shapely import Point
    >>> has_z(Point(0, 0))
    False
    >>> has_z(Point(0, 0, 0))
    True
    >>> has_z(Point(0, 0, float("nan")))
    False
    """
    return lib.has_z(geometry, **kwargs)
... up to 1080 lines of source code

Why is my local version completely different from the GitHub version?

0 Answers
Related