summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/code_generators/generate_numpy_api.py7
-rw-r--r--numpy/core/numeric.py2
-rw-r--r--numpy/distutils/fcompiler/gnu.py8
-rw-r--r--numpy/lib/function_base.pyi8
-rw-r--r--numpy/typing/tests/data/reveal/lib_function_base.pyi7
5 files changed, 23 insertions, 9 deletions
diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py
index a966be57d..a57a36a78 100644
--- a/numpy/core/code_generators/generate_numpy_api.py
+++ b/numpy/core/code_generators/generate_numpy_api.py
@@ -78,7 +78,12 @@ _import_array(void)
}
if (NPY_FEATURE_VERSION > PyArray_GetNDArrayCFeatureVersion()) {
PyErr_Format(PyExc_RuntimeError, "module compiled against "\
- "API version 0x%%x but this version of numpy is 0x%%x", \
+ "API version 0x%%x but this version of numpy is 0x%%x . "\
+ "Check the section C-API incompatibility at the "\
+ "Troubleshooting ImportError section at "\
+ "https://numpy.org/devdocs/user/troubleshooting-importerror.html"\
+ "#c-api-incompatibility "\
+ "for indications on how to solve this problem .", \
(int) NPY_FEATURE_VERSION, (int) PyArray_GetNDArrayCFeatureVersion());
return -1;
}
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index cfcd237aa..352f43251 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -682,7 +682,7 @@ def correlate(a, v, mode='valid'):
This function computes the correlation as generally defined in signal
processing texts:
- .. math:: c_k = \sum_n a_{n+k} \cdot \overline{v_n}
+ .. math:: c_k = \sum_n a_{n+k} \cdot \overline{v}_n
with a and v sequences being zero-padded where necessary and
:math:`\overline x` denoting complex conjugation.
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index d8143328e..cdb6aef94 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -382,7 +382,13 @@ class Gnu95FCompiler(GnuFCompiler):
def get_target(self):
try:
- output = subprocess.check_output(self.compiler_f77 + ['-v'])
+ p = subprocess.Popen(
+ self.compiler_f77 + ['-v'],
+ stdin=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ stdout, stderr = p.communicate()
+ output = (stdout or b"") + (stderr or b"")
except (OSError, subprocess.CalledProcessError):
pass
else:
diff --git a/numpy/lib/function_base.pyi b/numpy/lib/function_base.pyi
index 6c00d26b4..c14a54c60 100644
--- a/numpy/lib/function_base.pyi
+++ b/numpy/lib/function_base.pyi
@@ -289,11 +289,13 @@ def interp(
) -> NDArray[complex128]: ...
@overload
-def angle(z: _ArrayLikeFloat_co, deg: bool = ...) -> floating[Any]: ...
+def angle(z: _ComplexLike_co, deg: bool = ...) -> floating[Any]: ...
@overload
-def angle(z: _ArrayLikeComplex_co, deg: bool = ...) -> complexfloating[Any, Any]: ...
+def angle(z: object_, deg: bool = ...) -> Any: ...
@overload
-def angle(z: _ArrayLikeObject_co, deg: bool = ...) -> Any: ...
+def angle(z: _ArrayLikeComplex_co, deg: bool = ...) -> NDArray[floating[Any]]: ...
+@overload
+def angle(z: _ArrayLikeObject_co, deg: bool = ...) -> NDArray[object_]: ...
@overload
def unwrap(
diff --git a/numpy/typing/tests/data/reveal/lib_function_base.pyi b/numpy/typing/tests/data/reveal/lib_function_base.pyi
index eebe9fbfd..259e1964f 100644
--- a/numpy/typing/tests/data/reveal/lib_function_base.pyi
+++ b/numpy/typing/tests/data/reveal/lib_function_base.pyi
@@ -79,9 +79,10 @@ reveal_type(np.diff("bob", n=0)) # E: str
reveal_type(np.diff(AR_f8, axis=0)) # E: ndarray[Any, dtype[Any]]
reveal_type(np.diff(AR_LIKE_f8, prepend=1.5)) # E: ndarray[Any, dtype[Any]]
-reveal_type(np.angle(AR_f8)) # E: floating[Any]
-reveal_type(np.angle(AR_c16, deg=True)) # E: complexfloating[Any, Any]
-reveal_type(np.angle(AR_O)) # E: Any
+reveal_type(np.angle(f8)) # E: floating[Any]
+reveal_type(np.angle(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]]
+reveal_type(np.angle(AR_c16, deg=True)) # E: ndarray[Any, dtype[floating[Any]]]
+reveal_type(np.angle(AR_O)) # E: ndarray[Any, dtype[object_]]
reveal_type(np.unwrap(AR_f8)) # E: ndarray[Any, dtype[floating[Any]]]
reveal_type(np.unwrap(AR_O)) # E: ndarray[Any, dtype[object_]]