utils.py 文件源码

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

项目:spyking-circus 作者: spyking-circus 项目源码 文件源码
def test_patch_for_similarities(params, extension):

    file_out_suff  = params.get('data', 'file_out_suff')
    template_file  = file_out_suff + '.templates%s.hdf5' %extension
    if os.path.exists(template_file):
        try:
            myfile = h5py.File(template_file, 'r', libver='latest')
            version = myfile.get('version')[0].decode('ascii')
            myfile.close()
        except Exception:
            version = None
    else:
        raise Exception('No templates found! Check suffix?')

    if version is not None:
        if (StrictVersion(version) >= StrictVersion('0.6.0')):
            return True
    else:
        print_and_log(["Version is below 0.6.0"], 'debug', logger)
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号