Skip to content

Bugfix shape masking #6129

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

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ebee977
Updates to allow varying shape crs
hsteptoe Aug 22, 2024
e32f911
Ruff fixes
hsteptoe Aug 22, 2024
76eae38
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 22, 2024
bcdca30
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe Nov 22, 2024
9dab7c6
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe Dec 6, 2024
ebaa1ee
Adding rasterio as optional dependency
hsteptoe Dec 6, 2024
103e3d7
Adding rasterio functionality
hsteptoe Dec 19, 2024
3c65dab
First working version with rasterio
hsteptoe Dec 20, 2024
25de18d
Add further shape geometry checks
hsteptoe Jan 3, 2025
10e4413
Update shapefile tests
hsteptoe Jan 3, 2025
cd5cf99
Reorganise test fixtures
hsteptoe Jan 3, 2025
edc25cc
Reorganise test fixtures
hsteptoe Jan 3, 2025
789c98d
Fix fixture fetching
hsteptoe Jan 3, 2025
27a9025
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe Jan 3, 2025
dc090a5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 3, 2025
5b1054b
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe Feb 7, 2025
8948ce6
Recording Affine transform trials
hsteptoe Feb 13, 2025
a77c628
Working masking
hsteptoe Feb 14, 2025
1793e1f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 14, 2025
32ebef8
Merge branch 'main' into bugfix-shape-masking
hsteptoe Apr 4, 2025
b972c35
Linting and doc edits
hsteptoe Apr 4, 2025
9675c0f
Merge remote-tracking branch 'refs/remotes/origin/bugfix-shape-maskin…
hsteptoe Apr 4, 2025
458d9b7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 4, 2025
e28bea3
Merge branch 'main' into bugfix-shape-masking
hsteptoe May 16, 2025
4fcac0e
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe May 22, 2025
768af68
First-cut rewrite of masking by weight
hsteptoe May 23, 2025
b062e8e
Tidy function calls
hsteptoe May 23, 2025
b70fd1d
Working mask by weight
hsteptoe May 27, 2025
45f5324
Refactor create_shapefile_mask
hsteptoe May 28, 2025
3ded4fd
Passing tests for test_is_geometry_valid.py
hsteptoe May 30, 2025
89aad15
Minor geometry additions to test_is_geometry_valid.py
hsteptoe May 30, 2025
19365be
Working tests for transform_geometry
hsteptoe Jun 3, 2025
6251093
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 6, 2025
33c6b6e
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe Jul 1, 2025
b528b02
Complete draft units tests for transform_geometry
hsteptoe Jul 2, 2025
e803a3d
Complete draft units tests for create_shapefile_mask
hsteptoe Jul 2, 2025
c02bebc
Complete draft units tests for _make_raster_cube_transform
hsteptoe Jul 2, 2025
7b452cd
Complete draft units tests for is_geometry_valid
hsteptoe Jul 2, 2025
0ebb9af
Auto formatting fixes
hsteptoe Jul 2, 2025
417be29
Complete draft units tests for _get_weighted_mask
hsteptoe Jul 3, 2025
f91f26a
Merge branch 'bugfix-shape-masking' of github.com:hsteptoe/iris into …
hsteptoe Jul 3, 2025
dcb85f6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 3, 2025
df3e457
Merge branch 'main' into bugfix-shape-masking
hsteptoe Jul 3, 2025
df7c1a5
Remove def _get_mod_rebased_coord_bounds
hsteptoe Jul 3, 2025
42cca35
Update reqs to include affine package
hsteptoe Jul 3, 2025
24180a3
Linting edits
hsteptoe Jul 3, 2025
e322de4
Linting edits
hsteptoe Jul 3, 2025
e60f3ab
Add cube crs error checking
hsteptoe Jul 3, 2025
ab02993
Working integration tests for mask_cube_from_shapefie
hsteptoe Jul 4, 2025
f1c6c37
Working unit tests for mask_cube_from_shapefie
hsteptoe Jul 4, 2025
d2aa50a
Merge branch 'SciTools:main' into bugfix-shape-masking
hsteptoe Jul 4, 2025
42eed14
Merge branch 'bugfix-shape-masking' of github.com:hsteptoe/iris into …
hsteptoe Jul 4, 2025
f28f7b8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 4, 2025
55b4219
Further test tweaks
hsteptoe Jul 7, 2025
2b74b37
Merge branch 'bugfix-shape-masking' of github.com:hsteptoe/iris into …
hsteptoe Jul 7, 2025
ccb87bf
mypy fixes
hsteptoe Jul 7, 2025
c6d1acc
Update locks with rasterio and affine reqs
hsteptoe Jul 7, 2025
61c1fd4
Merge branch 'main' into bugfix-shape-masking
hsteptoe Jul 7, 2025
018b99b
Add whatsnew details
hsteptoe Jul 7, 2025
5d901c8
Merge branch 'bugfix-shape-masking' of github.com:hsteptoe/iris into …
hsteptoe Jul 7, 2025
b52a0d7
Add PROJ_NETWORK env variable fix
hsteptoe Jul 16, 2025
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
13 changes: 11 additions & 2 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ This document explains the changes made to Iris for this release
the behaviour when calling :attr:`iris.MeshCoord.points` and :attr:`MeshCoord.bounds`, which will return
real data but will leave the :class:`iris.MeshCoord` (and attached mesh) lazy. (:issue:`4757`, :pull:`6405`)

#. `@hsteptoe <https://github.com/hsteptoe>`_ and `@...`_ (reviewer) extended :func:`iris.util.mask_cube_from_shapefile`
to handle additional Point and Line shape types. This change also facilitates the use of shapefiles that
use a different projection system to the cube that they are being applied to, and makes performance improvements
to the mask weighting calculations. (:issue:`6126`, :pull:`6129`).

🐛 Bugs Fixed
=============
Expand Down Expand Up @@ -99,8 +103,9 @@ This document explains the changes made to Iris for this release
🔗 Dependencies
===============

#. N/A

#. `@hsteptoe <https://github.com/hsteptoe>`_ added `rasterio <https://rasterio.readthedocs.io/en/stable/index.html>`_
and `affiine <https://affine.readthedocs.io/en/latest/>`_ as a dependency for :func:`iris.util.mask_cube_from_shapefile`.
This is to support the new functionality of handling additional shapefiles and projections. (:issue:`6126`, :pull:`6129`)

📚 Documentation
================
Expand All @@ -114,6 +119,10 @@ This document explains the changes made to Iris for this release
:ref:`load-problems-explanation`, :ref:`filtering-warnings-explanation`.
(:pull:`6529`)

#. `@hsteptoe <https://github.com/hsteptoe>`_ added additional worked examples
to the :ref:`iris.util.mask_cube_from_shapefile` documentation, to demonstrate
how to use the function with different types of shapefiles. (:pull:`6129`)


💼 Internal
===========
Expand Down
Loading
Loading