Skip to content
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

Make tests pass on macOS M2 #3256

Merged
merged 3 commits into from
Nov 1, 2023
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: 1 addition & 0 deletions tests/calc/test_thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def test_moist_lapse_starting_points(start, direction):

@pytest.mark.xfail(platform.machine() == 'aarch64',
reason='ValueError is not raised on aarch64')
@pytest.mark.xfail(platform.machine() == 'arm64', reason='ValueError is not raised on Mac M2')
@pytest.mark.xfail(sys.platform == 'win32', reason='solve_ivp() does not error on Windows')
@pytest.mark.xfail(packaging.version.parse(scipy.__version__) < packaging.version.parse('1.7'),
reason='solve_ivp() does not error on Scipy < 1.7')
Expand Down
13 changes: 8 additions & 5 deletions tests/interpolate/test_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,14 @@ def test_find_nn_triangles_point():
tri = Delaunay(pts)

tri_match = tri.find_simplex([4.5, 4.5])
nn = find_nn_triangles_point(tri, tri_match, [4.5, 4.5])

# Can't rely on simplex indices, so need to check point indices
truth = {(45, 55, 44), (55, 54, 44)}
assert {tuple(verts) for verts in tri.simplices[nn]} == truth
nn = find_nn_triangles_point(tri, tri_match, (4.5, 4.5))

# Can't rely on simplex indices or the order of points that define them,
# so need to be a bit more involved to check
truth = [{45, 55, 44}, {55, 54, 44}]
found = [set(verts) for verts in tri.simplices[nn]]
for s in truth:
assert s in found


def test_find_local_boundary():
Expand Down
16 changes: 8 additions & 8 deletions tests/plots/test_declarative.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_declarative_four_dims_error():
pc.draw()


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.092)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.093)
@needs_cartopy
def test_declarative_contour():
"""Test making a contour plot."""
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_declarative_contour():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=False, tolerance=0.093)
@pytest.mark.mpl_image_compare(remove_text=False, tolerance=0.094)
@needs_cartopy
def test_declarative_titles():
"""Test making a contour plot with multiple titles."""
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_declarative_titles():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.072)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.098)
@needs_cartopy
def test_declarative_smooth_contour():
"""Test making a contour plot using smooth_contour."""
Expand Down Expand Up @@ -307,7 +307,7 @@ def test_declarative_smooth_field():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.708)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.828)
@needs_cartopy
def test_declarative_contour_cam():
"""Test making a contour plot with CAM data."""
Expand Down Expand Up @@ -335,7 +335,7 @@ def test_declarative_contour_cam():


@pytest.mark.mpl_image_compare(remove_text=True,
tolerance=3.71 if mpl_version_before('3.8') else 0.026)
tolerance=3.71 if mpl_version_before('3.8') else 0.74)
@needs_cartopy
def test_declarative_contour_options():
"""Test making a contour plot."""
Expand Down Expand Up @@ -396,7 +396,7 @@ def test_declarative_layers_plot_options():


@pytest.mark.mpl_image_compare(remove_text=True,
tolerance=2.74 if mpl_version_before('3.8') else 0.014)
tolerance=2.74 if mpl_version_before('3.8') else 1.91)
@needs_cartopy
def test_declarative_contour_convert_units():
"""Test making a contour plot."""
Expand Down Expand Up @@ -426,7 +426,7 @@ def test_declarative_contour_convert_units():
return pc.figure


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.247)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.276)
@needs_cartopy
def test_declarative_events():
"""Test that resetting traitlets properly propagates."""
Expand Down Expand Up @@ -568,7 +568,7 @@ def test_no_field_error_barbs():
barbs.draw()


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.378)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.381)
def test_projection_object(ccrs, cfeature):
"""Test that we can pass a custom map projection."""
data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))
Expand Down
2 changes: 1 addition & 1 deletion tests/plots/test_patheffects.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
StationaryFrontolysis, WarmFront, WarmFrontogenesis, WarmFrontolysis)


@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.)
@pytest.mark.mpl_image_compare(remove_text=True, tolerance=0.01)
def test_fronts():
"""Basic test of plotting fronts using path effects."""
x = np.linspace(0, 80, 5)
Expand Down