Skip to content
Draft
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 changelog/7299.internal.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix 1d-plot adjustment for line directions, for cartopy >= 0.26.
1 change: 1 addition & 0 deletions changelog/7299.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix shape-masking test for more stable results.
5 changes: 5 additions & 0 deletions lib/iris/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,11 @@ def _shift_plot_sections(u_object, u, v):
endpoints = points[1:, :2]
proj_x, proj_y, _ = tgt_proj.transform_points(src_crs, u, v).T

# Wrap proj_x into range -180..+180, as that's what the following logic needs.
# N.B. upto cartopy v0.26, this was true anyway, but has since changed.
# see : https://github.com/SciTools/cartopy/issues/2747
proj_x = (proj_x + 540.0) % 360.0 - 180.0

# Calculate the inverse geodesic for each pair of points in turn, and
# convert the start point's azimuth into a vector in the source coordinate
# system.
Expand Down
11 changes: 6 additions & 5 deletions lib/iris/tests/integration/_shapefiles/test_create_shape_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def square_polygon():

@pytest.fixture
def circle_polygon():
# Create a a circular polygon centred on (5,5) with radius (2,) using shapely
return Point(5, 5).buffer(2)
# Create a circular polygon centred on (5,5) with radius 2.1 using shapely
# - offset by 0.1 to avoid inclusion of some test points being 'marginal'
return Point(5, 5).buffer(2.1)


@pytest.fixture
Expand Down Expand Up @@ -149,10 +150,10 @@ def test_all_touched_true_create_shape_mask(circle_polygon, wgs84_crs, mock_cube
[1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 0, 0, 1, 1, 1],
[1, 1, 1, 0, 0, 0, 0, 1, 1],
[1, 1, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 0, 0, 0, 0, 1, 1],
[1, 1, 1, 0, 0, 0, 0, 1, 1],
[1, 1, 1, 0, 0, 0, 0, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 1, 1, 1, 0, 0, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1],
],
dtype=bool,
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/unit/plot/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def assert_paths_equal(self, expected, actual):
# Remove Path.STOP vertices
everts = expected.vertices[np.where(expected.codes != Path.STOP)]
averts = actual.vertices[np.where(actual.codes != Path.STOP)]
_shared_utils.assert_array_almost_equal(everts, averts)
_shared_utils.assert_array_almost_equal(everts, averts, decimal=5)
_shared_utils.assert_array_equal(expected.codes, actual.codes)

def check_paths(self, expected_path, expected_path_crs, lines, axes):
Expand Down
193 changes: 97 additions & 96 deletions requirements/locks/py312-linux-64.lock

Large diffs are not rendered by default.

191 changes: 96 additions & 95 deletions requirements/locks/py313-linux-64.lock

Large diffs are not rendered by default.

177 changes: 88 additions & 89 deletions requirements/locks/py314-linux-64.lock

Large diffs are not rendered by default.

Loading