-
Notifications
You must be signed in to change notification settings - Fork 296
Upgrade iris.util.mask_cube
#4889
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
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6eaf993
rewrite mask_cube
rcomer f1ea0c7
fix import problems
rcomer 028226d
simplify _unmask_mask and its tests
rcomer 88e70f0
parametrize not in place 1d _mask_array
rcomer 0c7bf35
pytest in-place _mask_array tests
rcomer 70f6bf2
pytest _mask_array broadcasting tests
rcomer 34ced78
remove iris.tests from test__mask_array
rcomer 3690f58
attempt to preserve metadata
rcomer fd9a6ef
pull masked array assertions off test class
rcomer 9c99e72
pytestify test__unmask_mask.py
rcomer 2fbc213
remove _unmask_mask; tweak test
rcomer b8b4c1f
numpydoc docstring
rcomer b2aebdd
add CML checks
rcomer d33aab2
preserve cube.metadata; add final CML
rcomer a7faa9d
path handling
rcomer 46b452f
get hold of _mask_array result
rcomer 3b0854a
more thorough in_place check
rcomer 9eb241b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 11d7642
review actions
rcomer 4fb113a
whatsnew
rcomer 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
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
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
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
23 changes: 23 additions & 0 deletions
23
lib/iris/tests/results/unit/util/mask_cube/TestCubeMask/mask_cube_2d_create_new_dim.cml
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,23 @@ | ||
<?xml version="1.0" ?> | ||
<cubes xmlns="urn:x-iris:cubeml-0.2"> | ||
<cube dtype="int32" long_name="thingness" units="1"> | ||
<coords> | ||
<coord datadims="[1]"> | ||
<dimCoord bounds="[[0, 5], | ||
[5, 10], | ||
[10, 15]]" id="434cbbd8" long_name="bar" points="[2.5, 7.5, 12.5]" shape="(3,)" units="Unit('1')" value_type="float64"/> | ||
</coord> | ||
<coord datadims="[0]"> | ||
<dimCoord id="cc587fe7" long_name="baz" points="[1]" shape="(1,)" units="Unit('unknown')" value_type="int64"/> | ||
</coord> | ||
<coord datadims="[2]"> | ||
<dimCoord bounds="[[-15, 0], | ||
[0, 15], | ||
[15, 30], | ||
[30, 45]]" id="b0d35dcf" long_name="foo" points="[-7.5, 7.5, 22.5, 37.5]" shape="(4,)" units="Unit('1')" value_type="float64"/> | ||
</coord> | ||
</coords> | ||
<cellMethods/> | ||
<data dtype="int32" shape="(1, 3, 4)" state="loaded"/> | ||
</cube> | ||
</cubes> |
123 changes: 123 additions & 0 deletions
123
lib/iris/tests/results/unit/util/mask_cube/original_cube_full2d_global.cml
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,123 @@ | ||
<?xml version="1.0" ?> | ||
<cubes xmlns="urn:x-iris:cubeml-0.2"> | ||
<cube dtype="float64" long_name="test_data" units="unknown"> | ||
<coords> | ||
<coord datadims="[0, 1]"> | ||
<auxCoord bounds="[[[-75.0, -75.0, -57.2567807439, -51.25], | ||
[-75.0, -75.0, -69.9122998144, -57.2567807439], | ||
[-75.0, -75.0, -81.2290044761, -69.9122998144], | ||
[-75.0, -75.0, -70.8808697668, -81.2290044761], | ||
[-75.0, -75.0, -57.9305320523, -70.8808697668], | ||
[-75.0, -75.0, -51.25, -57.9305320523]], | ||
|
||
[[-51.25, -57.2567807439, -21.7742578897, -13.75], | ||
[-57.2567807439, -69.9122998144, | ||
-35.7623963265, -21.7742578897], | ||
[-69.9122998144, -81.2290044761, | ||
-43.7403643588, -35.7623963265], | ||
[-81.2290044761, -70.8808697668, | ||
-36.6390269341, -43.7403643588], | ||
[-70.8808697668, -57.9305320523, | ||
-22.6232024783, -36.6390269341], | ||
[-57.9305320523, -51.25, -13.75, -22.6232024783]], | ||
|
||
[[-13.75, -21.7742578897, 14.6262783141, 23.75], | ||
[-21.7742578897, -35.7623963265, | ||
0.679347324478, 14.6262783141], | ||
[-35.7623963265, -43.7403643588, | ||
-6.24210578521, 0.679347324478], | ||
[-43.7403643588, -36.6390269341, | ||
-0.118134694909, -6.24210578521], | ||
[-36.6390269341, -22.6232024783, 13.7123678497, | ||
-0.118134694909], | ||
[-22.6232024783, -13.75, 23.75, 13.7123678497]], | ||
|
||
[[23.75, 14.6262783141, 50.4991340056, 61.25], | ||
[14.6262783141, 0.679347324478, 37.1021660611, | ||
50.4991340056], | ||
[0.679347324478, -6.24210578521, 31.2564224569, | ||
37.1021660611], | ||
[-6.24210578521, -3.18012024006, 33.8310998481, | ||
31.2564224569], | ||
[-0.118134694909, 13.7123678497, 49.5342960461, | ||
36.4057772393], | ||
[13.7123678497, 23.75, 61.25, 49.5342960461]], | ||
|
||
[[61.25, 50.4991340056, 75.0, 75.0], | ||
[50.4991340056, 37.1021660611, 75.0, 75.0], | ||
[37.1021660611, 31.2564224569, 75.0, 75.0], | ||
[31.2564224569, 36.4057772393, 75.0, 75.0], | ||
[36.4057772393, 49.5342960461, 75.0, 75.0], | ||
[49.5342960461, 61.25, 75.0, 75.0]]]" id="4a0cb9d8" points="[[-70.7961145738, -74.5203958604, -79.0476747448, | ||
-79.2595436524, -74.8389567751, -70.9599042785], | ||
[-34.989963491, -46.3517884836, -59.7214785713, | ||
-60.3401453215, -47.305395869, -35.499215647], | ||
[1.97619064066, -10.62625029, -22.8593242282, | ||
-23.3491023719, -11.5954827152, 1.36966775272], | ||
[38.9137083852, 25.5310373715, 14.3116992689, | ||
13.9163240699, 24.5854146491, 38.2153388581], | ||
[74.197139644, 60.2584740617, 51.3246020373, | ||
51.0162734782, 59.4458301418, 73.2683437807]]" shape="(5, 6)" standard_name="latitude" units="Unit('degrees')" value_type="float64"/> | ||
</coord> | ||
<coord datadims="[0, 1]"> | ||
<auxCoord bounds="[[[-60.0, -60.0, -17.2931062095, -60.0], | ||
[-60.0, -60.0, 24.742912764, -17.2931062095], | ||
[-60.0, -60.0, 115.04242743, 24.742912764], | ||
[-60.0, -60.0, -148.197462302, 115.04242743], | ||
[-60.0, -60.0, -105.228875389, -148.197462302], | ||
[-60.0, -60.0, -60.0, -105.228875389]], | ||
|
||
[[-60.0, -17.2931062095, -0.69097717571, -60.0], | ||
[-17.2931062095, 24.742912764, 53.4340192156, | ||
-0.69097717571], | ||
[24.742912764, 115.04242743, 117.724503302, | ||
53.4340192156], | ||
[115.04242743, -148.197462302, -177.360958845, | ||
117.724503302], | ||
[-148.197462302, -105.228875389, -122.73949261, | ||
-177.360958845], | ||
[-105.228875389, -60.0, -60.0, -122.73949261]], | ||
|
||
[[-60.0, -0.69097717571, 8.49948186949, -60.0], | ||
[-0.69097717571, 53.4340192156, 62.9255300111, | ||
8.49948186949], | ||
[53.4340192156, 117.724503302, 118.135773572, | ||
62.9255300111], | ||
[117.724503302, -177.360958845, 173.454869583, | ||
118.135773572], | ||
[-177.360958845, -122.73949261, -132.204171509, | ||
173.454869583], | ||
[-122.73949261, -60.0, -60.0, -132.204171509]], | ||
|
||
[[-60.0, 8.49948186949, 21.9836595677, -60.0], | ||
[8.49948186949, 62.9255300111, 72.5838679662, | ||
21.9836595677], | ||
[62.9255300111, 118.135773572, 118.483358091, | ||
72.5838679662], | ||
[118.135773572, 145.795321578, 141.390970654, | ||
118.483358091], | ||
[173.454869583, -132.204171509, -145.72980597, | ||
164.298583216], | ||
[-132.204171509, -60.0, -60.0, -145.72980597]], | ||
|
||
[[-60.0, 21.9836595677, 120.0, 120.0], | ||
[21.9836595677, 72.5838679662, 120.0, 120.0], | ||
[72.5838679662, 118.483358091, 120.0, 120.0], | ||
[118.483358091, 164.298583216, 120.0, 120.0], | ||
[164.298583216, -145.72980597, 120.0, 120.0], | ||
[-145.72980597, -60.0, 120.0, 120.0]]]" id="62e940e0" points="[[-50.7175447217, -40.9826266898, -46.7402097263, | ||
-71.9376144392, -79.2929666671, -70.1456599595], | ||
[-29.866905059, 17.6063897846, 77.9362302481, | ||
157.144794984, -141.037022232, -93.1717032401], | ||
[-23.1394301399, 31.0068937913, 87.6986169901, | ||
148.321662383, -154.638587706, -100.505003277], | ||
[-16.054306198, 41.2180029662, 92.7605422936, | ||
130.951355974, -164.738414415, -108.105216292], | ||
[10.8597790893, 61.7798829479, 100.236123084, | ||
137.284819331, 175.51112189, -135.445943914]]" shape="(5, 6)" standard_name="longitude" units="Unit('degrees')" value_type="float64"/> | ||
</coord> | ||
</coords> | ||
<cellMethods/> | ||
<data dtype="float64" shape="(5, 6)" state="loaded"/> | ||
</cube> | ||
</cubes> |
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.