File tree 1 file changed +22
-0
lines changed
lib/iris/fileformats/netcdf
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,28 @@ def _get_cf_var_data(cf_var, filename):
215
215
# See https://github.com/SciTools/iris/issues/4994 "Xarray bridge".
216
216
result = cf_var ._data_array
217
217
else :
218
+ #####################
219
+ # ChrisB TODO:
220
+ # Ideally, we want to check the type of the netCDF variable; if it is a
221
+ # `netCDF4.VLType`
222
+ # The caveat on this that variable length string (str) data is still stored
223
+ # as a normal `netCDF4.Variable`
224
+ #
225
+ # The problem is that we cannot get to the underlying netCDF4 type from
226
+ # the Iris CFVar* classes.
227
+ #
228
+ # The lazy load also needs updating as it fails with the `str` type
229
+ # when decoding the dtype.
230
+ #
231
+ # psedo code:
232
+ # if not (isinstance(cf_var.'nc variable tpye', netCDF4.VLType) or
233
+ # cf_var.dtype is str) or
234
+ # cf_var.size * cf_var.dtype.itemsize <_LAZYVAR_MIN_BYTES:
235
+ # <load the data>
236
+ # else:
237
+ # <lazy load>
238
+ #####################
239
+
218
240
# Determine size of array; however can't do this for variable length (VLEN)
219
241
# arrays as the size of the array can only be known by reading the data.
220
242
print (f'[CB] { cf_var } : type: { type (cf_var )} ' )
You can’t perform that action at this time.
0 commit comments