You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CI logs for pyproj show a few common warning messages, e.g. here
test/test_geod.py: 72 warnings
/home/runner/work/pyproj/pyproj/pyproj/geod.py:398: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
return self._inv_point(
test/test_geod.py: 20 warnings
/home/runner/work/pyproj/pyproj/pyproj/geod.py:306: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
return self._fwd_point(
...
test/test_transformer.py: 40 warnings
/home/runner/work/pyproj/pyproj/pyproj/transformer.py:817: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
return self._transformer._transform_point(
Traceback (most recent call last):
File "", line 1, in
File "/tmp/z/lib/python3.10/site-packages/pyproj/transformer.py", line 817, in transform
return self._transformer._transform_point(
File "pyproj/_transformer.pyx", line 743, in pyproj._transformer._Transformer._transform_point
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
This is because of a try/except block that attempts a scalar transform in pyproj/transformer.py#L815-L827. The attempt with non-scalar np.array([1]) throws a warning/error when assigned to scalar double coord_x in pyproj/_transformer.pyx#L743.
Array inputs should use _transform instead of _transform_point, which is intended for scalars.
I haven't checked the other instances with _inv_point or _fwd_point, but I'd expect similar.
The CI logs for pyproj show a few common warning messages, e.g. here
Code Sample
A small replicator for
_transform_point
is:with error
This is because of a try/except block that attempts a scalar transform in
pyproj/transformer.py#L815-L827
. The attempt with non-scalarnp.array([1])
throws a warning/error when assigned to scalardouble coord_x
inpyproj/_transformer.pyx#L743
.Array inputs should use
_transform
instead of_transform_point
, which is intended for scalars.I haven't checked the other instances with
_inv_point
or_fwd_point
, but I'd expect similar.Environment Information
pyproj -v
The text was updated successfully, but these errors were encountered: