Skip to content

Commit faf0b2e

Browse files
committed
Added some TODO comments
1 parent 3f7779e commit faf0b2e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/iris/fileformats/netcdf/loader.py

+22
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,28 @@ def _get_cf_var_data(cf_var, filename):
215215
# See https://github.com/SciTools/iris/issues/4994 "Xarray bridge".
216216
result = cf_var._data_array
217217
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+
218240
# Determine size of array; however can't do this for variable length (VLEN)
219241
# arrays as the size of the array can only be known by reading the data.
220242
print(f'[CB] {cf_var}: type: {type(cf_var)}')

0 commit comments

Comments
 (0)