Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Merge c50b761 into a927f8f
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Doughty committed Jan 30, 2016
2 parents a927f8f + c50b761 commit 1747a9a
Show file tree
Hide file tree
Showing 7 changed files with 4,959 additions and 4,503 deletions.
7 changes: 5 additions & 2 deletions root_numpy/_tree.py
Expand Up @@ -37,21 +37,24 @@ def _glob(filenames):
return matches


def list_trees(filename):
def list_trees(filename, dirname=None):
"""Get list of the tree names in a ROOT file.
Parameters
----------
filename : str
Path to ROOT file.
dirname : str, optional (default=None)
Name of directory to search.
(Only required if multiple directories in file.)
Returns
-------
trees : list
List of tree names
"""
return _librootnumpy.list_trees(filename)
return _librootnumpy.list_trees(filename, dirname)


def list_branches(filename, treename=None):
Expand Down
5 changes: 5 additions & 0 deletions root_numpy/src/ROOT.pxi
Expand Up @@ -18,10 +18,15 @@ cdef extern from "TFile.h":
cdef extern from "TFile.h" namespace "TFile":
TFile* Open(const_char*, const_char*)

cdef extern from "TDirectoryFile.h":
cdef cppclass TDirectoryFile:
TList* GetListOfKeys()

cdef extern from "TKey.h":
cdef cppclass TKey:
const_char* GetName()
const_char* GetClassName()
TObject* ReadObj()

cdef extern from "TObjArray.h":
cdef cppclass TObjArray:
Expand Down

0 comments on commit 1747a9a

Please sign in to comment.