提交 4e3b5bed authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Ignore numba object mode warning

Also need to re-filter warnings because pytestmark.filterwarnings overrides library filters
上级 f970c385
......@@ -121,6 +121,9 @@ tag_prefix = "rel-"
addopts = "--durations=50 --doctest-modules --ignore=pytensor/link --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/ipython.py"
testpaths = ["pytensor/", "tests/"]
xfail_strict = true
filterwarnings =[
'ignore:^Numba will use object mode to run.*perform method\.:UserWarning',
]
[tool.ruff]
line-length = 88
......
......@@ -36,7 +36,11 @@ from pytensor.tensor.type import (
from tests.fixtures import * # noqa: F403
pytestmark = pytest.mark.filterwarnings("error")
pytestmark = pytest.mark.filterwarnings(
"error",
r"ignore:^Numba will use object mode to run.*perform method\.:UserWarning",
r"ignore:Cannot cache compiled function \"numba_funcified_fgraph\".*:numba.NumbaWarning",
)
def PatternOptimizer(p1, p2, ign=True):
......
......@@ -10,7 +10,11 @@ from tests.link.numba.test_basic import compare_numba_and_py
from tests.tensor.signal.test_conv import convolve1d_grad_benchmarker
pytestmark = pytest.mark.filterwarnings("error")
pytestmark = pytest.mark.filterwarnings(
"error",
r"ignore:^Numba will use object mode to run.*perform method\.:UserWarning",
r"ignore:Cannot cache compiled function \"numba_funcified_fgraph\".*:numba.NumbaWarning",
)
@pytest.mark.parametrize("bcast_order", (1, 0))
......
......@@ -151,7 +151,12 @@ from tests.tensor.utils import (
)
pytestmark = pytest.mark.filterwarnings("error")
pytestmark = pytest.mark.filterwarnings(
"error",
r"ignore:^Numba will use object mode to run.*perform method\.:UserWarning",
r"ignore:Cannot cache compiled function \"numba_funcified_fgraph\".*:numba.NumbaWarning",
r"ignore::numba.NumbaPerformanceWarning",
)
if config.mode == "FAST_COMPILE":
mode_opt = "FAST_RUN"
......
......@@ -17,7 +17,11 @@ from pytensor.tensor.type import tensor
# Fail for unexpected warnings in this file
pytestmark = pytest.mark.filterwarnings("error")
pytestmark = pytest.mark.filterwarnings(
"error",
r"ignore:^Numba will use object mode to run.*perform method\.:UserWarning",
r"ignore:Cannot cache compiled function \"numba_funcified_fgraph\".*:numba.NumbaWarning",
)
floatX = pytensor.config.floatX
ATOL = RTOL = 1e-8 if floatX == "float64" else 1e-4
......
......@@ -45,7 +45,11 @@ from pytensor.tensor.variable import (
from tests.tensor.utils import random
pytestmark = pytest.mark.filterwarnings("error")
pytestmark = pytest.mark.filterwarnings(
"error",
r"ignore:^Numba will use object mode to run.*perform method\.:UserWarning",
r"ignore:Cannot cache compiled function \"numba_funcified_fgraph\".*:numba.NumbaWarning",
)
@pytest.mark.parametrize(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论