Skip to content

Commit

Permalink
CLN: remove numeric/numarrays support
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Aug 23, 2021
1 parent 8c63acf commit 30471f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
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
# 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

0 comments on commit 30471f5

Please sign in to comment.