8000 MAINT: silence Cython warnings about changes dtype/ufunc size. · 87/numpy@170ed4e · GitHub
[go: up one dir, main page]

Skip to content

Commit 170ed4e

Browse files
author
Ralf Gommers
committed
MAINT: silence Cython warnings about changes dtype/ufunc size.
These warnings are visible whenever you import scipy (or another package) that was compiled against an older numpy than is installed. For example compiled against 1.5.1, like current scipy binaries are, and used with 1.7.0. These warnings aren't useful; if numpy would really break its ABI it would be noticed in no time without these warnings.
1 parent a744f3c commit 170ed4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

numpy/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,9 @@ def pkgload(*packages, **options):
169169
__all__.extend(_mat.__all__)
170170
__all__.extend(lib.__all__)
171171
__all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma'])
172+
173+
# Filter annoying Cython warnings that serve no good purpose.
174+
import warnings
175+
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
176+
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
177+

0 commit comments

Comments
 (0)
0