From 6a5b7e5687d7bdc0bcecf03d83f95a2e7b02f89f Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 24 Oct 2022 22:58:42 -0400 Subject: [PATCH] TST: Increase fp tolerance on more tests for new NumPy This is similar to #22132 in that NumPy has added more code paths that now take advantage of AVX512 optimizations and causes slight variations in results. Fixes #24060 --- lib/matplotlib/tests/test_contour.py | 5 +++-- lib/matplotlib/tests/test_streamplot.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py index a8cd656b1fe5..e42206b8cb79 100644 --- a/lib/matplotlib/tests/test_contour.py +++ b/lib/matplotlib/tests/test_contour.py @@ -4,7 +4,8 @@ import contourpy import numpy as np -from numpy.testing import assert_array_almost_equal +from numpy.testing import ( + assert_array_almost_equal, assert_array_almost_equal_nulp) import matplotlib as mpl from matplotlib.testing.decorators import image_comparison from matplotlib import pyplot as plt, rc_context @@ -313,7 +314,7 @@ def test_contourf_log_extension(): cb = plt.colorbar(c1, ax=ax1) assert cb.ax.get_ylim() == (1e-8, 1e10) cb = plt.colorbar(c2, ax=ax2) - assert cb.ax.get_ylim() == (1e-4, 1e6) + assert_array_almost_equal_nulp(cb.ax.get_ylim(), np.array((1e-4, 1e6))) cb = plt.colorbar(c3, ax=ax3) diff --git a/lib/matplotlib/tests/test_streamplot.py b/lib/matplotlib/tests/test_streamplot.py index 5ee6df09e4b2..10a64f1d6968 100644 --- a/lib/matplotlib/tests/test_streamplot.py +++ b/lib/matplotlib/tests/test_streamplot.py @@ -34,7 +34,8 @@ def test_startpoints(): plt.plot(start_x, start_y, 'ok') -@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20') +@image_comparison(['streamplot_colormap'], remove_text=True, style='mpl20', + tol=0.022) def test_colormap(): X, Y, U, V = velocity_field() plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy