@@ -96,20 +96,20 @@ def test_fx_extraction(self):
96
96
var_name = 'volcello' ,
97
97
units = 'm3' ,
98
98
measure = 'volume' )
99
- ancillary_2D = iris .coords .AncillaryVariable (
99
+ ancillary_2d = iris .coords .AncillaryVariable (
100
100
area_data ,
101
101
standard_name = 'land_area_fraction' ,
102
102
var_name = 'sftlf' ,
103
103
units = '%' )
104
- ancillary_3D = iris .coords .AncillaryVariable (
104
+ ancillary_3d = iris .coords .AncillaryVariable (
105
105
volume_data ,
106
106
standard_name = 'height_above_reference_ellipsoid' ,
107
107
var_name = 'zfull' ,
108
108
units = 'm' )
109
109
self .cube .add_cell_measure (area_measure , (1 , 2 ))
110
110
self .cube .add_cell_measure (volume_measure , (0 , 1 , 2 ))
111
- self .cube .add_ancillary_variable (ancillary_2D , (1 , 2 ))
112
- self .cube .add_ancillary_variable (ancillary_3D , (0 , 1 , 2 ))
111
+ self .cube .add_ancillary_variable (ancillary_2d , (1 , 2 ))
112
+ self .cube .add_ancillary_variable (ancillary_3d , (0 , 1 , 2 ))
113
113
114
114
result = extract_levels (self .cube , levels , 'linear' )
115
115
@@ -123,9 +123,9 @@ def test_fx_extraction(self):
123
123
coord = self .cube .coord ('air_pressure' ).copy ()
124
124
expected .add_dim_coord (coord [levels ], 0 )
125
125
expected .add_cell_measure (area_measure , (1 , 2 ))
126
- expected .add_ancillary_variable (ancillary_2D , (1 , 2 ))
126
+ expected .add_ancillary_variable (ancillary_2d , (1 , 2 ))
127
127
expected .add_cell_measure (volume_measure [0 :2 , ...], (0 , 1 , 2 ))
128
- expected .add_ancillary_variable (ancillary_3D [0 :2 , ...], (0 , 1 , 2 ))
128
+ expected .add_ancillary_variable (ancillary_3d [0 :2 , ...], (0 , 1 , 2 ))
129
129
130
130
self .assertEqual (result , expected )
131
131
@@ -168,61 +168,61 @@ def test_interpolation(self):
168
168
# Check the _create_cube kwargs ...
169
169
self .assertEqual (kwargs , dict ())
170
170
171
- def test_preserve_2D_fx_interpolation (self ):
171
+ def test_preserve_2d_fx_interpolation (self ):
172
172
area_data = np .ones ((2 , 1 ))
173
173
area_measure = iris .coords .CellMeasure (area_data ,
174
174
standard_name = 'cell_area' ,
175
175
var_name = 'areacella' ,
176
176
units = 'm2' ,
177
177
measure = 'area' )
178
- ancillary_2D = iris .coords .AncillaryVariable (
178
+ ancillary_2d = iris .coords .AncillaryVariable (
179
179
area_data ,
180
180
standard_name = 'land_area_fraction' ,
181
181
var_name = 'sftlf' ,
182
182
units = '%' )
183
183
self .cube .add_cell_measure (area_measure , (1 , 2 ))
184
- self .cube .add_ancillary_variable (ancillary_2D , (1 , 2 ))
184
+ self .cube .add_ancillary_variable (ancillary_2d , (1 , 2 ))
185
185
result_data = np .array ([0 , 1 , 4 , 5 ], dtype = self .dtype ).reshape (2 , 2 , 1 )
186
186
result = _make_cube (result_data )
187
187
_preserve_fx_vars (self .cube , result )
188
188
self .assertEqual (self .cube .cell_measures (), result .cell_measures ())
189
189
self .assertEqual (self .cube .ancillary_variables (),
190
190
result .ancillary_variables ())
191
191
192
- def test_preserve_2D_fx_interpolation_single_level (self ):
192
+ def test_preserve_2d_fx_interpolation_single_level (self ):
193
193
result = self .cube [0 , :, :]
194
194
area_data = np .ones ((2 , 1 ))
195
195
area_measure = iris .coords .CellMeasure (area_data ,
196
196
standard_name = 'cell_area' ,
197
197
var_name = 'areacella' ,
198
198
units = 'm2' ,
199
199
measure = 'area' )
200
- ancillary_2D = iris .coords .AncillaryVariable (
200
+ ancillary_2d = iris .coords .AncillaryVariable (
201
201
area_data ,
202
202
standard_name = 'land_area_fraction' ,
203
203
var_name = 'sftlf' ,
204
204
units = '%' )
205
205
self .cube .add_cell_measure (area_measure , (1 , 2 ))
206
- self .cube .add_ancillary_variable (ancillary_2D , (1 , 2 ))
206
+ self .cube .add_ancillary_variable (ancillary_2d , (1 , 2 ))
207
207
_preserve_fx_vars (self .cube , result )
208
208
self .assertEqual (self .cube .cell_measures (), result .cell_measures ())
209
209
self .assertEqual (self .cube .ancillary_variables (),
210
210
result .ancillary_variables ())
211
211
212
- def test_do_not_preserve_3D_fx_interpolation (self ):
212
+ def test_do_not_preserve_3d_fx_interpolation (self ):
213
213
volume_data = np .ones (self .shape )
214
214
volume_measure = iris .coords .CellMeasure (volume_data ,
215
215
standard_name = 'ocean_volume' ,
216
216
var_name = 'volcello' ,
217
217
units = 'm3' ,
218
218
measure = 'volume' )
219
- ancillary_3D = iris .coords .AncillaryVariable (
219
+ ancillary_3d = iris .coords .AncillaryVariable (
220
220
volume_data ,
221
221
standard_name = 'height_above_reference_ellipsoid' ,
222
222
var_name = 'zfull' ,
223
223
units = 'm' )
224
224
self .cube .add_cell_measure (volume_measure , (0 , 1 , 2 ))
225
- self .cube .add_ancillary_variable (ancillary_3D , (0 , 1 , 2 ))
225
+ self .cube .add_ancillary_variable (ancillary_3d , (0 , 1 , 2 ))
226
226
result_data = np .array ([0 , 1 , 4 , 5 ], dtype = self .dtype ).reshape (2 , 2 , 1 )
227
227
result = _make_cube (result_data )
228
228
with self .assertLogs (level = 'WARNING' ) as cm :
0 commit comments