提交 32f8a112 authored 作者: Frederic's avatar Frederic

Filter warning about 'numpy.ndarray size changed'

上级 6ca7b2b6
......@@ -17,6 +17,7 @@ import tempfile
import time
import platform
import distutils.sysconfig
import warnings
import numpy.distutils # TODO: TensorType should handle this
......@@ -324,7 +325,10 @@ def dlimport(fullpath, suffix=None):
if hasattr(importlib, "invalidate_caches"):
importlib.invalidate_caches()
t0 = time.time()
rval = __import__(module_name, {}, {}, [module_name])
with warnings.catch_warnings():
warnings.filterwarnings("ignore",
message="numpy.ndarray size changed")
rval = __import__(module_name, {}, {}, [module_name])
t1 = time.time()
import_time += t1 - t0
if not rval:
......
......@@ -132,5 +132,10 @@ except ImportError:
# Release lock on compilation directory.
release_lock()
from scan_perform.scan_perform import *
# This is caused as cython use the old NumPy C-API but we use the new one.
# To fix it completly, we would need to modify Cython to use the new API.
with warnings.catch_warnings():
warnings.filterwarnings("ignore",
message="numpy.ndarray size changed")
from scan_perform.scan_perform import *
assert version == get_version()
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论