8000 TST: Increase some floating point datatypes and tolerances · matplotlib/matplotlib@3438672 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3438672

Browse files
committed
TST: Increase some floating point datatypes and tolerances
This is for floating point errors that crept in with AVX512 instruction sets on some CI architectures.
1 parent 357901a commit 3438672

File tree

4 files changed

+7
-6
lines changed
8000

4 files changed

+7
-6
lines changed

lib/matplotlib/tests/test_axes.py

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

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

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

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=T 8000 rue, 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

< 8000 button class="Button Button--iconOnly Button--invisible flex-shrink-0 js-expand-all-difflines-button" aria-label="Expand all lines: lib/mpl_toolkits/tests/test_mplot3d.py" data-file-path="lib/mpl_toolkits/tests/test_mplot3d.py" aria-describedby=":R4dpmlab:">
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
@@ -1369,7 +1368,7 @@ def test_errorbar3d():
13691368

13701369

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

0 commit comments

Comments
 (0)
0