pyproj4 / pyproj

Python interface to PROJ (cartographic projections and coordinate transformations library)

Home Page:https://pyproj4.github.io/pyproj

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove special-case casting support for numpy<2.0

greglucas opened this issue · comments

Once we support only Numpy 2.0+ we can remove the casting checks we have added to the Cython code for single-point transforms and Geod's fwd/inv single-point as well. Right now we make sure to throw a TypeError so we get the right conversions, but Numpy 2.0+ will do this for us automatically.

# We do the type-checking internally here due to automatically
# casting length-1 arrays to float that we don't want to return scalar for.
# Ex: float(np.array([0])) works and we don't want to accept numpy arrays

Possibly helpful guide to follow on numpy support window: https://scientific-python.org/specs/spec-0000/