test_class_converter.py 文件源码

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

项目:sdaopt 作者: sgubianpm 项目源码 文件源码
def test_convert_func_calling():
    from benchmark.convert2r import GOClass2RConverter
    count = 0
    notok = 0
    for name, klass in goclass():
        print('Calling function: {0}'.format(name))
        count += 1
        try:
            gocc = GOClass2RConverter(klass)
            #with nostdout():
            res = gocc.fun(gocc.xglob)
            npt.assert_almost_equal(gocc.fglob, res[0], decimal=4)
        except Exception as e:
            print(e)
            notok += 1
            continue
    print("R func call that failed: {0} ratio: {1}".format(notok, (count-notok)*100/count))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号