Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: remove numeric/numarrays support #908

Merged
merged 1 commit into from Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/history.rst
Expand Up @@ -19,6 +19,7 @@ Latest
- BUG: Hide unnecessary PROJ ERROR from proj_crs_get_coordoperation (issue #873)
- BUG: Fix pickling for CRS builder classes (issue #897)
- CLN: Remove `ignore_axis_order` kwarg from :meth:`pyproj.crs.CRS.is_exact_same` as it was added by accident (pull #904)
- CLN: remove numeric/numarrays support (pull #908)

3.1.0
-----
Expand Down
34 changes: 10 additions & 24 deletions pyproj/utils.py
Expand Up @@ -69,30 +69,16 @@ def _copytobuffer(xx: Any) -> Tuple[Any, bool, bool, bool]:
if xx.shape == ():
return _copytobuffer_return_scalar(xx)
else:
try:
# typecast numpy arrays to double.
# (this makes a copy - which is crucial
# since buffer is modified in place)
xx.dtype.char
# Basemap issue
# https://github.com/matplotlib/basemap/pull/223/files
# (deal with input array in fortran order)
inx = xx.copy(order="C").astype("d", copy=False)
# inx,isfloat,islist,istuple
return inx, False, False, False
except Exception:
try: # perhaps they are Numeric/numarrays?
# sorry, not tested yet.
# i don't know Numeric/numarrays has `shape'.
xx.typecode()
inx = xx.astype("d")
# inx,isfloat,islist,istuple
return inx, False, False, False
except Exception:
raise TypeError(
"input must be an array, list, tuple, scalar, "
"or have the __array__ method."
)
# typecast numpy arrays to double.
# (this makes a copy - which is crucial
# since buffer is modified in place)
xx.dtype.char
snowman2 marked this conversation as resolved.
Show resolved Hide resolved
# Basemap issue
# https://github.com/matplotlib/basemap/pull/223/files
# (deal with input array in fortran order)
inx = xx.copy(order="C").astype("d", copy=False)
# inx,isfloat,islist,istuple
return inx, False, False, False
else:
# perhaps they are regular python arrays?
if hasattr(xx, "typecode"):
Expand Down