Skip to content

TST: Increase fp tolerances for some images #22132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

env:
NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test.
NPY_DISABLE_CPU_FEATURES: "AVX512F,AVX512CD,AVX512VL,AVX512BW,AVX512DQ,AVX512_SKX"
OPENBLAS_NUM_THREADS: 1
PYTHONFAULTHANDLER: 1

Expand Down
1 change: 0 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ stages:
displayName: 'print env'

- bash: |
export NPY_DISABLE_CPU_FEATURES="AVX512F,AVX512CD,AVX512VL,AVX512BW,AVX512DQ,AVX512_SKX"
PYTHONFAULTHANDLER=1 python -m pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 ||
[[ "$PYTHON_VERSION" = 'Pre' ]]
displayName: 'pytest'
Expand Down
4 changes: 3 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3327,7 +3327,9 @@ def test_tick_space_size_0():

@image_comparison(['errorbar_basic', 'errorbar_mixed', 'errorbar_basic'])
def test_errorbar():
x = np.arange(0.1, 4, 0.5)
# longdouble due to floating point rounding issues with certain
# computer chipsets
x = np.arange(0.1, 4, 0.5, dtype=np.longdouble)
y = np.exp(-x)

yerr = 0.1 + 0.2*np.sqrt(x)
Expand Down
3 changes: 1 addition & 2 deletions lib/matplotlib/tests/test_backend_tk.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def test_func():
try:
proc = subprocess.run(
[sys.executable, "-c", f"{source}\n{func.__name__}()"],
env={**os.environ, "MPLBACKEND": "TkAgg",
"NPY_DISABLE_CPU_FEATURES": ""},
env={**os.environ, "MPLBACKEND": "TkAgg"},
timeout=_test_timeout,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
Expand Down
6 changes: 2 additions & 4 deletions lib/matplotlib/tests/test_sphinxext.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def test_tinypages(tmpdir):
# coverage anyways); hide them using GCOV_ERROR_FILE.
proc = Popen(
cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True,
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull,
"NPY_DISABLE_CPU_FEATURES": ""})
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull})
out, err = proc.communicate()

# Build the pages with warnings turned into errors
Expand Down Expand Up @@ -129,8 +128,7 @@ def build_sphinx_html(source_dir, doctree_dir, html_dir, extra_args=None):
cmd = [sys.executable, '-msphinx', '-W', '-b', 'html',
'-d', str(doctree_dir), str(source_dir), str(html_dir), *extra_args]
proc = Popen(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True,
env={**os.environ, "MPLBACKEND": "",
"NPY_DISABLE_CPU_FEATURES": ""})
env={**os.environ, "MPLBACKEND": ""})
out, err = proc.communicate()

assert proc.returncode == 0, \
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_streamplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_maxlength():


@image_comparison(['streamplot_direction.png'],
remove_text=True, style='mpl20', tol=0.056)
remove_text=True, style='mpl20', tol=0.073)
def test_direction():
x, y, U, V = swirl_velocity_field()
plt.streamplot(x, y, U, V, integration_direction='backward',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_polar_box():
ax1.grid(True)


@image_comparison(['axis_direction.png'], style='default', tol=0.07)
@image_comparison(['axis_direction.png'], style='default', tol=0.071)
def test_axis_direction():
# Remove this line when this test image is regenerated.
plt.rcParams['text.kerning_factor'] = 6
Expand Down
5 changes: 2 additions & 3 deletions lib/mpl_toolkits/tests/test_mplot3d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import functools
import itertools
import platform

import pytest

Expand Down Expand Up @@ -547,7 +546,7 @@ def test_text3d_modification(fig_ref, fig_test):
ax_ref.text(x, y, z, f'({x}, {y}, {z}), dir={zdir}', zdir=zdir)


@mpl3d_image_comparison(['trisurf3d.png'], tol=0.03)
@mpl3d_image_comparison(['trisurf3d.png'], tol=0.061)
def test_trisurf3d():
n_angles = 36
n_radii = 8
Expand Down Expand Up @@ -1369,7 +1368,7 @@ def test_errorbar3d():


@image_comparison(['stem3d.png'], style='mpl20',
tol=0.0 if platform.machine() == 'x86_64' else 0.003)
tol=0.003)
def test_stem3d():
fig, axs = plt.subplots(2, 3, figsize=(8, 6),
constrained_layout=True,
Expand Down