def finalize(self, nc_out):
# TODO: when primary is implemented, make sure to use primary min and max
# actually, do raise exceptions here, handle higher up
udim = next((d for d in self.config.dims.values() if d["max"] is not None), None)
if udim is None:
# bail early if udim is None, ie. no unlimited dim configured
return ""
max = udim["max"]
if isinstance(max, datetime):
return datetime_format(max)
else:
udim_indexed_by = udim["index_by"]
dt = nc.num2date(max, self.config.vars[udim_indexed_by]["attributes"]["units"])
return datetime_format(dt)
评论列表
文章目录