attributes.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:ncagg 作者: 5tefan 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号