If slc_files is an empty iterable, from_binary silently skips the read loop, slcs stays None, and the eventual ds.assign({vlabel: (("azimuth","range","time"), None)}) surfaces as:
ValueError: Variable 'complex': Could not convert tuple of form
(dims, data[, attrs, encoding]): (('azimuth', 'range', 'time'), None) to Variable.
It took me a while to trace this back to "no files were found". This is easy to hit when the user runs the tutorial notebook before downloading the dataset — path.rglob('*.raw') returns [] and the failure mode is opaque.
An early guard would make the failure obvious:
if len(slc_files) == 0:
raise ValueError("`slc_files` is empty; no SLC files to read.")
(Filed in the context of JOSS review openjournals/joss-reviews#10492.)
If
slc_filesis an empty iterable,from_binarysilently skips the read loop,slcsstaysNone, and the eventualds.assign({vlabel: (("azimuth","range","time"), None)})surfaces as:It took me a while to trace this back to "no files were found". This is easy to hit when the user runs the tutorial notebook before downloading the dataset —
path.rglob('*.raw')returns[]and the failure mode is opaque.An early guard would make the failure obvious:
(Filed in the context of JOSS review openjournals/joss-reviews#10492.)