首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >条目回溯: tree2rec()获得意外的关键字参数‘root2hdf5’

条目回溯: tree2rec()获得意外的关键字参数‘root2hdf5’
EN

Stack Overflow用户
提问于 2014-03-16 15:47:56
回答 1查看 148关注 0票数 1

我安装了rootpy,并确保满足了列出的root2hdf5here要求。

当尝试在使用以下代码生成的简单根文件上运行root2hdf5时:

代码语言:javascript
复制
void tree1w() {
    // Create a Tree file tree1.root - create the file, the Tree and a few branches
    TFile f("tree1.root", "recreate");
    TTree t1("t1","a simple Tree with simple variables");
    Float_t px, py, pz;
    Double_t random;
    Int_t ev;
    t1.Branch("px", &px, "px/F");
    t1.Branch("py", &py, "py/F");
    t1.Branch("pz", &pz, "pz/F");
    t1.Branch("ev", &ev, "ev/I");

    // Fill the Tree
    for (Int_t i = 0; i < 10000; i++) {
        gRandom->Rannor(px, py);
        pz = px * px + py * py;
        random = gRandom->Rndm();
        ev = i;
        t1.Fill();
    }

    // Save the Tree; the file will be automatically closed
    // when going out of the function scope
    t1.Write();
}

我得到以下错误:

代码语言:javascript
复制
INFO:rootpy.root2hdf5] Converting tree1.root ...
INFO:rootpy.root2hdf5] Will convert 1 tree in this directory
INFO:rootpy.root2hdf5] Converting tree 't1' with 10000 entries ...
Traceback (most recent call last):
File "/Users/jamesmorad/Research/Apps/pylux/bin/root2hdf5", line 8, in <module>
load_entry_point('rootpy==0.7.1', 'console_scripts', 'root2hdf5')()
File "/Users/jamesmorad/Research/Apps/pylux/lib/python2.7/site-packages/rootpy/root2hdf5.py",
line 214, in main
selection=args.selection)
File "/Users/jamesmorad/Research/Apps/pylux/lib/python2.7/site-packages/rootpy/root2hdf5.py",
line 109, in convert
selection=selection)
TypeError: tree2rec() got an unexpected keyword argument 'entries'

我不太明白为什么我会看到这个错误,如果能帮助我让这个转换器正常工作,我将非常感激。

EN

回答 1

Stack Overflow用户

发布于 2014-03-17 11:20:03

安装最新的rootpy。抱歉,目前还没有新的标签,但是当使用较新版本的root_numpy时,您需要安装超过0.7.1版本的rootpy:

代码语言:javascript
复制
git clone git://github.com/rootpy/rootpy.git
cd rootpy; ./setup.py install --user
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22434346

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档