File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -263,17 +263,21 @@ def test_grib_get_array():
263
263
assert np .array_equal (pl , pli )
264
264
pls = eccodes .codes_get_array (gid , "centre" , str )
265
265
assert pls == ["ecmf" ]
266
-
267
266
dvals = eccodes .codes_get_array (gid , "values" )
268
267
assert len (dvals ) == 138346
269
268
assert type (dvals [0 ]) == np .float64
269
+ eccodes .codes_release (gid )
270
+
271
+
272
+ def test_grib_get_array_single_precision ():
273
+ gid = eccodes .codes_grib_new_from_samples ("reduced_gg_pl_160_grib2" )
274
+
270
275
vals = eccodes .codes_get_array (gid , "values" , ktype = float )
271
276
assert type (vals [0 ]) == np .float64
272
277
fvals = eccodes .codes_get_array (gid , "values" , ktype = np .float32 )
273
278
assert type (fvals [0 ]) == np .float32
274
279
fvals = eccodes .codes_get_float_array (gid , "values" )
275
280
assert type (fvals [0 ]) == np .float32
276
-
277
281
eccodes .codes_release (gid )
278
282
279
283
You can’t perform that action at this time.
0 commit comments