From 170ed4e33d6196d724dc18ddcd42311c291b4587 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sat, 8 Sep 2012 21:56:23 +0200 Subject: [PATCH] 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. --- numpy/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/numpy/__init__.py b/numpy/__init__.py index 0b5357632cb8..8a09d2fec722 100644 --- a/numpy/__init__.py +++ b/numpy/__init__.py @@ -169,3 +169,9 @@ def pkgload(*packages, **options): __all__.extend(_mat.__all__) __all__.extend(lib.__all__) __all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma']) + + # Filter annoying Cython warnings that serve no good purpose. + import warnings + warnings.filterwarnings("ignore", message="numpy.dtype size changed") + warnings.filterwarnings("ignore", message="numpy.ufunc size changed") +