-
Notifications
You must be signed in to change notification settings - Fork 316
Shapefile masking #5470
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
Merged
Merged
Shapefile masking #5470
Changes from 10 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
3b15cd2
Working draft of shapefile masking
acchamber 2ef0d15
Version of shapefile masking with tests and ready for preliminary review
acchamber 6d36d05
Updated tests with proper paths and skip_tests decorator
acchamber befb1e5
Merge branch 'main' into shapefile_masking
acchamber 6c2ef62
Merge branch 'main' into shapefile_masking
acchamber 7b28fcd
Merge branch 'main' into shapefile_masking
acchamber 6decedf
fixed some paths and removed broken code
acchamber d3b91d1
Merge branch 'SciTools:main' into shapefile_masking
acchamber d168f24
Added more tests and split into integration and unit tests. Testing w…
acchamber 4947ffb
Merge branch 'shapefile_masking' of https://github.com/acchamber/iris…
acchamber 1d05f63
responces to comments on utils.py for shapefile masking
acchamber ca363cc
tests actually pass now
acchamber 23f3640
Moved tests to correct locations and strted changes on _shapefiles.py
acchamber 57af617
some changes to _shapefiles to match review
acchamber 5ba0ebc
added setUp cases to tests
acchamber cce3f9b
moved test names to lower_case and added acknoledgment
acchamber 3ec7cc3
removed seperate guess_bounds function
acchamber 7baab21
updated structure to properly call coord names/coords when optimal
acchamber c0aa728
sphnix improvements to docstring
acchamber 44fe0cd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 28fcd44
commited dask map_blocks approach and some test improvements
acchamber 87cc28e
replaced bounds rebasing via modulus with vectorized version
acchamber 92d869f
Dask chunk control and some docstrings
acchamber 4b38611
Merge branch 'shapefile_masking' of https://github.com/acchamber/iris…
acchamber befceeb
reverted behaviour of modulus function to ASCEND and switcher argumen…
acchamber e391e43
edied tests to work with flipped argument order
acchamber 8b0e869
Improved optimisation by reading shapely docs properly and just using…
acchamber 194aabf
Docstring updates and a 4d integration test
acchamber 9521c2e
Merge branch 'main' into shapefile_masking
trexfeathers e89634b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 162bd45
Update lib/iris/_shapefiles.py
acchamber 07ab745
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e8a23b7
improving readability from martin
acchamber ea5be9c
Merge branch 'shapefile_masking' of https://github.com/acchamber/iris…
acchamber 64278ca
removed dask.delayed call
acchamber a46d7c9
Update lib/iris/_shapefiles.py
acchamber eca46c0
Update lib/iris/_shapefiles.py
acchamber 061b76b
Update lib/iris/util.py
acchamber cc6016b
Added warning for possible mismatch of mask/cube coords
acchamber 5e7d799
test for new warning
acchamber 440f049
added test
acchamber 3c13e1b
Update lib/iris/_shapefiles.py
acchamber 1e1d711
Added licenses
acchamber 22e2cf7
Merge branch 'shapefile_masking' of https://github.com/acchamber/iris…
acchamber 9cb96b9
fixed doctest failures in example
acchamber deb5ff9
Improved test coverage
acchamber 6eaa36b
fixed doctest
acchamber 3b7384f
doctest again
acchamber a0aec74
Docstring tidy up.
trexfeathers e13e757
Merge pull request #1 from trexfeathers/docstring_tidy
acchamber b76dabd
fixed prime meridian bug
acchamber ca380ed
Update lib/iris/_shapefiles.py
acchamber 0518a40
Merge branch 'main' into shapefile_masking
acchamber 404474f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b924795
Added first draft of user guide page
acchamber 4ab753a
Add What's New entry.
trexfeathers 84a8212
Merge pull request #2 from trexfeathers/shapefile_whatsnew
acchamber bf3c720
Merge branch 'SciTools:main' into shapefile_masking
acchamber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,221 @@ | ||
| # Copyright Iris contributors | ||
| # | ||
| # This file is part of Iris and is released under the LGPL license. | ||
| # See COPYING and COPYING.LESSER in the root of the repository for full | ||
| # licensing details. | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| import warnings | ||
|
|
||
| import numpy as np | ||
| import shapely | ||
| import shapely.errors | ||
| import shapely.geometry as sgeom | ||
| import shapely.ops | ||
| import shapely.prepared as prepped | ||
|
|
||
| from iris.exceptions import IrisUserWarning | ||
|
|
||
| # ------------------------------------------------------------------------------ | ||
| # GLOBAL VARIABLES | ||
| # ------------------------------------------------------------------------------ | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| def create_shapefile_mask( | ||
| geometry, cube, minimum_weight=0.0, shape_coord_system=None | ||
| ): | ||
| """Get the mask array of the intersection between the given shapely geometry and | ||
| cube. | ||
|
|
||
| Arguments: | ||
| geometry : A :class:`shapely.Geometry` object | ||
|
|
||
| cube : A :class:`iris.cube.Cube` | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| with x and y coordinates | ||
| minimum_weight : A float between 0 and 1 determining what % of a cell | ||
| a shape must cover for the cell to remain unmasked. | ||
| eg: 0.1 means that at least 10% of the shape overlaps the cell | ||
| to be unmasked | ||
|
|
||
| Returns: | ||
| A numpy array of the shape of the x & y coordinates of the cube, with points to mask equal to True | ||
| """ | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| from iris.cube import Cube, CubeList | ||
|
|
||
| try: | ||
| if geometry.is_valid is False: | ||
| raise TypeError("Geometry is not a valid Shapely object") | ||
| except Exception: | ||
| raise TypeError("Geometry is not a valid Shapely object") | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| if not isinstance(cube, Cube): | ||
| if isinstance(cube, CubeList): | ||
| msg = "Received CubeList object rather than Cube - to mask a CubeList iterate over each Cube" | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| raise TypeError(msg) | ||
| else: | ||
| msg = "Received non-Cube object where a Cube is expected" | ||
| raise TypeError(msg) | ||
| if not minimum_weight or minimum_weight == 0.0: | ||
| weights = False | ||
| elif isinstance( | ||
| geometry, | ||
| ( | ||
| sgeom.Point, | ||
| sgeom.LineString, | ||
| sgeom.LinearRing, | ||
| sgeom.MultiPoint, | ||
| sgeom.MultiLineString, | ||
| ), | ||
| ): | ||
| weights = False | ||
| warnings.warn( | ||
| "Shape is of invalid type for minimum weight masking, must use a Polygon rather than Line shape.\n Masking based off intersection instead. ", | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| IrisUserWarning, | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| ) | ||
| else: | ||
| weights = True | ||
|
|
||
| # prepare shape | ||
| trans_geo = _transform_coord_system(geometry, cube, shape_coord_system) | ||
| prepped.prep(trans_geo) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| # prepare 2D cube | ||
| y_name, x_name = _cube_primary_xy_coord_names(cube) | ||
|
trexfeathers marked this conversation as resolved.
|
||
| cube_2d = cube.slices([y_name, x_name]).next() | ||
| _cube_xy_guessbounds(cube_2d) | ||
| xmod = cube.coord(x_name).units.modulus | ||
| ymod = cube.coord(y_name).units.modulus | ||
| mask_template = np.zeros(cube_2d.shape, dtype=np.float64) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| # perform the masking | ||
| for count, idx in enumerate(np.ndindex(cube_2d.shape)): | ||
|
trexfeathers marked this conversation as resolved.
Outdated
trexfeathers marked this conversation as resolved.
Outdated
trexfeathers marked this conversation as resolved.
Outdated
|
||
| # get the bounds of the grid cell | ||
| xi = idx[cube_2d.coord_dims(x_name)[0]] | ||
| yi = idx[cube_2d.coord_dims(y_name)[0]] | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| x0, x1 = cube_2d.coord(x_name).bounds[xi] | ||
| y0, y1 = cube_2d.coord(y_name).bounds[yi] | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| if xmod: | ||
| x0, x1 = _rebase_values_to_modulus((x0, x1), xmod) | ||
| if ymod: | ||
| y0, y1 = _rebase_values_to_modulus((y0, y1), ymod) | ||
|
|
||
| # create a new polygon of the grid cell and check intersection | ||
| cell_box = sgeom.box(x0, y0, x1, y1) | ||
| intersect_bool = trans_geo.intersects(cell_box) | ||
| # mask all points without a intersection | ||
| if intersect_bool is False: | ||
| mask_template[idx] = True | ||
| # if weights method used, mask intersections below required weight | ||
| if intersect_bool is True and weights is True: | ||
| intersect_area = trans_geo.intersection(cell_box).area | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| if (intersect_area / cell_box.area) <= minimum_weight: | ||
| mask_template[idx] = True | ||
|
|
||
| return mask_template | ||
|
|
||
|
|
||
| def _transform_coord_system(geometry, cube, geometry_system=None): | ||
| """Project the shape onto another coordinate system. | ||
|
|
||
| Arguments: | ||
| target: The target :class:`iris.coord_systems.CoordSystem` | ||
| or a :class:`iris.cube.Cube` object defining the coordinate | ||
| system to which the shape should be transformed | ||
|
|
||
| Returns: | ||
| A transformed shape (copy) | ||
| """ | ||
| y_name, x_name = _cube_primary_xy_coord_names(cube) | ||
| DEFAULT_CS = _get_global_cs() | ||
| target_system = cube.coord_system() | ||
| if not target_system: | ||
| warnings.warn( | ||
| "Cube has no coord_system; using default GeogCS lat/lon", | ||
| IrisUserWarning, | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| ) | ||
| target_system = DEFAULT_CS | ||
| if geometry_system is None: | ||
| geometry_system = DEFAULT_CS | ||
| target_proj = target_system.as_cartopy_projection() | ||
| source_crs = geometry_system.as_cartopy_projection() | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| trans_geometry = target_proj.project_geometry(geometry, source_crs) | ||
| if target_system == DEFAULT_CS and cube.coord(x_name).points[-1] > 180: | ||
| trans_geometry = shapely.transform(trans_geometry, _trans_func) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| return trans_geometry | ||
|
|
||
|
|
||
| def _trans_func(geometry): | ||
| """pocket function for transforming the x coord of a geometry from -180 to 180 to 0-360""" | ||
| for point in geometry: | ||
| if point[0] < 0: | ||
| point[0] = 360 - np.abs(point[0]) | ||
| return geometry | ||
|
trexfeathers marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def _get_global_cs(): | ||
| """pocket function for returning the iris default coord system to avoid circular imports""" | ||
| import iris.fileformats.pp | ||
|
|
||
| DEFAULT_CS = iris.coord_systems.GeogCS(iris.fileformats.pp.EARTH_RADIUS) | ||
| return DEFAULT_CS | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| def _cube_primary_xy_coord_names(cube): | ||
| """Return the primary latitude and longitude coordinate standard names, or | ||
| long names, from a cube. | ||
|
|
||
| Arguments: | ||
| cube (:class:`iris.cube.Cube`): An Iris cube | ||
|
|
||
| Returns: | ||
| The names of the primary latitude and longitude coordinates | ||
| """ | ||
| latc = cube.coords(axis="y")[0] if cube.coords(axis="y") else -1 | ||
| lonc = cube.coords(axis="x")[0] if cube.coords(axis="x") else -1 | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| if -1 in (latc, lonc): | ||
| msg = "Error retrieving xy dimensions in cube: {!r}" | ||
| raise ValueError(msg.format(cube)) | ||
|
|
||
| latitude = latc.standard_name if latc.standard_name else latc.long_name | ||
| longitude = lonc.standard_name if lonc.standard_name else lonc.long_name | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| return latitude, longitude | ||
|
|
||
|
|
||
| def _cube_xy_guessbounds(cube): | ||
| """Guess latitude/longitude bounds of the cube and add them (**in place**) | ||
| if not present. | ||
|
|
||
| Arguments: | ||
| cube (:class:`iris.cube.Cube`): An Iris cube | ||
|
|
||
| Warning: | ||
| This function modifies the passed `cube` in place, adding bounds to the | ||
| latitude and longitude coordinates. | ||
| """ | ||
| for coord in _cube_primary_xy_coord_names(cube): | ||
| if not cube.coord(coord).has_bounds(): | ||
| cube.coord(coord).guess_bounds() | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| def _rebase_values_to_modulus(values, modulus): | ||
| """Rebase values to a modulus value. | ||
|
|
||
| Arguments: | ||
| values (list, tuple): The values to be re-based | ||
| modulus : The value to re-base to | ||
|
|
||
| Returns: | ||
| A list of re-based values. | ||
| """ | ||
| rebased = [] | ||
| for val in values: | ||
| nv = np.abs(val) % modulus | ||
| if val < 0.0: | ||
| nv *= -1.0 | ||
| if np.abs(nv - modulus) < 1e-10: | ||
| nv = 0.0 | ||
| rebased.append(nv) | ||
| return rebased | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
trexfeathers marked this conversation as resolved.
Outdated
trexfeathers marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| import math | ||
|
|
||
| import cartopy.io.shapereader as shpreader | ||
| import numpy as np | ||
|
|
||
| import iris | ||
| import iris.tests as tests | ||
| from iris.util import apply_shapefile | ||
|
|
||
|
|
||
| @tests.skip_data | ||
| class TestCubeMasking(tests.IrisTest): | ||
| ne_countries = shpreader.natural_earth( | ||
| resolution="10m", category="cultural", name="admin_0_countries" | ||
| ) | ||
| reader = shpreader.Reader(ne_countries) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| def testGlobal(self): | ||
| path = tests.get_data_path( | ||
| ["NetCDF", "global", "xyt", "SMALL_hires_wind_u_for_ipcc4.nc"] | ||
| ) | ||
| test_global = iris.load_cube(path) | ||
| ne_russia = [ | ||
| country.geometry | ||
| for country in self.reader.records() | ||
| if "Russia" in country.attributes["NAME_LONG"] | ||
| ][0] | ||
| masked_test = apply_shapefile(ne_russia, test_global) | ||
| print(np.sum(masked_test.data)) | ||
| assert math.isclose( | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| np.sum(masked_test.data), 76845.37, rel_tol=0.00001 | ||
| ), "Global data with Russia mask failed test" | ||
|
|
||
| def testRotated(self): | ||
| path = tests.get_data_path( | ||
| ["NetCDF", "rotated", "xy", "rotPole_landAreaFraction.nc"] | ||
| ) | ||
| test_rotated = iris.load_cube(path) | ||
| ne_germany = [ | ||
| country.geometry | ||
| for country in self.reader.records() | ||
| if "Germany" in country.attributes["NAME_LONG"] | ||
| ][0] | ||
| masked_test = apply_shapefile(ne_germany, test_rotated) | ||
| assert math.isclose( | ||
| np.sum(masked_test.data), 179.46872, rel_tol=0.00001 | ||
| ), "rotated europe data with German mask failed test" | ||
|
|
||
| def testTransverseMercator(self): | ||
| path = tests.get_data_path( | ||
| ["NetCDF", "transverse_mercator", "tmean_1910_1910.nc"] | ||
| ) | ||
| test_transverse = iris.load_cube(path) | ||
| ne_uk = [ | ||
| country.geometry | ||
| for country in self.reader.records() | ||
| if "United Kingdom" in country.attributes["NAME_LONG"] | ||
| ][0] | ||
| masked_test = apply_shapefile(ne_uk, test_transverse) | ||
| assert math.isclose( | ||
| np.sum(masked_test.data), 90740.25, rel_tol=0.00001 | ||
| ), "transverse mercator UK data with UK mask failed test" | ||
|
|
||
| def testRotatedWeighted(self): | ||
| path = tests.get_data_path( | ||
| ["NetCDF", "rotated", "xy", "rotPole_landAreaFraction.nc"] | ||
| ) | ||
| test_rotated = iris.load_cube(path) | ||
| ne_germany = [ | ||
| country.geometry | ||
| for country in self.reader.records() | ||
| if "Germany" in country.attributes["NAME_LONG"] | ||
| ][0] | ||
| masked_test = apply_shapefile( | ||
| ne_germany, test_rotated, minimum_weight=0.9 | ||
| ) | ||
| assert math.isclose( | ||
| np.sum(masked_test.data), 125.60199, rel_tol=0.00001 | ||
| ), "rotated europe data with 0.9 weight germany mask failed test" | ||
|
trexfeathers marked this conversation as resolved.
Outdated
trexfeathers marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| import numpy as np | ||
| import pytest | ||
| import shapely | ||
|
|
||
| from iris.coords import DimCoord | ||
| import iris.cube | ||
| from iris.exceptions import IrisUserWarning | ||
| import iris.tests as tests | ||
| from iris.util import apply_shapefile | ||
|
|
||
|
|
||
| class TestBasicCubeMasking(tests.IrisTest): | ||
| basic_data = np.array([[1, 2], [3, 4]]) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| basic_cube = iris.cube.Cube(basic_data) | ||
| coord = DimCoord( | ||
| np.array([0, 1]), | ||
| standard_name="projection_y_coordinate", | ||
| bounds=[[0, 0.5], [0.5, 1]], | ||
| units="1", | ||
| ) | ||
| basic_cube.add_dim_coord(coord, 0) | ||
| coord = DimCoord( | ||
| np.array([0, 1]), | ||
| standard_name="projection_x_coordinate", | ||
| bounds=[[0, 0.5], [0.5, 1]], | ||
| units="1", | ||
| ) | ||
| basic_cube.add_dim_coord(coord, 1) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| def testBasicCubeIntersect(self): | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| shape = shapely.geometry.box(0.6, 0.6, 1, 1) | ||
| masked_cube = apply_shapefile(shape, self.basic_cube) | ||
| assert ( | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| np.sum(masked_cube.data) == 4 | ||
| ), f"basic cube masking failed test - expected 4 got {np.sum(masked_cube.data)}" | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
|
|
||
| def testBasicCubeIntersectLowWeight(self): | ||
| shape = shapely.geometry.box(0.5, 0.5, 1, 1) | ||
| masked_cube = apply_shapefile( | ||
| shape, self.basic_cube, minimum_weight=0.2 | ||
| ) | ||
| assert ( | ||
| np.sum(masked_cube.data) == 4 | ||
| ), f"basic cube masking weighting failed test - expected 4 got {np.sum(masked_cube.data)}" | ||
|
|
||
| def testBasicCubeIntersectHighWeight(self): | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| shape = shapely.geometry.box(0.1, 0.6, 1, 1) | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| masked_cube = apply_shapefile( | ||
| shape, self.basic_cube, minimum_weight=0.5 | ||
| ) | ||
| assert ( | ||
| np.sum(masked_cube.data) == 7 | ||
| ), f"basic cube masking weighting failed test- expected 7 got {np.sum(masked_cube.data)}" | ||
|
|
||
| def testCubeListError(self): | ||
| cubelist = iris.cube.CubeList([self.basic_cube]) | ||
| shape = shapely.geometry.box(1, 1, 2, 2) | ||
| with pytest.raises( | ||
| TypeError, match="CubeList object rather than Cube" | ||
| ): | ||
| apply_shapefile(shape, cubelist) | ||
|
|
||
| def testNonCubeError(self): | ||
| fake = None | ||
| shape = shapely.geometry.box(1, 1, 2, 2) | ||
| with pytest.raises(TypeError, match="Received non-Cube object"): | ||
| apply_shapefile(shape, fake) | ||
|
|
||
| def testLineShapeWarning(self): | ||
| shape = shapely.geometry.LineString([(0, 0.75), (2, 0.75)]) | ||
| with pytest.warns(IrisUserWarning, match="invalid type"): | ||
| masked_cube = apply_shapefile( | ||
| shape, self.basic_cube, minimum_weight=0.1 | ||
| ) | ||
| assert ( | ||
| np.sum(masked_cube.data) == 7 | ||
| ), f"basic cube masking against line failed test - expected 7 got {np.sum(masked_cube.data)}" | ||
|
|
||
| def testShapeInvalid(self): | ||
| shape = None | ||
| with pytest.raises(TypeError): | ||
|
trexfeathers marked this conversation as resolved.
Outdated
|
||
| apply_shapefile(shape, self.basic_cube) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.