Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6bf1bf

Browse files
authored
Merge pull request #22136 from meeseeksmachine/auto-backport-of-pr-22132-on-v3.5.x
Backport PR #22132 on branch v3.5.x (TST: Increase fp tolerances for some images)
2 parents ac1b518 + 0f38a84 commit e6bf1bf

File tree

8 files changed

+10
-14
lines changed

8 files changed

+10
-14
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
env:
1111
NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test.
12-
NPY_DISABLE_CPU_FEATURES: "AVX512F,AVX512CD,AVX512VL,AVX512BW,AVX512DQ,AVX512_SKX"
1312
OPENBLAS_NUM_THREADS: 1
1413
PYTHONFAULTHANDLER: 1
1514

azure-pipelines.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ stages:
126126
displayName: 'print env'
127127

128128
- bash: |
129-
export NPY_DISABLE_CPU_FEATURES="AVX512F,AVX512CD,AVX512VL,AVX512BW,AVX512DQ,AVX512_SKX"
130129
PYTHONFAULTHANDLER=1 python -m pytest --junitxml=junit/test-results.xml -raR --maxfail=50 --timeout=300 --durations=25 --cov-report= --cov=lib -n 2 ||
131130
[[ "$PYTHON_VERSION" = 'Pre' ]]
132131
displayName: 'pytest'

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3326,7 +3326,9 @@ def test_tick_space_size_0():
33263326

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

33323334
yerr = 0.1 + 0.2*np.sqrt(x)

lib/matplotlib/tests/test_backend_tk.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def test_func():
3636
try:
3737
proc = subprocess.run(
3838
[sys.executable, "-c", f"{source}\n{func.__name__}()"],
39-
env={**os.environ, "MPLBACKEND": "TkAgg",
40-
"NPY_DISABLE_CPU_FEATURES": ""},
39+
env={**os.environ, "MPLBACKEND": "TkAgg"},
4140
timeout=_test_timeout,
4241
stdout=subprocess.PIPE,
4342
stderr=subprocess.PIPE,

lib/matplotlib/tests/test_sphinxext.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ def test_tinypages(tmpdir):
2828
# coverage anyways); hide them using GCOV_ERROR_FILE.
2929
proc = Popen(
3030
cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True,
31-
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull,
32-
"NPY_DISABLE_CPU_FEATURES": ""})
31+
env={**os.environ, "MPLBACKEND": "", "GCOV_ERROR_FILE": os.devnull})
3332
out, err = proc.communicate()
3433

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

136134
assert proc.returncode == 0, \

lib/matplotlib/tests/test_streamplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_maxlength():
7878

7979

8080
@image_comparison(['streamplot_direction.png'],
81-
remove_text=True, style='mpl20', tol=0.056)
81+
remove_text=True, style='mpl20', tol=0.073)
8282
def test_direction():
8383
x, y, U, V = swirl_velocity_field()
8484
plt.streamplot(x, y, U, V, integration_direction='backward',

lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_polar_box():
140140
ax1.grid(True)
141141

142142

143-
@image_comparison(['axis_direction.png'], style='default', tol=0.07)
143+
@image_comparison(['axis_direction.png'], style='default', tol=0.071)
144144
def test_axis_direction():
145145
# Remove this line when this test image is regenerated.
146146
plt.rcParams['text.kerning_factor'] = 6

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import functools
22
import itertools
3-
import platform
43

54
import pytest
65

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

549548

550-
@mpl3d_image_comparison(['trisurf3d.png'], tol=0.03)
549+
@mpl3d_image_comparison(['trisurf3d.png'], tol=0.061)
551550
def test_trisurf3d():
552551
n_angles = 36
553552
n_radii = 8
@@ -1367,7 +1366,7 @@ def test_errorbar3d():
13671366

13681367

13691368
@image_comparison(['stem3d.png'], style='mpl20',
1370-
tol=0.0 if platform.machine() == 'x86_64' else 0.003)
1369+
tol=0.003)
13711370
def test_stem3d():
13721371
fig, axs = plt.subplots(2, 3, figsize=(8, 6),
13731372
constrained_layout=True,

0 commit comments

Comments
 (0)