@@ -35,103 +35,98 @@ class TestQuadHex:
35
35
All four faces intersect a constant latitude of 0.0
36
36
"""
37
37
38
- @pytest .mark .parametrize ("use_spherical_bounding_box" , [True , False ])
39
- def test_constant_lat_cross_section_grid (self , use_spherical_bounding_box ):
40
-
41
-
38
+ def test_constant_lat_cross_section_grid (self ):
42
39
43
40
uxgrid = ux .open_grid (quad_hex_grid_path )
44
41
45
- grid_top_two = uxgrid .cross_section .constant_latitude (lat = 0.1 , use_spherical_bounding_box = use_spherical_bounding_box )
42
+ grid_top_two = uxgrid .cross_section .constant_latitude (lat = 0.1 , )
46
43
47
44
assert grid_top_two .n_face == 2
48
45
49
- grid_bottom_two = uxgrid .cross_section .constant_latitude (lat = - 0.1 , use_spherical_bounding_box = use_spherical_bounding_box )
46
+ grid_bottom_two = uxgrid .cross_section .constant_latitude (lat = - 0.1 , )
50
47
51
48
assert grid_bottom_two .n_face == 2
52
49
53
- grid_all_four = uxgrid .cross_section .constant_latitude (lat = 0.0 , use_spherical_bounding_box = use_spherical_bounding_box )
50
+ grid_all_four = uxgrid .cross_section .constant_latitude (lat = 0.0 , )
54
51
55
52
assert grid_all_four .n_face == 4
56
53
57
54
with pytest .raises (ValueError ):
58
55
# no intersections found at this line
59
- uxgrid .cross_section .constant_latitude (lat = 10.0 , use_spherical_bounding_box = use_spherical_bounding_box )
56
+ uxgrid .cross_section .constant_latitude (lat = 10.0 , )
60
57
61
- @pytest .mark .parametrize ("use_spherical_bounding_box" , [False ])
62
- def test_constant_lon_cross_section_grid (self , use_spherical_bounding_box ):
58
+ def test_constant_lon_cross_section_grid (self ):
63
59
uxgrid = ux .open_grid (quad_hex_grid_path )
64
60
65
- grid_left_two = uxgrid .cross_section .constant_longitude (lon = - 0.1 , use_spherical_bounding_box = use_spherical_bounding_box )
61
+ grid_left_two = uxgrid .cross_section .constant_longitude (lon = - 0.1 , )
66
62
67
63
assert grid_left_two .n_face == 2
68
64
69
- grid_right_two = uxgrid .cross_section .constant_longitude (lon = 0.2 , use_spherical_bounding_box = use_spherical_bounding_box )
65
+ grid_right_two = uxgrid .cross_section .constant_longitude (lon = 0.2 , )
70
66
71
67
assert grid_right_two .n_face == 2
72
68
73
69
with pytest .raises (ValueError ):
74
70
# no intersections found at this line
75
71
uxgrid .cross_section .constant_longitude (lon = 10.0 )
76
72
77
- @pytest .mark .parametrize ("use_spherical_bounding_box" , [False ])
78
- def test_constant_lat_cross_section_uxds (self , use_spherical_bounding_box ):
73
+ def test_constant_lat_cross_section_uxds (self ):
79
74
uxds = ux .open_dataset (quad_hex_grid_path , quad_hex_data_path )
80
75
uxds .uxgrid .normalize_cartesian_coordinates ()
81
76
82
- da_top_two = uxds ['t2m' ].cross_section .constant_latitude (lat = 0.1 , use_spherical_bounding_box = use_spherical_bounding_box )
77
+ da_top_two = uxds ['t2m' ].cross_section .constant_latitude (lat = 0.1 , )
83
78
84
79
nt .assert_array_equal (da_top_two .data , uxds ['t2m' ].isel (n_face = [1 , 2 ]).data )
85
80
86
- da_bottom_two = uxds ['t2m' ].cross_section .constant_latitude (lat = - 0.1 , use_spherical_bounding_box = use_spherical_bounding_box )
81
+ da_bottom_two = uxds ['t2m' ].cross_section .constant_latitude (lat = - 0.1 , )
87
82
88
83
nt .assert_array_equal (da_bottom_two .data , uxds ['t2m' ].isel (n_face = [0 , 3 ]).data )
89
84
90
- da_all_four = uxds ['t2m' ].cross_section .constant_latitude (lat = 0.0 , use_spherical_bounding_box = use_spherical_bounding_box )
85
+ da_all_four = uxds ['t2m' ].cross_section .constant_latitude (lat = 0.0 , )
91
86
92
87
nt .assert_array_equal (da_all_four .data , uxds ['t2m' ].data )
93
88
94
89
with pytest .raises (ValueError ):
95
90
# no intersections found at this line
96
- uxds ['t2m' ].cross_section .constant_latitude (lat = 10.0 , use_spherical_bounding_box = use_spherical_bounding_box )
91
+ uxds ['t2m' ].cross_section .constant_latitude (lat = 10.0 , )
92
+
97
93
98
- @pytest .mark .parametrize ("use_spherical_bounding_box" , [False ])
99
- def test_constant_lon_cross_section_uxds (self , use_spherical_bounding_box ):
94
+ def test_constant_lon_cross_section_uxds (self ):
100
95
uxds = ux .open_dataset (quad_hex_grid_path , quad_hex_data_path )
101
96
uxds .uxgrid .normalize_cartesian_coordinates ()
102
97
103
- da_left_two = uxds ['t2m' ].cross_section .constant_longitude (lon = - 0.1 , use_spherical_bounding_box = use_spherical_bounding_box )
98
+ da_left_two = uxds ['t2m' ].cross_section .constant_longitude (lon = - 0.1 , )
104
99
105
100
nt .assert_array_equal (da_left_two .data , uxds ['t2m' ].isel (n_face = [0 , 2 ]).data )
106
101
107
- da_right_two = uxds ['t2m' ].cross_section .constant_longitude (lon = 0.2 , use_spherical_bounding_box = use_spherical_bounding_box )
102
+ da_right_two = uxds ['t2m' ].cross_section .constant_longitude (lon = 0.2 , )
108
103
109
104
nt .assert_array_equal (da_right_two .data , uxds ['t2m' ].isel (n_face = [1 , 3 ]).data )
110
105
111
106
with pytest .raises (ValueError ):
112
107
# no intersections found at this line
113
- uxds ['t2m' ].cross_section .constant_longitude (lon = 10.0 , use_spherical_bounding_box = use_spherical_bounding_box )
108
+ uxds ['t2m' ].cross_section .constant_longitude (lon = 10.0 , )
114
109
115
110
116
111
class TestCubeSphere :
117
- @ pytest . mark . parametrize ( "use_spherical_bounding_box" , [ True , False ])
118
- def test_north_pole (self , use_spherical_bounding_box ):
112
+
113
+ def test_north_pole (self ):
119
114
uxgrid = ux .open_grid (cube_sphere_grid )
120
115
121
116
lats = [89.85 , 89.9 , 89.95 , 89.99 ]
122
117
123
118
for lat in lats :
124
- cross_grid = uxgrid .cross_section .constant_latitude (lat = lat , use_spherical_bounding_box = use_spherical_bounding_box )
119
+ cross_grid = uxgrid .cross_section .constant_latitude (lat = lat , )
125
120
# Cube sphere grid should have 4 faces centered around the pole
126
121
assert cross_grid .n_face == 4
127
- @ pytest . mark . parametrize ( "use_spherical_bounding_box" , [ True , False ])
128
- def test_south_pole (self , use_spherical_bounding_box ):
122
+
123
+ def test_south_pole (self ):
129
124
uxgrid = ux .open_grid (cube_sphere_grid )
130
125
131
126
lats = [- 89.85 , - 89.9 , - 89.95 , - 89.99 ]
132
127
133
128
for lat in lats :
134
- cross_grid = uxgrid .cross_section .constant_latitude (lat = lat , use_spherical_bounding_box = use_spherical_bounding_box )
129
+ cross_grid = uxgrid .cross_section .constant_latitude (lat = lat , )
135
130
# Cube sphere grid should have 4 faces centered around the pole
136
131
assert cross_grid .n_face == 4
137
132
@@ -152,8 +147,7 @@ def test_constant_lat(self):
152
147
153
148
candidate_faces = constant_lat_intersections_face_bounds (
154
149
lat = const_lat ,
155
- face_min_lat_rad = bounds_rad [:, 0 , 0 ],
156
- face_max_lat_rad = bounds_rad [:, 0 , 1 ],
150
+ face_bounds_lat = bounds_rad [:, 0 ],
157
151
)
158
152
159
153
# Expected output
@@ -176,8 +170,7 @@ def test_constant_lat_out_of_bounds(self):
176
170
177
171
candidate_faces = constant_lat_intersections_face_bounds (
178
172
lat = const_lat ,
179
- face_min_lat_rad = bounds_rad [:, 0 , 0 ],
180
- face_max_lat_rad = bounds_rad [:, 0 , 1 ],
173
+ face_bounds_lat = bounds_rad [:, 0 ],
181
174
)
182
175
183
176
assert len (candidate_faces ) == 0
0 commit comments