diff --git a/root_numpy/_tree.py b/root_numpy/_tree.py index ab5bdbf..a063220 100644 --- a/root_numpy/_tree.py +++ b/root_numpy/_tree.py @@ -335,9 +335,8 @@ def tree2rec(tree, def array2tree(arr, name='tree', tree=None): """Convert a numpy structured array into a ROOT TTree. - .. warning:: - This function is experimental. Please report problems. - Not all data types are supported (``np.object`` and ``np.float16``). + Fields of basic types, strings, and fixed-size subarrays of basic types are + supported. ``np.object`` and ``np.float16`` are currently not supported. Parameters ---------- @@ -359,6 +358,26 @@ def array2tree(arr, name='tree', tree=None): -------- array2root + Examples + -------- + + >>> from root_numpy import array2tree + >>> import numpy as np + >>> + >>> a = np.array([(1, 2.5, 3.4), + ... (4, 5, 6.8)], + ... dtype=[('a', np.int32), + ... ('b', np.float32), + ... ('c', np.float64)]) + >>> tree = array2tree(a) + >>> tree.Scan() + ************************************************ + * Row * a * b * c * + ************************************************ + * 0 * 1 * 2.5 * 3.4 * + * 1 * 4 * 5 * 6.8 * + ************************************************ + """ import ROOT if tree is not None: @@ -374,9 +393,8 @@ def array2tree(arr, name='tree', tree=None): def array2root(arr, filename, treename='tree', mode='update'): """Convert a numpy array into a ROOT TTree and save it in a ROOT TFile. - .. warning:: - This function is experimental. Please report problems. - Not all data types are supported (``np.object`` and ``np.float16``). + Fields of basic types, strings, and fixed-size subarrays of basic types are + supported. ``np.object`` and ``np.float16`` are currently not supported. Parameters ---------- @@ -396,5 +414,36 @@ def array2root(arr, filename, treename='tree', mode='update'): -------- array2tree + Examples + -------- + + >>> from root_numpy import array2root, root2array + >>> import numpy as np + >>> + >>> a = np.array([(1, 2.5, 3.4), + ... (4, 5, 6.8)], + ... dtype=[('a', np.int32), + ... ('b', np.float32), + ... ('c', np.float64)]) + >>> array2root(a, 'test.root', mode='recreate') + >>> root2array('test.root') + array([(1, 2.5, 3.4), (4, 5.0, 6.8)], + dtype=[('a', '>> + >>> a = np.array(['', 'a', 'ab', 'abc', 'xyz', ''], + ... dtype=[('string', 'S3')]) + >>> array2root(a, 'test.root', mode='recreate') + >>> root2array('test.root') + array([('',), ('a',), ('ab',), ('abc',), ('xyz',), ('',)], + dtype=[('string', 'S3')]) + >>> + >>> a = np.array([([1, 2, 3],), + ... ([4, 5, 6],)], + ... dtype=[('array', np.int32, (3,))]) + >>> array2root(a, 'test.root', mode='recreate') + >>> root2array('test.root') + array([([1, 2, 3],), ([4, 5, 6],)], + dtype=[('array', 'GetNdata(); - value[0] = formula->EvalInstance(0); - return value; - } - - const char* GetTypeName() - { - return "double"; - } - - TTreeFormula* formula; - double* value; + FormulaColumn(std::string _name, TTreeFormula* _formula) + { + name = _name; + formula = _formula; + type = "Double_t"; + value = new double[1]; + } + + ~FormulaColumn() + { + delete[] value; + } + + int GetLen() + { + return 1; + } + + int GetCountLen() + { + return 1; + } + + int GetSize() + { + return sizeof(double) * GetLen(); + } + + void* GetValuePointer() + { + // required, as in TTreePlayer + formula->GetNdata(); + value[0] = formula->EvalInstance(0); + return value; + } + + const char* GetTypeName() + { + return "double"; + } + + TTreeFormula* formula; + double* value; }; @@ -77,56 +78,56 @@ class BranchColumn: public Column { public: - BranchColumn(std::string& _name, TLeaf* _leaf) - { - name = _name; - leaf = _leaf; - type = leaf->GetTypeName(); - } - - void SetLeaf(TLeaf* newleaf, bool check=false) + BranchColumn(std::string& _name, TLeaf* _leaf) + { + name = _name; + leaf = _leaf; + type = leaf->GetTypeName(); + } + + void SetLeaf(TLeaf* newleaf, bool check=false) + { + leaf = newleaf; + if (check) { - leaf = newleaf; - if (check) - { - assert(leaf->GetTypeName() == type); - // TODO: compare shape - } + assert(leaf->GetTypeName() == type); + // TODO: compare shape } - - int GetLen() + } + + int GetLen() + { + // get len of this block (in unit of element) + return leaf->GetLen(); + } + + int GetCountLen() + { + // get count leaf value + TLeaf* count_leaf = leaf->GetLeafCount(); + if (count_leaf != NULL) { - // get len of this block (in unit of element) - return leaf->GetLen(); + return int(count_leaf->GetValue()); } - - int GetCountLen() - { - // get count leaf value - TLeaf* count_leaf = leaf->GetLeafCount(); - if (count_leaf != NULL) - { - return int(count_leaf->GetValue()); - } - return 1; - } - - int GetSize() - { - // get size of this block in bytes - return leaf->GetLenType() * leaf->GetLen(); - } - - void* GetValuePointer() - { - return leaf->GetValuePointer(); - } - - const char* GetTypeName() - { - return leaf->GetTypeName(); - } - - TLeaf* leaf; + return 1; + } + + int GetSize() + { + // get size of this block in bytes + return leaf->GetLenType() * leaf->GetLen(); + } + + void* GetValuePointer() + { + return leaf->GetValuePointer(); + } + + const char* GetTypeName() + { + return leaf->GetTypeName(); + } + + TLeaf* leaf; }; #endif diff --git a/root_numpy/src/ROOT.pxi b/root_numpy/src/ROOT.pxi index 2edd9d3..943b309 100644 --- a/root_numpy/src/ROOT.pxi +++ b/root_numpy/src/ROOT.pxi @@ -52,6 +52,8 @@ cdef extern from "TLeaf.h": TLeaf* GetLeafCount() TLeaf* GetLeafCounter(int&) TBranch* GetBranch() + int GetLen() + int GetLenStatic() cdef extern from "TTree.h": cdef cppclass TTree: diff --git a/root_numpy/src/TreeChain.h b/root_numpy/src/TreeChain.h index 97d2122..aaf726d 100644 --- a/root_numpy/src/TreeChain.h +++ b/root_numpy/src/TreeChain.h @@ -47,272 +47,272 @@ class TreeChain { public: - TreeChain(TTree* fChain): - fChain(fChain), - ientry(0) - { - fCurrent = -1; - notifier = new MiniNotify(fChain->GetNotify()); - fChain->SetNotify(notifier); - } - - ~TreeChain() - { - fChain->SetNotify(notifier->oldnotify); + TreeChain(TTree* fChain): + fChain(fChain), + ientry(0) + { + fCurrent = -1; + notifier = new MiniNotify(fChain->GetNotify()); + fChain->SetNotify(notifier); + } - // Delete TTreeFormula - std::vector::iterator fit; - for (fit = formulae.begin(); fit != formulae.end(); ++fit) - { - delete *fit; - } + ~TreeChain() + { + fChain->SetNotify(notifier->oldnotify); - delete notifier; + // Delete TTreeFormula + std::vector::iterator fit; + for (fit = formulae.begin(); fit != formulae.end(); ++fit) + { + delete *fit; } - long Prepare() + delete notifier; + } + + long Prepare() + { + long load = LoadTree(0); + if (load < 0) { - long load = LoadTree(0); - if (load < 0) - { - return load; - } - // Enable all branches since we don't know yet which branches are - // required by the formulae. The branches must be activated when a - // TTreeFormula is initially created. - fChain->SetBranchStatus("*", true); - //fChain->SetCacheSize(10000000); return load; } + // Enable all branches since we don't know yet which branches are + // required by the formulae. The branches must be activated when a + // TTreeFormula is initially created. + fChain->SetBranchStatus("*", true); + //fChain->SetCacheSize(10000000); + return load; + } - long long LoadTree(long entry) + long long LoadTree(long entry) + { + long long load = fChain->LoadTree(entry); + if (load < 0) { - long long load = fChain->LoadTree(entry); - if (load < 0) - { - return load; - } - if (fChain->GetTreeNumber() != fCurrent) - { - fCurrent = fChain->GetTreeNumber(); - } - if (notifier->notified) - { - Notify(); - notifier->notified = false; - } return load; } - - void AddFormula(TTreeFormula* formula) + if (fChain->GetTreeNumber() != fCurrent) { - // The TreeChain will take ownership of the formula - formulae.push_back(formula); + fCurrent = fChain->GetTreeNumber(); } - - void InitBranches() + if (notifier->notified) { - // The branches must be activated when a TTreeFormula is initially created. - TBranch* branch; - TLeaf* leaf; - std::string bname, lname; - LeafCache::iterator it; + Notify(); + notifier->notified = false; + } + return load; + } - // Only the required branches will be added to the cache below - fChain->DropBranchFromCache("*", true); + void AddFormula(TTreeFormula* formula) + { + // The TreeChain will take ownership of the formula + formulae.push_back(formula); + } - for (it = leafcache.begin(); it != leafcache.end(); ++it) - { - bname = it->first.first; - lname = it->first.second; - branch = fChain->GetBranch(bname.c_str()); - leaf = branch->FindLeaf(lname.c_str()); + void InitBranches() + { + // The branches must be activated when a TTreeFormula is initially created. + TBranch* branch; + TLeaf* leaf; + std::string bname, lname; + LeafCache::iterator it; + + // Only the required branches will be added to the cache below + fChain->DropBranchFromCache("*", true); - // Make the branch active and cache it + for (it = leafcache.begin(); it != leafcache.end(); ++it) + { + bname = it->first.first; + lname = it->first.second; + branch = fChain->GetBranch(bname.c_str()); + leaf = branch->FindLeaf(lname.c_str()); + + // Make the branch active and cache it + branch->SetStatus(true); + fChain->AddBranchToCache(branch, true); + // and the length leaf as well + + // TODO: Does this work if user doesn't want the length column + // in the output structure? + TLeaf* leafCount = leaf->GetLeafCount(); + if (leafCount != NULL) + { + branch = leafCount->GetBranch(); branch->SetStatus(true); fChain->AddBranchToCache(branch, true); - // and the length leaf as well - - // TODO: Does this work if user doesn't want the length column - // in the output structure? - TLeaf* leafCount = leaf->GetLeafCount(); - if (leafCount != NULL) - { - branch = leafCount->GetBranch(); - branch->SetStatus(true); - fChain->AddBranchToCache(branch, true); - } } + } - // Activate all branches used by the formulae - int ncodes, n; - std::vector::iterator fit; - for (fit = formulae.begin(); fit != formulae.end(); ++fit) + // Activate all branches used by the formulae + int ncodes, n; + std::vector::iterator fit; + for (fit = formulae.begin(); fit != formulae.end(); ++fit) + { + ncodes = (*fit)->GetNcodes(); + for (n = 0; n < ncodes; ++n) { - ncodes = (*fit)->GetNcodes(); - for (n = 0; n < ncodes; ++n) - { - branch = (*fit)->GetLeaf(n)->GetBranch(); - // Branch may be a TObject split across multiple - // subbranches. These must be activated recursively. - activate_branch_recursive(branch); - fChain->AddBranchToCache(branch, true); - } + branch = (*fit)->GetLeaf(n)->GetBranch(); + // Branch may be a TObject split across multiple + // subbranches. These must be activated recursively. + activate_branch_recursive(branch); + fChain->AddBranchToCache(branch, true); } } + } - int GetEntry(long entry) + int GetEntry(long entry) + { + /* + In order to get performance comparable to TTreeFormula, we manually + iterate over the branches we need and call TBranch::GetEntry. This + is effectively the same procedure as TTree::GetEntry, except + TTree::GetEntry loops over ALL branches, not just those which are + active, and calls TBranch::GetEntry. While TBranch::GetEntry is a + no-op in the case that the branch is inactive, this iteration can + be a HUGE performance hit for TTrees with many branches, which is + why TTreeFormula doesn't use TTree::GetEntry and sees far better + performance. + + Note: The code in tree.pyx expects the return value of this + function to be non-0, because TTree::GetEntry normally picks up + those branches which are activate due to their membership in + formulae. In fact, it is perfectly legitimate for TTree::GetEntry + to return 0 without indicating an error, but to appease the + existing code, we'll call GetEntry on all branches with formula + membership, and it won't cost us anything since TTreeFormula won't + reload them. + */ + long load = LoadTree(entry); + if (load < 0) { - /* - In order to get performance comparable to TTreeFormula, we manually - iterate over the branches we need and call TBranch::GetEntry. This - is effectively the same procedure as TTree::GetEntry, except - TTree::GetEntry loops over ALL branches, not just those which are - active, and calls TBranch::GetEntry. While TBranch::GetEntry is a - no-op in the case that the branch is inactive, this iteration can - be a HUGE performance hit for TTrees with many branches, which is - why TTreeFormula doesn't use TTree::GetEntry and sees far better - performance. - - Note: The code in tree.pyx expects the return value of this - function to be non-0, because TTree::GetEntry normally picks up - those branches which are activate due to their membership in - formulae. In fact, it is perfectly legitimate for TTree::GetEntry - to return 0 without indicating an error, but to appease the - existing code, we'll call GetEntry on all branches with formula - membership, and it won't cost us anything since TTreeFormula won't - reload them. - */ - long load = LoadTree(entry); - if (load < 0) + return (int)load; + } + ientry = entry; + int total_read = 0; + int read, ncodes; + LeafCache::iterator lit, lend = leafcache.end(); + for (lit = leafcache.begin(); lit != lend; ++lit) + { + read = lit->second->leaf->GetBranch()->GetEntry(load); + if (read < 0) { - return (int)load; + return read; } - ientry = entry; - int total_read = 0; - int read, ncodes; - LeafCache::iterator lit, lend = leafcache.end(); - for (lit = leafcache.begin(); lit != lend; ++lit) + total_read += read; + } + std::vector::iterator fit, fend = formulae.end(); + for (fit = formulae.begin(); fit != fend; ++fit) + { + ncodes = (*fit)->GetNcodes(); + for (int n = 0; n < ncodes; ++n) { - read = lit->second->leaf->GetBranch()->GetEntry(load); + read = (*fit)->GetLeaf(n)->GetBranch()->GetEntry(load); if (read < 0) { return read; } total_read += read; } - std::vector::iterator fit, fend = formulae.end(); - for (fit = formulae.begin(); fit != fend; ++fit) - { - ncodes = (*fit)->GetNcodes(); - for (int n = 0; n < ncodes; ++n) - { - read = (*fit)->GetLeaf(n)->GetBranch()->GetEntry(load); - if (read < 0) - { - return read; - } - total_read += read; - } - } - return total_read; } + return total_read; + } - int Next() - { - return GetEntry(ientry++); - } + int Next() + { + return GetEntry(ientry++); + } - void Notify() - { - TBranch* branch; - TLeaf* leaf; - std::string bname, lname; + void Notify() + { + TBranch* branch; + TLeaf* leaf; + std::string bname, lname; - // Update all BranchColumn leaves - LeafCache::iterator it; - for(it = leafcache.begin(); it != leafcache.end(); ++it) + // Update all BranchColumn leaves + LeafCache::iterator it; + for(it = leafcache.begin(); it != leafcache.end(); ++it) + { + bname = it->first.first; + lname = it->first.second; + branch = fChain->FindBranch(bname.c_str()); + if (branch == NULL) { - bname = it->first.first; - lname = it->first.second; - branch = fChain->FindBranch(bname.c_str()); - if (branch == NULL) - { - std::cerr << "WARNING: cannot find branch " << bname - << std::endl; - continue; - } - leaf = branch->FindLeaf(lname.c_str()); - if (leaf == NULL) - { - std::cerr << "WARNING: cannot find leaf " << lname - << " for branch " << bname << std::endl; - continue; - } - it->second->SetLeaf(leaf, true); + std::cerr << "WARNING: cannot find branch " << bname + << std::endl; + continue; } - - // Update all formula leaves and activate all object subbranches - // used by the formulae - int ncodes, n; - std::vector::iterator fit; - for (fit = formulae.begin(); fit != formulae.end(); ++fit) + leaf = branch->FindLeaf(lname.c_str()); + if (leaf == NULL) { - (*fit)->UpdateFormulaLeaves(); - ncodes = (*fit)->GetNcodes(); - for (n = 0; n < ncodes; ++n) - { - branch = (*fit)->GetLeaf(n)->GetBranch(); - // Branch may be a TObject split across multiple - // subbranches. These must be activated recursively. - activate_branch_recursive(branch); - } + std::cerr << "WARNING: cannot find leaf " << lname + << " for branch " << bname << std::endl; + continue; } + it->second->SetLeaf(leaf, true); } - void AddColumn(const std::string& branch_name, - const std::string& leaf_name, - BranchColumn* column) + // Update all formula leaves and activate all object subbranches + // used by the formulae + int ncodes, n; + std::vector::iterator fit; + for (fit = formulae.begin(); fit != formulae.end(); ++fit) { - BL bl = make_pair(branch_name, leaf_name); - leafcache.insert(make_pair(bl, column)); + (*fit)->UpdateFormulaLeaves(); + ncodes = (*fit)->GetNcodes(); + for (n = 0; n < ncodes; ++n) + { + branch = (*fit)->GetLeaf(n)->GetBranch(); + // Branch may be a TObject split across multiple + // subbranches. These must be activated recursively. + activate_branch_recursive(branch); + } } + } - class MiniNotify: public TObject - { - public: - MiniNotify(TObject* oldnotify): - TObject(), - notified(false), - oldnotify(oldnotify){} + void AddColumn(const std::string& branch_name, + const std::string& leaf_name, + BranchColumn* column) + { + BL bl = make_pair(branch_name, leaf_name); + leafcache.insert(make_pair(bl, column)); + } - virtual Bool_t Notify() + class MiniNotify: public TObject + { + public: + MiniNotify(TObject* oldnotify): + TObject(), + notified(false), + oldnotify(oldnotify){} + + virtual Bool_t Notify() + { + notified = true; + if (oldnotify) { - notified = true; - if (oldnotify) - { - oldnotify->Notify(); - } - return true; + oldnotify->Notify(); } + return true; + } - bool notified; - TObject* oldnotify; - }; + bool notified; + TObject* oldnotify; + }; - TTree* fChain; - int fCurrent; - long ientry; - MiniNotify* notifier; - std::vector formulae; + TTree* fChain; + int fCurrent; + long ientry; + MiniNotify* notifier; + std::vector formulae; - // Branch name to leaf name association - typedef std::pair BL; - typedef std::map LeafCache; + // Branch name to leaf name association + typedef std::pair BL; + typedef std::map LeafCache; - // Column pointer cache to update leaves - // when new file is loaded in the chain - LeafCache leafcache; + // Column pointer cache to update leaves + // when new file is loaded in the chain + LeafCache leafcache; }; #endif diff --git a/root_numpy/src/_librootnumpy.cpp b/root_numpy/src/_librootnumpy.cpp index 779e34f..1716c7e 100644 --- a/root_numpy/src/_librootnumpy.cpp +++ b/root_numpy/src/_librootnumpy.cpp @@ -937,6 +937,9 @@ struct __pyx_t_13_librootnumpy_VaryArrayConverter; #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" struct __pyx_t_13_librootnumpy_FixedArrayConverter; +#line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" +struct __pyx_t_13_librootnumpy_CharArrayConverter; + #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" template @@ -965,21 +968,24 @@ struct __pyx_t_13_librootnumpy_VectorStringConverter; struct __pyx_t_13_librootnumpy_VectorVectorStringConverter; #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" -struct __pyx_opt_args_13_librootnumpy_get_tree_structure; +struct __pyx_t_13_librootnumpy_NP2ROOTConverter; #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" -struct __pyx_opt_args_13_librootnumpy_handle_load; +struct __pyx_t_13_librootnumpy_FixedNP2ROOTConverter; #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" -struct __pyx_t_13_librootnumpy_NP2CConverter; +struct __pyx_opt_args_21FixedNP2ROOTConverter___init__; #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" -struct __pyx_t_13_librootnumpy_ScalarNP2CConverter; +struct __pyx_opt_args_13_librootnumpy_get_tree_structure; + +#line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" +struct __pyx_opt_args_13_librootnumpy_handle_load; #line 766 "../../.local/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd" struct __pyx_opt_args_13_librootnumpy_array2tree; -/* "root_numpy/src/converters.pyx":432 +/* "root_numpy/src/converters.pyx":455 * * * cdef enum LeafShapeType: # <<<<<<<<<<<<<< @@ -987,19 +993,19 @@ struct __pyx_opt_args_13_librootnumpy_array2tree; * VARIABLE_LENGTH_ARRAY = 2 */ -#line 432 "root_numpy/src/converters.pyx" +#line 455 "root_numpy/src/converters.pyx" enum __pyx_t_13_librootnumpy_LeafShapeType { -#line 432 "root_numpy/src/converters.pyx" +#line 455 "root_numpy/src/converters.pyx" __pyx_e_13_librootnumpy_SINGLE_VALUE = 1, -#line 432 "root_numpy/src/converters.pyx" +#line 455 "root_numpy/src/converters.pyx" __pyx_e_13_librootnumpy_VARIABLE_LENGTH_ARRAY = 2, -#line 432 "root_numpy/src/converters.pyx" +#line 455 "root_numpy/src/converters.pyx" __pyx_e_13_librootnumpy_FIXED_LENGTH_ARRAY = 3 -#line 432 "root_numpy/src/converters.pyx" +#line 455 "root_numpy/src/converters.pyx" }; /* "root_numpy/src/converters.pyx":53 @@ -1007,7 +1013,7 @@ enum __pyx_t_13_librootnumpy_LeafShapeType { * # and write it to buffer * cdef inline int create_numpyarray(void* buffer, void* src, int typecode, # <<<<<<<<<<<<<< * unsigned long numele, int elesize, - * int ndim = 1, np.npy_intp* dims = NULL): + * int ndim=1, SIZE_t* dims=NULL): */ #line 53 "root_numpy/src/converters.pyx" @@ -1020,7 +1026,7 @@ struct __pyx_opt_args_13_librootnumpy_create_numpyarray { int ndim; #line 53 "root_numpy/src/converters.pyx" - npy_intp *dims; + __pyx_t_13_librootnumpy_SIZE_t *dims; #line 53 "root_numpy/src/converters.pyx" }; @@ -1092,14 +1098,14 @@ struct __pyx_t_13_librootnumpy_VaryArrayConverter : public __pyx_t_13_librootnum * * cdef cppclass VaryArrayConverter(ObjectConverterBase): # <<<<<<<<<<<<<< * BasicConverter* conv # converter for single element - * np.npy_intp* dims + * SIZE_t* dims */ #line 154 "root_numpy/src/converters.pyx" __pyx_t_13_librootnumpy_BasicConverter *conv; #line 154 "root_numpy/src/converters.pyx" - npy_intp *dims; + __pyx_t_13_librootnumpy_SIZE_t *dims; #line 154 "root_numpy/src/converters.pyx" int ndim; @@ -1111,7 +1117,7 @@ struct __pyx_t_13_librootnumpy_VaryArrayConverter : public __pyx_t_13_librootnum int elesize; #line 154 "root_numpy/src/converters.pyx" - __pyx_t_13_librootnumpy_VaryArrayConverter(__pyx_t_13_librootnumpy_BasicConverter *, int, npy_intp *); + __pyx_t_13_librootnumpy_VaryArrayConverter(__pyx_t_13_librootnumpy_BasicConverter *, int, __pyx_t_13_librootnumpy_SIZE_t *); virtual #line 154 "root_numpy/src/converters.pyx" ~__pyx_t_13_librootnumpy_VaryArrayConverter(void); @@ -1156,8 +1162,40 @@ int get_nptypecode(void); #line 178 "root_numpy/src/converters.pyx" }; +struct __pyx_t_13_librootnumpy_CharArrayConverter : public __pyx_t_13_librootnumpy_Converter +#line 178 "root_numpy/src/converters.pyx" + { + + /* "root_numpy/src/converters.pyx":202 + * + * + * cdef cppclass CharArrayConverter(Converter): # <<<<<<<<<<<<<< + * BasicConverter* conv # converter for single element + * int size + */ + +#line 202 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_BasicConverter *conv; + +#line 202 "root_numpy/src/converters.pyx" + int size; + +#line 202 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_CharArrayConverter(int); + virtual +#line 202 "root_numpy/src/converters.pyx" +int write(Column *, void *); + virtual +#line 202 "root_numpy/src/converters.pyx" +PyObject *get_nptype(void); + virtual +#line 202 "root_numpy/src/converters.pyx" +int get_nptypecode(void); + virtual ~__pyx_t_13_librootnumpy_CharArrayConverter() { } +#line 202 "root_numpy/src/converters.pyx" +}; -/* "root_numpy/src/converters.pyx":202 +/* "root_numpy/src/converters.pyx":225 * * * cdef cppclass VectorConverter[T](ObjectConverterBase): # <<<<<<<<<<<<<< @@ -1165,31 +1203,31 @@ int get_nptypecode(void); * int nptypecode */ -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" template struct __pyx_t_13_librootnumpy_VectorConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" { -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" int elesize; -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" int nptypecode; -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" Vector2Array v2a; -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" __pyx_t_13_librootnumpy_VectorConverter(void); virtual -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_VectorConverter() { } -#line 202 "root_numpy/src/converters.pyx" +#line 225 "root_numpy/src/converters.pyx" }; -/* "root_numpy/src/converters.pyx":222 +/* "root_numpy/src/converters.pyx":245 * * * cdef cppclass VectorVectorConverter[T](ObjectConverterBase): # <<<<<<<<<<<<<< @@ -1197,76 +1235,76 @@ int write(Column *, void *); * int nptypecode */ -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" template struct __pyx_t_13_librootnumpy_VectorVectorConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" { -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int elesize; -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int nptypecode; -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" Vector2Array v2a; -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" __pyx_t_13_librootnumpy_VectorVectorConverter(void); virtual -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_VectorVectorConverter() { } -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" }; struct __pyx_t_13_librootnumpy_VectorBoolConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" { virtual -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_VectorBoolConverter() { } -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" }; struct __pyx_t_13_librootnumpy_VectorVectorBoolConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" { virtual -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_VectorVectorBoolConverter() { } -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" }; struct __pyx_t_13_librootnumpy_StringConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" { virtual -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_StringConverter() { } -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" }; struct __pyx_t_13_librootnumpy_VectorStringConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" { virtual -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_VectorStringConverter() { } -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" }; struct __pyx_t_13_librootnumpy_VectorVectorStringConverter : public __pyx_t_13_librootnumpy_ObjectConverterBase -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" { virtual -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" int write(Column *, void *); virtual ~__pyx_t_13_librootnumpy_VectorVectorStringConverter() { } -#line 222 "root_numpy/src/converters.pyx" +#line 245 "root_numpy/src/converters.pyx" }; -/* "root_numpy/src/converters.pyx":352 +/* "root_numpy/src/converters.pyx":375 * * cdef cpp_map[string, Converter*] CONVERTERS * ctypedef pair[string, Converter*] CONVERTERS_ITEM # <<<<<<<<<<<<<< @@ -1274,8 +1312,83 @@ int write(Column *, void *); * # basic type converters */ -#line 352 "root_numpy/src/converters.pyx" +#line 375 "root_numpy/src/converters.pyx" typedef std::pair __pyx_t_13_librootnumpy_CONVERTERS_ITEM; +struct __pyx_t_13_librootnumpy_NP2ROOTConverter +#line 375 "root_numpy/src/converters.pyx" + { + virtual +#line 375 "root_numpy/src/converters.pyx" +void fill_from(void *); + virtual +#line 375 "root_numpy/src/converters.pyx" + ~__pyx_t_13_librootnumpy_NP2ROOTConverter(void); + + /* "root_numpy/src/converters.pyx":548 + * #################################### + * + * cdef cppclass NP2ROOTConverter: # <<<<<<<<<<<<<< + * + * void fill_from(void* source): + */ + +#line 548 "root_numpy/src/converters.pyx" +}; +struct __pyx_t_13_librootnumpy_FixedNP2ROOTConverter : public __pyx_t_13_librootnumpy_NP2ROOTConverter +#line 548 "root_numpy/src/converters.pyx" + { + + /* "root_numpy/src/converters.pyx":557 + * + * + * cdef cppclass FixedNP2ROOTConverter(NP2ROOTConverter): # <<<<<<<<<<<<<< + * int nbytes + * void* value + */ + +#line 557 "root_numpy/src/converters.pyx" + int nbytes; + +#line 557 "root_numpy/src/converters.pyx" + void *value; + +#line 557 "root_numpy/src/converters.pyx" + TBranch *branch; + +#line 557 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_FixedNP2ROOTConverter(TTree *, std::string, std::string, int, int, struct __pyx_opt_args_21FixedNP2ROOTConverter___init__ *__pyx_optional_args); + virtual +#line 557 "root_numpy/src/converters.pyx" +PyObject *__del__(PyObject *); + virtual +#line 557 "root_numpy/src/converters.pyx" +void fill_from(void *); + virtual ~__pyx_t_13_librootnumpy_FixedNP2ROOTConverter() { } +#line 557 "root_numpy/src/converters.pyx" +}; + +/* "root_numpy/src/converters.pyx":562 + * TBranch* branch + * + * __init__(TTree* tree, string name, string roottype, # <<<<<<<<<<<<<< + * int length, int elembytes, + * int ndim=0, SIZE_t* dims=NULL): + */ + +#line 562 "root_numpy/src/converters.pyx" +struct __pyx_opt_args_21FixedNP2ROOTConverter___init__ { + +#line 562 "root_numpy/src/converters.pyx" + int __pyx_n; + +#line 562 "root_numpy/src/converters.pyx" + int ndim; + +#line 562 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_SIZE_t *dims; + +#line 562 "root_numpy/src/converters.pyx" +}; /* "root_numpy/src/tree.pyx":65 * @@ -1316,86 +1429,28 @@ struct __pyx_opt_args_13_librootnumpy_handle_load { #line 86 "root_numpy/src/tree.pyx" }; -struct __pyx_t_13_librootnumpy_NP2CConverter -#line 86 "root_numpy/src/tree.pyx" - { - virtual -#line 86 "root_numpy/src/tree.pyx" -void fill_from(void *); - virtual -#line 86 "root_numpy/src/tree.pyx" - ~__pyx_t_13_librootnumpy_NP2CConverter(void); - - /* "root_numpy/src/tree.pyx":368 - * #################################### - * - * cdef cppclass NP2CConverter: # <<<<<<<<<<<<<< - * - * void fill_from(void* source): - */ - -#line 368 "root_numpy/src/tree.pyx" -}; -struct __pyx_t_13_librootnumpy_ScalarNP2CConverter : public __pyx_t_13_librootnumpy_NP2CConverter -#line 368 "root_numpy/src/tree.pyx" - { - - /* "root_numpy/src/tree.pyx":377 - * - * - * cdef cppclass ScalarNP2CConverter(NP2CConverter): # <<<<<<<<<<<<<< - * int nbytes - * string roottype - */ - -#line 377 "root_numpy/src/tree.pyx" - int nbytes; - -#line 377 "root_numpy/src/tree.pyx" - std::string roottype; - -#line 377 "root_numpy/src/tree.pyx" - std::string name; - -#line 377 "root_numpy/src/tree.pyx" - void *value; - -#line 377 "root_numpy/src/tree.pyx" - TBranch *branch; - -#line 377 "root_numpy/src/tree.pyx" - __pyx_t_13_librootnumpy_ScalarNP2CConverter(TTree *, std::string, std::string, int); - virtual -#line 377 "root_numpy/src/tree.pyx" -PyObject *__del__(PyObject *); - virtual -#line 377 "root_numpy/src/tree.pyx" -void fill_from(void *); - virtual ~__pyx_t_13_librootnumpy_ScalarNP2CConverter() { } -#line 377 "root_numpy/src/tree.pyx" -}; -/* "root_numpy/src/tree.pyx":424 +/* "root_numpy/src/tree.pyx":373 * * * cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) except *: # <<<<<<<<<<<<<< - * cdef vector[NP2CConverter*] converters + * cdef vector[NP2ROOTConverter*] converters * cdef vector[int] posarray */ -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" struct __pyx_opt_args_13_librootnumpy_array2tree { -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" int __pyx_n; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" std::string name; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" TTree *tree; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" }; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 @@ -1502,6 +1557,12 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyOb static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list, int wraparound, int boundscheck); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); +#endif + +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ @@ -1523,12 +1584,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); #define __Pyx_PyObject_PopIndex(L, ix, is_signed, type, to_py_func) ( \ @@ -1572,6 +1627,19 @@ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +static CYTHON_INLINE int __Pyx_IterFinish(void); + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + +static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { + int result = PySequence_Contains(seq, item); + return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); +} + #include static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); @@ -1641,19 +1709,6 @@ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_IterFinish(void); - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); - #ifndef __PYX_FORCE_INIT_THREADS #define __PYX_FORCE_INIT_THREADS 0 #endif @@ -1876,11 +1931,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long valu static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *); -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value); static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); @@ -2125,12 +2182,12 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *, void static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(void *, std::vector *); /*proto*/ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorstring(void *, std::vector *); /*proto*/ static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_find_converter_by_typename(std::string); /*proto*/ -static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_get_converter(TLeaf *); /*proto*/ +static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_get_converter(TLeaf *, char); /*proto*/ +static __pyx_t_13_librootnumpy_NP2ROOTConverter *__pyx_f_13_librootnumpy_find_np2root_converter(TTree *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_13_librootnumpy_get_branch_structure(TBranch *); /*proto*/ static PyObject *__pyx_f_13_librootnumpy_get_tree_structure(TTree *, struct __pyx_opt_args_13_librootnumpy_get_tree_structure *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_13_librootnumpy_handle_load(int, struct __pyx_opt_args_13_librootnumpy_handle_load *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_13_librootnumpy_tree2array(TTree *, PyObject *, std::string, PyObject *, PyObject *, PyObject *, bool, std::string); /*proto*/ -static __pyx_t_13_librootnumpy_NP2CConverter *__pyx_f_13_librootnumpy_find_np2c_converter(TTree *, PyObject *, PyObject *); /*proto*/ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *, struct __pyx_opt_args_13_librootnumpy_array2tree *__pyx_optional_args); /*proto*/ static CYTHON_INLINE PyArrayObject *__pyx_f_13_librootnumpy_tonumpyarray(void *, int, int); /*proto*/ static PyObject *__pyx_f_13_librootnumpy__blockwise_inner_join(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ @@ -2154,15 +2211,15 @@ int __pyx_module_is_main__librootnumpy = 0; /* Implementation of '_librootnumpy' */ static PyObject *__pyx_builtin_ImportError; static PyObject *__pyx_builtin_range; +static PyObject *__pyx_builtin_MemoryError; +static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_AssertionError; static PyObject *__pyx_builtin_xrange; -static PyObject *__pyx_builtin_MemoryError; static PyObject *__pyx_pf_13_librootnumpy_cleanup(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_13_librootnumpy_2list_trees(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname); /* proto */ static PyObject *__pyx_pf_13_librootnumpy_4list_structures(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname, PyObject *__pyx_v_tree); /* proto */ @@ -2229,6 +2286,7 @@ static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arr static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ static char __pyx_k_B[] = "B"; +static char __pyx_k_C[] = "C"; static char __pyx_k_D[] = "D"; static char __pyx_k_F[] = "F"; static char __pyx_k_H[] = "H"; @@ -2266,10 +2324,11 @@ static char __pyx_k_h3[] = "h3"; static char __pyx_k_it[] = "it"; static char __pyx_k_np[] = "np"; static char __pyx_k_re[] = "re"; -static char __pyx_k__10[] = ", "; -static char __pyx_k__19[] = "_"; -static char __pyx_k__24[] = ""; -static char __pyx_k__25[] = "/"; +static char __pyx_k_0_d[] = "[{0:d}]"; +static char __pyx_k__11[] = "/"; +static char __pyx_k__12[] = ", "; +static char __pyx_k__21[] = "_"; +static char __pyx_k__26[] = ""; static char __pyx_k_arr[] = "arr"; static char __pyx_k_get[] = "get"; static char __pyx_k_idx[] = "idx"; @@ -2293,6 +2352,7 @@ static char __pyx_k_hist[] = "hist"; static char __pyx_k_int8[] = "int8"; static char __pyx_k_join[] = "join"; static char __pyx_k_keys[] = "keys"; +static char __pyx_k_kind[] = "kind"; static char __pyx_k_left[] = "left"; static char __pyx_k_long[] = "long"; static char __pyx_k_main[] = "__main__"; @@ -2305,6 +2365,8 @@ static char __pyx_k_stop[] = "stop"; static char __pyx_k_test[] = "__test__"; static char __pyx_k_tree[] = "tree"; static char __pyx_k_warn[] = "warn"; +static char __pyx_k_0_d_C[] = "[{0:d}]/C"; +static char __pyx_k_S_0_d[] = "S{0:d}"; static char __pyx_k_TTree[] = "TTree"; static char __pyx_k_TYPES[] = "TYPES"; static char __pyx_k_arr_2[] = "_arr"; @@ -2337,8 +2399,10 @@ static char __pyx_k_start[] = "start"; static char __pyx_k_strip[] = "strip"; static char __pyx_k_ttree[] = "ttree"; static char __pyx_k_uint8[] = "uint8"; +static char __pyx_k_utf_8[] = "utf-8"; static char __pyx_k_atexit[] = "atexit"; static char __pyx_k_double[] = "double"; +static char __pyx_k_encode[] = "encode"; static char __pyx_k_fields[] = "fields"; static char __pyx_k_fnames[] = "fnames"; static char __pyx_k_format[] = "format"; @@ -2396,6 +2460,7 @@ static char __pyx_k_register[] = "register"; static char __pyx_k_root_arr[] = "root_arr"; static char __pyx_k_root_mat[] = "root_mat"; static char __pyx_k_spline_2[] = "_spline"; +static char __pyx_k_subdtype[] = "subdtype"; static char __pyx_k_treename[] = "treename"; static char __pyx_k_warnings[] = "warnings"; static char __pyx_k_TypeError[] = "TypeError"; @@ -2438,7 +2503,6 @@ static char __pyx_k_IndexError[] = "IndexError"; static char __pyx_k_ValueError[] = "ValueError"; static char __pyx_k_array2root[] = "array2root"; static char __pyx_k_list_trees[] = "list_trees"; -static char __pyx_k_rpartition[] = "rpartition"; static char __pyx_k_vector_int[] = "vector"; static char __pyx_k_warnings_2[] = "_warnings"; static char __pyx_k_ImportError[] = "ImportError"; @@ -2513,6 +2577,7 @@ static char __pyx_k_vector_vector_long_long[] = "vector >"; static char __pyx_k_cannot_open_current_file[] = "cannot open current file"; static char __pyx_k_branches_is_an_empty_list[] = "branches is an empty list"; static char __pyx_k_vector_unsigned_long_long[] = "vector"; +static char __pyx_k_could_not_allocate_d_bytes[] = "could not allocate %d bytes"; static char __pyx_k_vector_vector_unsigned_int[] = "vector >"; static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; static char __pyx_k_vector_vector_unsigned_char[] = "vector >"; @@ -2548,8 +2613,11 @@ static char __pyx_k_unable_to_convert_any_branches_i[] = "unable to convert any static char __pyx_k_vector_vector_unsigned_long_long[] = "vector >"; static char __pyx_k_cannot_convert_leaf_0_of_branch_2[] = "cannot convert leaf '{0}' of branch '{1}' with type '{2}' (skipping)"; static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; +static PyObject *__pyx_kp_s_0_d; +static PyObject *__pyx_kp_s_0_d_C; static PyObject *__pyx_n_s_AssertionError; static PyObject *__pyx_n_s_B; +static PyObject *__pyx_n_b_C; static PyObject *__pyx_n_s_D; static PyObject *__pyx_n_s_F; static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; @@ -2569,6 +2637,7 @@ static PyObject *__pyx_n_s_RootNumpyUnconvertibleWarning; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_S; static PyObject *__pyx_n_s_SPECIAL_TYPEDEFS; +static PyObject *__pyx_kp_s_S_0_d; static PyObject *__pyx_n_s_TNtuple; static PyObject *__pyx_n_s_TTree; static PyObject *__pyx_n_s_TYPES; @@ -2576,10 +2645,9 @@ static PyObject *__pyx_n_s_TYPES_NUMPY2ROOT; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ULong64_t; static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_kp_s__10; -static PyObject *__pyx_n_b__19; -static PyObject *__pyx_kp_s__24; -static PyObject *__pyx_kp_s__25; +static PyObject *__pyx_kp_s__12; +static PyObject *__pyx_n_b__21; +static PyObject *__pyx_kp_s__26; static PyObject *__pyx_kp_s__6; static PyObject *__pyx_kp_s__8; static PyObject *__pyx_n_s_arr; @@ -2611,12 +2679,14 @@ static PyObject *__pyx_kp_s_cannot_open_file_0; static PyObject *__pyx_kp_s_cannot_read_0; static PyObject *__pyx_n_s_chain; static PyObject *__pyx_kp_s_chain_is_empty; +static PyObject *__pyx_n_b_char; static PyObject *__pyx_n_s_char; static PyObject *__pyx_n_s_cleanup; static PyObject *__pyx_n_s_clsname; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_compile; static PyObject *__pyx_kp_s_converter_for_r_is_not_implement; +static PyObject *__pyx_kp_s_could_not_allocate_d_bytes; static PyObject *__pyx_kp_s_could_not_compile_selection_expr; static PyObject *__pyx_kp_s_could_not_find_double_converter; static PyObject *__pyx_n_s_count_nonzero; @@ -2630,6 +2700,7 @@ static PyObject *__pyx_n_s_dtype; static PyObject *__pyx_n_s_dtypecode; static PyObject *__pyx_kp_s_duplicate_branches_requested; static PyObject *__pyx_n_s_empty; +static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_evaluate_f1; static PyObject *__pyx_n_s_evaluate_f2; @@ -2730,6 +2801,7 @@ static PyObject *__pyx_n_s_j; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_keys; +static PyObject *__pyx_n_s_kind; static PyObject *__pyx_n_s_l; static PyObject *__pyx_kp_s_leaf_list_for_branch_0_is_empty; static PyObject *__pyx_n_s_left; @@ -2775,7 +2847,6 @@ static PyObject *__pyx_n_s_root2array_fromFname; static PyObject *__pyx_n_s_root_arr; static PyObject *__pyx_n_s_root_hist; static PyObject *__pyx_n_s_root_mat; -static PyObject *__pyx_n_s_rpartition; static PyObject *__pyx_n_s_rtree; static PyObject *__pyx_n_s_s; static PyObject *__pyx_kp_s_s_0_9; @@ -2797,6 +2868,7 @@ static PyObject *__pyx_n_s_stop; static PyObject *__pyx_n_b_string; static PyObject *__pyx_n_s_strip; static PyObject *__pyx_n_s_structure; +static PyObject *__pyx_n_s_subdtype; static PyObject *__pyx_n_s_test; static PyObject *__pyx_kp_s_the_branch_or_expression_0_is_no; static PyObject *__pyx_kp_s_the_chain_is_not_initialized; @@ -2822,6 +2894,7 @@ static PyObject *__pyx_kp_s_unsigned_long; static PyObject *__pyx_kp_s_unsigned_long_long; static PyObject *__pyx_kp_s_unsigned_short; static PyObject *__pyx_n_s_update; +static PyObject *__pyx_kp_s_utf_8; static PyObject *__pyx_n_s_values; static PyObject *__pyx_kp_b_vector_bool; static PyObject *__pyx_kp_b_vector_char; @@ -2875,19 +2948,19 @@ static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__9; -static PyObject *__pyx_tuple__11; -static PyObject *__pyx_tuple__12; +static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; +static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; -static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__23; -static PyObject *__pyx_tuple__26; +static PyObject *__pyx_tuple__24; +static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__29; static PyObject *__pyx_tuple__30; @@ -3292,7 +3365,7 @@ static CYTHON_INLINE PyObject *__pyx_f_13_librootnumpy_resolve_type(char const * * # and write it to buffer * cdef inline int create_numpyarray(void* buffer, void* src, int typecode, # <<<<<<<<<<<<<< * unsigned long numele, int elesize, - * int ndim = 1, np.npy_intp* dims = NULL): + * int ndim=1, SIZE_t* dims=NULL): */ #line 53 "root_numpy/src/converters.pyx" @@ -3307,17 +3380,17 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *__pyx_v /* "root_numpy/src/converters.pyx":55 * cdef inline int create_numpyarray(void* buffer, void* src, int typecode, * unsigned long numele, int elesize, - * int ndim = 1, np.npy_intp* dims = NULL): # <<<<<<<<<<<<<< - * cdef np.npy_intp* _dims = dims - * cdef np.npy_intp default_dims[1] + * int ndim=1, SIZE_t* dims=NULL): # <<<<<<<<<<<<<< + * cdef SIZE_t* _dims = dims + * cdef SIZE_t default_dims[1] */ #line 55 "root_numpy/src/converters.pyx" - npy_intp *__pyx_v_dims = ((npy_intp *)NULL); - npy_intp *__pyx_v__dims + __pyx_t_13_librootnumpy_SIZE_t *__pyx_v_dims = ((__pyx_t_13_librootnumpy_SIZE_t *)NULL); + __pyx_t_13_librootnumpy_SIZE_t *__pyx_v__dims #line 55 "root_numpy/src/converters.pyx" ; - npy_intp __pyx_v_default_dims[1] + __pyx_t_13_librootnumpy_SIZE_t __pyx_v_default_dims[1] #line 55 "root_numpy/src/converters.pyx" ; PyArrayObject *__pyx_v_tmp = 0 @@ -3368,9 +3441,9 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *__pyx_v /* "root_numpy/src/converters.pyx":56 * unsigned long numele, int elesize, - * int ndim = 1, np.npy_intp* dims = NULL): - * cdef np.npy_intp* _dims = dims # <<<<<<<<<<<<<< - * cdef np.npy_intp default_dims[1] + * int ndim=1, SIZE_t* dims=NULL): + * cdef SIZE_t* _dims = dims # <<<<<<<<<<<<<< + * cdef SIZE_t default_dims[1] * if dims == NULL: */ @@ -3378,8 +3451,8 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *__pyx_v __pyx_v__dims = __pyx_v_dims; /* "root_numpy/src/converters.pyx":58 - * cdef np.npy_intp* _dims = dims - * cdef np.npy_intp default_dims[1] + * cdef SIZE_t* _dims = dims + * cdef SIZE_t default_dims[1] * if dims == NULL: # <<<<<<<<<<<<<< * _dims = default_dims * _dims[0] = numele; @@ -3392,7 +3465,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *__pyx_v if (__pyx_t_1) { /* "root_numpy/src/converters.pyx":59 - * cdef np.npy_intp default_dims[1] + * cdef SIZE_t default_dims[1] * if dims == NULL: * _dims = default_dims # <<<<<<<<<<<<<< * _dims[0] = numele; @@ -3519,7 +3592,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *__pyx_v * # and write it to buffer * cdef inline int create_numpyarray(void* buffer, void* src, int typecode, # <<<<<<<<<<<<<< * unsigned long numele, int elesize, - * int ndim = 1, np.npy_intp* dims = NULL): + * int ndim=1, SIZE_t* dims=NULL): */ #line 53 "root_numpy/src/converters.pyx" @@ -3560,7 +3633,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray(void *__pyx_v * # special treatment for vector * cdef inline int create_numpyarray_vectorbool(void* buffer, vector[bool]* src): # <<<<<<<<<<<<<< * cdef unsigned long numele = src.size() - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] */ #line 74 "root_numpy/src/converters.pyx" @@ -3571,7 +3644,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(vo unsigned long __pyx_v_numele #line 74 "root_numpy/src/converters.pyx" ; - npy_intp __pyx_v_dims[1] + __pyx_t_13_librootnumpy_SIZE_t __pyx_v_dims[1] #line 74 "root_numpy/src/converters.pyx" ; PyArrayObject *__pyx_v_tmp = 0 @@ -3601,7 +3674,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(vo * # special treatment for vector * cdef inline int create_numpyarray_vectorbool(void* buffer, vector[bool]* src): * cdef unsigned long numele = src.size() # <<<<<<<<<<<<<< - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; */ @@ -3610,7 +3683,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(vo /* "root_numpy/src/converters.pyx":77 * cdef unsigned long numele = src.size() - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; # <<<<<<<<<<<<<< * cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_BOOL, 0) * cdef PyObject* tmpobj = tmp # borrow ref @@ -3620,7 +3693,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(vo (__pyx_v_dims[0]) = __pyx_v_numele; /* "root_numpy/src/converters.pyx":78 - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; * cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_BOOL, 0) # <<<<<<<<<<<<<< * cdef PyObject* tmpobj = tmp # borrow ref @@ -3734,7 +3807,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(vo * # special treatment for vector * cdef inline int create_numpyarray_vectorbool(void* buffer, vector[bool]* src): # <<<<<<<<<<<<<< * cdef unsigned long numele = src.size() - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] */ #line 74 "root_numpy/src/converters.pyx" @@ -3775,7 +3848,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(vo * * cdef inline int create_numpyarray_vectorstring(void* buffer, vector[string]* src): # <<<<<<<<<<<<<< * cdef unsigned long numele = src.size() - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] */ #line 91 "root_numpy/src/converters.pyx" @@ -3786,7 +3859,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorstring( unsigned long __pyx_v_numele #line 91 "root_numpy/src/converters.pyx" ; - npy_intp __pyx_v_dims[1] + __pyx_t_13_librootnumpy_SIZE_t __pyx_v_dims[1] #line 91 "root_numpy/src/converters.pyx" ; int __pyx_v_objsize @@ -3830,7 +3903,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorstring( * * cdef inline int create_numpyarray_vectorstring(void* buffer, vector[string]* src): * cdef unsigned long numele = src.size() # <<<<<<<<<<<<<< - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; */ @@ -3839,7 +3912,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorstring( /* "root_numpy/src/converters.pyx":94 * cdef unsigned long numele = src.size() - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; # <<<<<<<<<<<<<< * cdef int objsize = np.dtype('O').itemsize * cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_OBJECT, 0) @@ -3849,7 +3922,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorstring( (__pyx_v_dims[0]) = __pyx_v_numele; /* "root_numpy/src/converters.pyx":95 - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< * cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_OBJECT, 0) @@ -4054,7 +4127,7 @@ static CYTHON_INLINE int __pyx_f_13_librootnumpy_create_numpyarray_vectorstring( * * cdef inline int create_numpyarray_vectorstring(void* buffer, vector[string]* src): # <<<<<<<<<<<<<< * cdef unsigned long numele = src.size() - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] */ #line 91 "root_numpy/src/converters.pyx" @@ -4715,7 +4788,7 @@ PyObject *__pyx_t_13_librootnumpy_ObjectConverterBase::get_nptypecode(void) { /* "root_numpy/src/converters.pyx":161 * int elesize * - * __init__(BasicConverter* conv, int ndim, np.npy_intp* dims): # <<<<<<<<<<<<<< + * __init__(BasicConverter* conv, int ndim, SIZE_t* dims): # <<<<<<<<<<<<<< * this.conv = conv * this.dims = dims */ @@ -4724,7 +4797,7 @@ PyObject *__pyx_t_13_librootnumpy_ObjectConverterBase::get_nptypecode(void) { #line 161 "root_numpy/src/converters.pyx" - __pyx_t_13_librootnumpy_VaryArrayConverter::__pyx_t_13_librootnumpy_VaryArrayConverter(__pyx_t_13_librootnumpy_BasicConverter *__pyx_v_conv, int __pyx_v_ndim, npy_intp *__pyx_v_dims) { + __pyx_t_13_librootnumpy_VaryArrayConverter::__pyx_t_13_librootnumpy_VaryArrayConverter(__pyx_t_13_librootnumpy_BasicConverter *__pyx_v_conv, int __pyx_v_ndim, __pyx_t_13_librootnumpy_SIZE_t *__pyx_v_dims) { __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -4733,7 +4806,7 @@ PyObject *__pyx_t_13_librootnumpy_ObjectConverterBase::get_nptypecode(void) { /* "root_numpy/src/converters.pyx":162 * - * __init__(BasicConverter* conv, int ndim, np.npy_intp* dims): + * __init__(BasicConverter* conv, int ndim, SIZE_t* dims): * this.conv = conv # <<<<<<<<<<<<<< * this.dims = dims * this.ndim = ndim @@ -4743,7 +4816,7 @@ PyObject *__pyx_t_13_librootnumpy_ObjectConverterBase::get_nptypecode(void) { this->conv = __pyx_v_conv; /* "root_numpy/src/converters.pyx":163 - * __init__(BasicConverter* conv, int ndim, np.npy_intp* dims): + * __init__(BasicConverter* conv, int ndim, SIZE_t* dims): * this.conv = conv * this.dims = dims # <<<<<<<<<<<<<< * this.ndim = ndim @@ -4792,7 +4865,7 @@ PyObject *__pyx_t_13_librootnumpy_ObjectConverterBase::get_nptypecode(void) { /* "root_numpy/src/converters.pyx":161 * int elesize * - * __init__(BasicConverter* conv, int ndim, np.npy_intp* dims): # <<<<<<<<<<<<<< + * __init__(BasicConverter* conv, int ndim, SIZE_t* dims): # <<<<<<<<<<<<<< * this.conv = conv * this.dims = dims */ @@ -5355,885 +5428,991 @@ int __pyx_t_13_librootnumpy_FixedArrayConverter::get_nptypecode(void) { #line 198 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":207 - * Vector2Array[T] v2a +/* "root_numpy/src/converters.pyx":206 + * int size * - * __init__(): # <<<<<<<<<<<<<< - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] + * __init__(int size): # <<<<<<<<<<<<<< + * this.conv = CONVERTERS['char'] + * this.size = size */ -#line 207 "root_numpy/src/converters.pyx" - +#line 206 "root_numpy/src/converters.pyx" -#line 207 "root_numpy/src/converters.pyx" -template -#line 207 "root_numpy/src/converters.pyx" - __pyx_t_13_librootnumpy_VectorConverter ::__pyx_t_13_librootnumpy_VectorConverter(void) { - TypeName __pyx_v_ast -#line 207 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_info = NULL -#line 207 "root_numpy/src/converters.pyx" -; +#line 206 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_CharArrayConverter::__pyx_t_13_librootnumpy_CharArrayConverter(int __pyx_v_size) { __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + std::string __pyx_t_1; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" __Pyx_RefNannySetupContext("", 0); - /* "root_numpy/src/converters.pyx":208 + /* "root_numpy/src/converters.pyx":207 * - * __init__(): - * cdef TypeName[T] ast = TypeName[T]() # <<<<<<<<<<<<<< - * info = TYPES[ast.name] - * this.elesize = info[1].itemsize - */ - -#line 208 "root_numpy/src/converters.pyx" - __pyx_v_ast = TypeName (); - - /* "root_numpy/src/converters.pyx":209 - * __init__(): - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] # <<<<<<<<<<<<<< - * this.elesize = info[1].itemsize - * this.nptypecode = info[2] - */ - -#line 209 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 209 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); - -#line 209 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_ast.name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 209 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 209 "root_numpy/src/converters.pyx" - __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - -#line 209 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); - -#line 209 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 209 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 209 "root_numpy/src/converters.pyx" - __pyx_v_info = __pyx_t_3; - -#line 209 "root_numpy/src/converters.pyx" - __pyx_t_3 = 0; - - /* "root_numpy/src/converters.pyx":210 - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] - * this.elesize = info[1].itemsize # <<<<<<<<<<<<<< - * this.nptypecode = info[2] + * __init__(int size): + * this.conv = CONVERTERS['char'] # <<<<<<<<<<<<<< + * this.size = size * */ -#line 210 "root_numpy/src/converters.pyx" - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - -#line 210 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); - -#line 210 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 210 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 210 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 210 "root_numpy/src/converters.pyx" - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 210 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 207 "root_numpy/src/converters.pyx" + __pyx_t_1 = __pyx_convert_string_from_py_std__string(__pyx_n_b_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 210 "root_numpy/src/converters.pyx" - this->elesize = __pyx_t_4; +#line 207 "root_numpy/src/converters.pyx" + this->conv = ((__pyx_t_13_librootnumpy_BasicConverter *)(__pyx_v_13_librootnumpy_CONVERTERS[__pyx_t_1])); - /* "root_numpy/src/converters.pyx":211 - * info = TYPES[ast.name] - * this.elesize = info[1].itemsize - * this.nptypecode = info[2] # <<<<<<<<<<<<<< + /* "root_numpy/src/converters.pyx":208 + * __init__(int size): + * this.conv = CONVERTERS['char'] + * this.size = size # <<<<<<<<<<<<<< * * int write(Column* col, void* buffer): */ -#line 211 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - -#line 211 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 211 "root_numpy/src/converters.pyx" - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 211 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 211 "root_numpy/src/converters.pyx" - this->nptypecode = __pyx_t_4; +#line 208 "root_numpy/src/converters.pyx" + this->size = __pyx_v_size; - /* "root_numpy/src/converters.pyx":207 - * Vector2Array[T] v2a + /* "root_numpy/src/converters.pyx":206 + * int size * - * __init__(): # <<<<<<<<<<<<<< - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] + * __init__(int size): # <<<<<<<<<<<<<< + * this.conv = CONVERTERS['char'] + * this.size = size */ -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" /* function exit code */ -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" goto __pyx_L0; -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" __pyx_L1_error:; -#line 207 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_1); - -#line 207 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_2); - -#line 207 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_3); - -#line 207 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("VectorConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 206 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("CharArrayConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 207 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_info); - -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 207 "root_numpy/src/converters.pyx" +#line 206 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":213 - * this.nptypecode = info[2] +/* "root_numpy/src/converters.pyx":210 + * this.size = size * * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[T]* tmp = col.GetValuePointer() - * cdef unsigned long numele = tmp.size() + * cdef int nbytes = col.GetSize() - sizeof(char) # exclude null-termination + * cdef int length = strlen( col.GetValuePointer()) */ -#line 213 "root_numpy/src/converters.pyx" - +#line 210 "root_numpy/src/converters.pyx" -#line 213 "root_numpy/src/converters.pyx" -template -#line 213 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_VectorConverter ::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::vector *__pyx_v_tmp -#line 213 "root_numpy/src/converters.pyx" -; - unsigned long __pyx_v_numele -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_CharArrayConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + int __pyx_v_nbytes +#line 210 "root_numpy/src/converters.pyx" ; - T *__pyx_v_fa -#line 213 "root_numpy/src/converters.pyx" + int __pyx_v_length +#line 210 "root_numpy/src/converters.pyx" ; -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" int __pyx_r; __Pyx_RefNannyDeclarations + int __pyx_t_1; -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":214 + /* "root_numpy/src/converters.pyx":211 * * int write(Column* col, void* buffer): - * cdef vector[T]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< - * cdef unsigned long numele = tmp.size() - * # check cython auto-generated code + * cdef int nbytes = col.GetSize() - sizeof(char) # exclude null-termination # <<<<<<<<<<<<<< + * cdef int length = strlen( col.GetValuePointer()) + * memcpy(buffer, col.GetValuePointer(), nbytes) */ -#line 214 "root_numpy/src/converters.pyx" - __pyx_v_tmp = ((std::vector *)__pyx_v_col->GetValuePointer()); +#line 211 "root_numpy/src/converters.pyx" + __pyx_v_nbytes = (__pyx_v_col->GetSize() - (sizeof(char))); - /* "root_numpy/src/converters.pyx":215 + /* "root_numpy/src/converters.pyx":212 * int write(Column* col, void* buffer): - * cdef vector[T]* tmp = col.GetValuePointer() - * cdef unsigned long numele = tmp.size() # <<<<<<<<<<<<<< - * # check cython auto-generated code - * # if it really does &((*tmp)[0]) + * cdef int nbytes = col.GetSize() - sizeof(char) # exclude null-termination + * cdef int length = strlen( col.GetValuePointer()) # <<<<<<<<<<<<<< + * memcpy(buffer, col.GetValuePointer(), nbytes) + * if length < nbytes: */ -#line 215 "root_numpy/src/converters.pyx" - __pyx_v_numele = __pyx_v_tmp->size(); +#line 212 "root_numpy/src/converters.pyx" + __pyx_v_length = strlen(((char *)__pyx_v_col->GetValuePointer())); - /* "root_numpy/src/converters.pyx":218 - * # check cython auto-generated code - * # if it really does &((*tmp)[0]) - * cdef T* fa = this.v2a.convert(tmp) # <<<<<<<<<<<<<< - * return create_numpyarray(buffer, fa, this.nptypecode, numele, this.elesize) - * + /* "root_numpy/src/converters.pyx":213 + * cdef int nbytes = col.GetSize() - sizeof(char) # exclude null-termination + * cdef int length = strlen( col.GetValuePointer()) + * memcpy(buffer, col.GetValuePointer(), nbytes) # <<<<<<<<<<<<<< + * if length < nbytes: + * memset(( buffer) + length, '\0', nbytes - length) */ -#line 218 "root_numpy/src/converters.pyx" - __pyx_v_fa = this->v2a.convert(__pyx_v_tmp); +#line 213 "root_numpy/src/converters.pyx" + memcpy(__pyx_v_buffer, __pyx_v_col->GetValuePointer(), __pyx_v_nbytes); - /* "root_numpy/src/converters.pyx":219 - * # if it really does &((*tmp)[0]) - * cdef T* fa = this.v2a.convert(tmp) - * return create_numpyarray(buffer, fa, this.nptypecode, numele, this.elesize) # <<<<<<<<<<<<<< + /* "root_numpy/src/converters.pyx":214 + * cdef int length = strlen( col.GetValuePointer()) + * memcpy(buffer, col.GetValuePointer(), nbytes) + * if length < nbytes: # <<<<<<<<<<<<<< + * memset(( buffer) + length, '\0', nbytes - length) + * return nbytes + */ + +#line 214 "root_numpy/src/converters.pyx" + __pyx_t_1 = ((__pyx_v_length < __pyx_v_nbytes) != 0); + +#line 214 "root_numpy/src/converters.pyx" + if (__pyx_t_1) { + + /* "root_numpy/src/converters.pyx":215 + * memcpy(buffer, col.GetValuePointer(), nbytes) + * if length < nbytes: + * memset(( buffer) + length, '\0', nbytes - length) # <<<<<<<<<<<<<< + * return nbytes * + */ + +#line 215 "root_numpy/src/converters.pyx" + memset((((char *)__pyx_v_buffer) + __pyx_v_length), '\x00', (__pyx_v_nbytes - __pyx_v_length)); + +#line 215 "root_numpy/src/converters.pyx" + goto __pyx_L3; + +#line 215 "root_numpy/src/converters.pyx" + } + +#line 215 "root_numpy/src/converters.pyx" + __pyx_L3:; + + /* "root_numpy/src/converters.pyx":216 + * if length < nbytes: + * memset(( buffer) + length, '\0', nbytes - length) + * return nbytes # <<<<<<<<<<<<<< * + * object get_nptype(): */ -#line 219 "root_numpy/src/converters.pyx" - __pyx_r = __pyx_f_13_librootnumpy_create_numpyarray(__pyx_v_buffer, __pyx_v_fa, this->nptypecode, __pyx_v_numele, this->elesize, NULL); +#line 216 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_v_nbytes; -#line 219 "root_numpy/src/converters.pyx" +#line 216 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/converters.pyx":213 - * this.nptypecode = info[2] + /* "root_numpy/src/converters.pyx":210 + * this.size = size * * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[T]* tmp = col.GetValuePointer() - * cdef unsigned long numele = tmp.size() + * cdef int nbytes = col.GetSize() - sizeof(char) # exclude null-termination + * cdef int length = strlen( col.GetValuePointer()) */ -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" /* function exit code */ -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" return __pyx_r; -#line 213 "root_numpy/src/converters.pyx" +#line 210 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":227 - * Vector2Array[T] v2a +/* "root_numpy/src/converters.pyx":218 + * return nbytes + * + * object get_nptype(): # <<<<<<<<<<<<<< + * return 'S{0:d}'.format(this.size) * - * __init__(): # <<<<<<<<<<<<<< - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] */ -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" -#line 227 "root_numpy/src/converters.pyx" -template +#line 218 "root_numpy/src/converters.pyx" +PyObject *__pyx_t_13_librootnumpy_CharArrayConverter::get_nptype(void) { -#line 227 "root_numpy/src/converters.pyx" - __pyx_t_13_librootnumpy_VectorVectorConverter ::__pyx_t_13_librootnumpy_VectorVectorConverter(void) { - TypeName __pyx_v_ast -#line 227 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_info = NULL -#line 227 "root_numpy/src/converters.pyx" -; +#line 218 "root_numpy/src/converters.pyx" + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 227 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("", 0); +#line 218 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("get_nptype", 0); - /* "root_numpy/src/converters.pyx":228 + /* "root_numpy/src/converters.pyx":219 * - * __init__(): - * cdef TypeName[T] ast = TypeName[T]() # <<<<<<<<<<<<<< - * info = TYPES[ast.name] - * this.elesize = info[1].itemsize - */ - -#line 228 "root_numpy/src/converters.pyx" - __pyx_v_ast = TypeName (); - - /* "root_numpy/src/converters.pyx":229 - * __init__(): - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] # <<<<<<<<<<<<<< - * this.elesize = info[1].itemsize - * this.nptypecode = info[2] + * object get_nptype(): + * return 'S{0:d}'.format(this.size) # <<<<<<<<<<<<<< + * + * int get_nptypecode(): */ -#line 229 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 229 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 219 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_r); -#line 229 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_ast.name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_S_0_d, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 229 "root_numpy/src/converters.pyx" +#line 219 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_2); -#line 229 "root_numpy/src/converters.pyx" - __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyInt_From_int(this->size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 229 "root_numpy/src/converters.pyx" +#line 219 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_3); -#line 229 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_4 = NULL; -#line 229 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 219 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { -#line 229 "root_numpy/src/converters.pyx" - __pyx_v_info = __pyx_t_3; +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); -#line 229 "root_numpy/src/converters.pyx" - __pyx_t_3 = 0; +#line 219 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_4)) { - /* "root_numpy/src/converters.pyx":230 - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] - * this.elesize = info[1].itemsize # <<<<<<<<<<<<<< - * this.nptypecode = info[2] - * - */ +#line 219 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); -#line 230 "root_numpy/src/converters.pyx" - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 219 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_4); -#line 230 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 219 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); -#line 230 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 219 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_2, function); -#line 230 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 219 "root_numpy/src/converters.pyx" + } -#line 230 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 219 "root_numpy/src/converters.pyx" + } -#line 230 "root_numpy/src/converters.pyx" - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 219 "root_numpy/src/converters.pyx" + if (!__pyx_t_4) { -#line 230 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 230 "root_numpy/src/converters.pyx" - this->elesize = __pyx_t_4; +#line 219 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "root_numpy/src/converters.pyx":231 - * info = TYPES[ast.name] - * this.elesize = info[1].itemsize - * this.nptypecode = info[2] # <<<<<<<<<<<<<< - * - * int write(Column* col, void* buffer): - */ +#line 219 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 231 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 219 "root_numpy/src/converters.pyx" + } else { -#line 231 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 231 "root_numpy/src/converters.pyx" - __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 219 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 231 "root_numpy/src/converters.pyx" +#line 219 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + +#line 219 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3); + +#line 219 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_3); + +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; + +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 219 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 219 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 219 "root_numpy/src/converters.pyx" + } + +#line 219 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 231 "root_numpy/src/converters.pyx" - this->nptypecode = __pyx_t_4; +#line 219 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_t_1; - /* "root_numpy/src/converters.pyx":227 - * Vector2Array[T] v2a +#line 219 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; + +#line 219 "root_numpy/src/converters.pyx" + goto __pyx_L0; + + /* "root_numpy/src/converters.pyx":218 + * return nbytes + * + * object get_nptype(): # <<<<<<<<<<<<<< + * return 'S{0:d}'.format(this.size) * - * __init__(): # <<<<<<<<<<<<<< - * cdef TypeName[T] ast = TypeName[T]() - * info = TYPES[ast.name] */ -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" /* function exit code */ -#line 227 "root_numpy/src/converters.pyx" - goto __pyx_L0; - -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" __pyx_L1_error:; -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_1); -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_2); -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_3); -#line 227 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("VectorVectorConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 218 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_4); + +#line 218 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_5); + +#line 218 "root_numpy/src/converters.pyx" + __Pyx_AddTraceback("CharArrayConverter.get_nptype", __pyx_clineno, __pyx_lineno, __pyx_filename); + +#line 218 "root_numpy/src/converters.pyx" + __pyx_r = 0; -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 227 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_info); +#line 218 "root_numpy/src/converters.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 227 "root_numpy/src/converters.pyx" +#line 218 "root_numpy/src/converters.pyx" + return __pyx_r; + +#line 218 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":233 - * this.nptypecode = info[2] +/* "root_numpy/src/converters.pyx":221 + * return 'S{0:d}'.format(this.size) + * + * int get_nptypecode(): # <<<<<<<<<<<<<< + * return this.conv.nptypecode * - * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[vector[T]]* tmp = col.GetValuePointer() - * # this will hold number of subvectors */ -#line 233 "root_numpy/src/converters.pyx" - +#line 221 "root_numpy/src/converters.pyx" -#line 233 "root_numpy/src/converters.pyx" -template -#line 233 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_VectorVectorConverter ::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::vector > *__pyx_v_tmp -#line 233 "root_numpy/src/converters.pyx" -; - unsigned long __pyx_v_numele -#line 233 "root_numpy/src/converters.pyx" -; - T *__pyx_v_fa -#line 233 "root_numpy/src/converters.pyx" -; - int __pyx_v_objsize -#line 233 "root_numpy/src/converters.pyx" -; - int __pyx_v_objtypecode -#line 233 "root_numpy/src/converters.pyx" -; - npy_intp __pyx_v_dims[1] -#line 233 "root_numpy/src/converters.pyx" -; - PyArrayObject *__pyx_v_outer = 0 -#line 233 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_outerobj -#line 233 "root_numpy/src/converters.pyx" -; - char *__pyx_v_dataptr -#line 233 "root_numpy/src/converters.pyx" -; - unsigned long __pyx_v_i -#line 233 "root_numpy/src/converters.pyx" -; +#line 221 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_CharArrayConverter::get_nptypecode(void) { -#line 233 "root_numpy/src/converters.pyx" +#line 221 "root_numpy/src/converters.pyx" int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - unsigned long __pyx_t_3; - unsigned long __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; -#line 233 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("write", 0); +#line 221 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("get_nptypecode", 0); - /* "root_numpy/src/converters.pyx":234 + /* "root_numpy/src/converters.pyx":222 + * + * int get_nptypecode(): + * return this.conv.nptypecode # <<<<<<<<<<<<<< + * * - * int write(Column* col, void* buffer): - * cdef vector[vector[T]]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< - * # this will hold number of subvectors - * cdef unsigned long numele */ -#line 234 "root_numpy/src/converters.pyx" - __pyx_v_tmp = ((std::vector > *)__pyx_v_col->GetValuePointer()); +#line 222 "root_numpy/src/converters.pyx" + __pyx_r = this->conv->nptypecode; - /* "root_numpy/src/converters.pyx":239 - * cdef T* fa - * # these are defined solely for the outer array wrapper - * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< - * cdef int objtypecode = np.NPY_OBJECT - * numele = tmp[0].size() +#line 222 "root_numpy/src/converters.pyx" + goto __pyx_L0; + + /* "root_numpy/src/converters.pyx":221 + * return 'S{0:d}'.format(this.size) + * + * int get_nptypecode(): # <<<<<<<<<<<<<< + * return this.conv.nptypecode + * */ -#line 239 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 221 "root_numpy/src/converters.pyx" -#line 239 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); -#line 239 "root_numpy/src/converters.pyx" - __pyx_t_2 = ((PyArray_Descr *)__pyx_t_1)->elsize; +#line 221 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 239 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 221 "root_numpy/src/converters.pyx" + __pyx_L0:; -#line 239 "root_numpy/src/converters.pyx" - __pyx_v_objsize = __pyx_t_2; +#line 221 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); - /* "root_numpy/src/converters.pyx":240 - * # these are defined solely for the outer array wrapper - * cdef int objsize = np.dtype('O').itemsize - * cdef int objtypecode = np.NPY_OBJECT # <<<<<<<<<<<<<< - * numele = tmp[0].size() - * # create an outer array container that dataptr points to, - */ +#line 221 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 240 "root_numpy/src/converters.pyx" - __pyx_v_objtypecode = NPY_OBJECT; +#line 221 "root_numpy/src/converters.pyx" +} - /* "root_numpy/src/converters.pyx":241 - * cdef int objsize = np.dtype('O').itemsize - * cdef int objtypecode = np.NPY_OBJECT - * numele = tmp[0].size() # <<<<<<<<<<<<<< - * # create an outer array container that dataptr points to, - * # containing pointers from create_numpyarray(). +/* "root_numpy/src/converters.pyx":230 + * Vector2Array[T] v2a + * + * __init__(): # <<<<<<<<<<<<<< + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] */ -#line 241 "root_numpy/src/converters.pyx" - __pyx_v_numele = (__pyx_v_tmp[0]).size(); +#line 230 "root_numpy/src/converters.pyx" - /* "root_numpy/src/converters.pyx":246 - * # define an (numele)-dimensional outer array to hold our subvectors fa - * cdef np.npy_intp dims[1] - * dims[0] = numele # <<<<<<<<<<<<<< - * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) - * cdef PyObject* outerobj = outer # borrow ref + +#line 230 "root_numpy/src/converters.pyx" +template + +#line 230 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_VectorConverter ::__pyx_t_13_librootnumpy_VectorConverter(void) { + TypeName __pyx_v_ast +#line 230 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_info = NULL +#line 230 "root_numpy/src/converters.pyx" +; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + +#line 230 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("", 0); + + /* "root_numpy/src/converters.pyx":231 + * + * __init__(): + * cdef TypeName[T] ast = TypeName[T]() # <<<<<<<<<<<<<< + * info = TYPES[ast.name] + * this.elesize = info[1].itemsize */ -#line 246 "root_numpy/src/converters.pyx" - (__pyx_v_dims[0]) = __pyx_v_numele; +#line 231 "root_numpy/src/converters.pyx" + __pyx_v_ast = TypeName (); - /* "root_numpy/src/converters.pyx":247 - * cdef np.npy_intp dims[1] - * dims[0] = numele - * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) # <<<<<<<<<<<<<< - * cdef PyObject* outerobj = outer # borrow ref - * # increase one since we are putting in buffer directly + /* "root_numpy/src/converters.pyx":232 + * __init__(): + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] # <<<<<<<<<<<<<< + * this.elesize = info[1].itemsize + * this.nptypecode = info[2] */ -#line 247 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyArray_EMPTY(1, __pyx_v_dims, __pyx_v_objtypecode, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 232 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 247 "root_numpy/src/converters.pyx" +#line 232 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 247 "root_numpy/src/converters.pyx" - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 247 "root_numpy/src/converters.pyx" - __pyx_v_outer = ((PyArrayObject *)__pyx_t_1); +#line 232 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_ast.name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 247 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; +#line 232 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); - /* "root_numpy/src/converters.pyx":248 - * dims[0] = numele - * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) - * cdef PyObject* outerobj = outer # borrow ref # <<<<<<<<<<<<<< - * # increase one since we are putting in buffer directly - * Py_INCREF(outer) - */ +#line 232 "root_numpy/src/converters.pyx" + __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; -#line 248 "root_numpy/src/converters.pyx" - __pyx_v_outerobj = ((PyObject *)__pyx_v_outer); +#line 232 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); - /* "root_numpy/src/converters.pyx":250 - * cdef PyObject* outerobj = outer # borrow ref - * # increase one since we are putting in buffer directly - * Py_INCREF(outer) # <<<<<<<<<<<<<< - * # now write PyObject* to buffer - * memcpy(buffer, &outerobj, sizeof(PyObject*)) - */ +#line 232 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 250 "root_numpy/src/converters.pyx" - Py_INCREF(((PyObject *)__pyx_v_outer)); +#line 232 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "root_numpy/src/converters.pyx":252 - * Py_INCREF(outer) - * # now write PyObject* to buffer - * memcpy(buffer, &outerobj, sizeof(PyObject*)) # <<<<<<<<<<<<<< - * # build a dataptr pointing to outer, so we can shift and write each - * # of the subvectors - */ +#line 232 "root_numpy/src/converters.pyx" + __pyx_v_info = __pyx_t_3; -#line 252 "root_numpy/src/converters.pyx" - memcpy(__pyx_v_buffer, (&__pyx_v_outerobj), (sizeof(PyObject *))); +#line 232 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; - /* "root_numpy/src/converters.pyx":255 - * # build a dataptr pointing to outer, so we can shift and write each - * # of the subvectors - * cdef char* dataptr = outer.data # <<<<<<<<<<<<<< - * # loop through all subvectors - * cdef unsigned long i + /* "root_numpy/src/converters.pyx":233 + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] + * this.elesize = info[1].itemsize # <<<<<<<<<<<<<< + * this.nptypecode = info[2] + * */ -#line 255 "root_numpy/src/converters.pyx" - __pyx_v_dataptr = ((char *)__pyx_v_outer->data); +#line 233 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /* "root_numpy/src/converters.pyx":258 - * # loop through all subvectors - * cdef unsigned long i - * for i in range(numele): # <<<<<<<<<<<<<< - * fa = this.v2a.convert(&tmp[0][i]) - * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, - */ +#line 233 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 258 "root_numpy/src/converters.pyx" - __pyx_t_3 = __pyx_v_numele; +#line 233 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 258 "root_numpy/src/converters.pyx" - for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { +#line 233 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 258 "root_numpy/src/converters.pyx" - __pyx_v_i = __pyx_t_4; +#line 233 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "root_numpy/src/converters.pyx":259 - * cdef unsigned long i - * for i in range(numele): - * fa = this.v2a.convert(&tmp[0][i]) # <<<<<<<<<<<<<< - * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, - * tmp[0][i].size(), this.elesize) - */ +#line 233 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 259 "root_numpy/src/converters.pyx" - __pyx_v_fa = this->v2a.convert((&((__pyx_v_tmp[0])[__pyx_v_i]))); +#line 233 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "root_numpy/src/converters.pyx":260 - * for i in range(numele): - * fa = this.v2a.convert(&tmp[0][i]) - * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, # <<<<<<<<<<<<<< - * tmp[0][i].size(), this.elesize) - * return sizeof(outerobj) +#line 233 "root_numpy/src/converters.pyx" + this->elesize = __pyx_t_4; + + /* "root_numpy/src/converters.pyx":234 + * info = TYPES[ast.name] + * this.elesize = info[1].itemsize + * this.nptypecode = info[2] # <<<<<<<<<<<<<< + * + * int write(Column* col, void* buffer): */ -#line 260 "root_numpy/src/converters.pyx" - __pyx_f_13_librootnumpy_create_numpyarray((&(__pyx_v_dataptr[(__pyx_v_i * __pyx_v_objsize)])), __pyx_v_fa, this->nptypecode, ((__pyx_v_tmp[0])[__pyx_v_i]).size(), this->elesize, NULL); +#line 234 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; -#line 260 "root_numpy/src/converters.pyx" - } +#line 234 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); - /* "root_numpy/src/converters.pyx":262 - * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, - * tmp[0][i].size(), this.elesize) - * return sizeof(outerobj) # <<<<<<<<<<<<<< - * - * - */ +#line 234 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 262 "root_numpy/src/converters.pyx" - __pyx_r = (sizeof(__pyx_v_outerobj)); +#line 234 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 262 "root_numpy/src/converters.pyx" - goto __pyx_L0; +#line 234 "root_numpy/src/converters.pyx" + this->nptypecode = __pyx_t_4; - /* "root_numpy/src/converters.pyx":233 - * this.nptypecode = info[2] + /* "root_numpy/src/converters.pyx":230 + * Vector2Array[T] v2a * - * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[vector[T]]* tmp = col.GetValuePointer() - * # this will hold number of subvectors + * __init__(): # <<<<<<<<<<<<<< + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] */ -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" /* function exit code */ -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" + goto __pyx_L0; + +#line 230 "root_numpy/src/converters.pyx" __pyx_L1_error:; -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_1); -#line 233 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("VectorVectorConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 230 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_2); -#line 233 "root_numpy/src/converters.pyx" - __pyx_r = 0; +#line 230 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_3); -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("VectorConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + +#line 230 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 233 "root_numpy/src/converters.pyx" - __Pyx_XDECREF((PyObject *)__pyx_v_outer); +#line 230 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_info); -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 233 "root_numpy/src/converters.pyx" - return __pyx_r; - -#line 233 "root_numpy/src/converters.pyx" +#line 230 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":267 - * cdef cppclass VectorBoolConverter(ObjectConverterBase): - * # Requires special treament since vector stores contents as bits... +/* "root_numpy/src/converters.pyx":236 + * this.nptypecode = info[2] + * * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[bool]* tmp = col.GetValuePointer() - * return create_numpyarray_vectorbool(buffer, tmp) + * cdef vector[T]* tmp = col.GetValuePointer() + * cdef unsigned long numele = tmp.size() */ -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" -#line 267 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_VectorBoolConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::vector *__pyx_v_tmp -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" +template + +#line 236 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_VectorConverter ::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::vector *__pyx_v_tmp +#line 236 "root_numpy/src/converters.pyx" +; + unsigned long __pyx_v_numele +#line 236 "root_numpy/src/converters.pyx" +; + T *__pyx_v_fa +#line 236 "root_numpy/src/converters.pyx" ; -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" int __pyx_r; __Pyx_RefNannyDeclarations -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":268 - * # Requires special treament since vector stores contents as bits... - * int write(Column* col, void* buffer): - * cdef vector[bool]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< - * return create_numpyarray_vectorbool(buffer, tmp) + /* "root_numpy/src/converters.pyx":237 * + * int write(Column* col, void* buffer): + * cdef vector[T]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< + * cdef unsigned long numele = tmp.size() + * # check cython auto-generated code */ -#line 268 "root_numpy/src/converters.pyx" - __pyx_v_tmp = ((std::vector *)__pyx_v_col->GetValuePointer()); +#line 237 "root_numpy/src/converters.pyx" + __pyx_v_tmp = ((std::vector *)__pyx_v_col->GetValuePointer()); - /* "root_numpy/src/converters.pyx":269 + /* "root_numpy/src/converters.pyx":238 * int write(Column* col, void* buffer): - * cdef vector[bool]* tmp = col.GetValuePointer() - * return create_numpyarray_vectorbool(buffer, tmp) # <<<<<<<<<<<<<< + * cdef vector[T]* tmp = col.GetValuePointer() + * cdef unsigned long numele = tmp.size() # <<<<<<<<<<<<<< + * # check cython auto-generated code + * # if it really does &((*tmp)[0]) + */ + +#line 238 "root_numpy/src/converters.pyx" + __pyx_v_numele = __pyx_v_tmp->size(); + + /* "root_numpy/src/converters.pyx":241 + * # check cython auto-generated code + * # if it really does &((*tmp)[0]) + * cdef T* fa = this.v2a.convert(tmp) # <<<<<<<<<<<<<< + * return create_numpyarray(buffer, fa, this.nptypecode, numele, this.elesize) + * + */ + +#line 241 "root_numpy/src/converters.pyx" + __pyx_v_fa = this->v2a.convert(__pyx_v_tmp); + + /* "root_numpy/src/converters.pyx":242 + * # if it really does &((*tmp)[0]) + * cdef T* fa = this.v2a.convert(tmp) + * return create_numpyarray(buffer, fa, this.nptypecode, numele, this.elesize) # <<<<<<<<<<<<<< * * */ -#line 269 "root_numpy/src/converters.pyx" - __pyx_r = __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(__pyx_v_buffer, __pyx_v_tmp); +#line 242 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_f_13_librootnumpy_create_numpyarray(__pyx_v_buffer, __pyx_v_fa, this->nptypecode, __pyx_v_numele, this->elesize, NULL); -#line 269 "root_numpy/src/converters.pyx" +#line 242 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/converters.pyx":267 - * cdef cppclass VectorBoolConverter(ObjectConverterBase): - * # Requires special treament since vector stores contents as bits... + /* "root_numpy/src/converters.pyx":236 + * this.nptypecode = info[2] + * * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[bool]* tmp = col.GetValuePointer() - * return create_numpyarray_vectorbool(buffer, tmp) + * cdef vector[T]* tmp = col.GetValuePointer() + * cdef unsigned long numele = tmp.size() */ -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" /* function exit code */ -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" return __pyx_r; -#line 267 "root_numpy/src/converters.pyx" +#line 236 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":274 - * cdef cppclass VectorVectorBoolConverter(ObjectConverterBase): - * # Requires special treament since vector stores contents as bits... - * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[vector[bool]]* tmp = col.GetValuePointer() - * # this will hold number of subvectors +/* "root_numpy/src/converters.pyx":250 + * Vector2Array[T] v2a + * + * __init__(): # <<<<<<<<<<<<<< + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] */ -#line 274 "root_numpy/src/converters.pyx" +#line 250 "root_numpy/src/converters.pyx" -#line 274 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::vector > *__pyx_v_tmp -#line 274 "root_numpy/src/converters.pyx" -; - unsigned long __pyx_v_numele -#line 274 "root_numpy/src/converters.pyx" -; - int __pyx_v_objsize -#line 274 "root_numpy/src/converters.pyx" -; - int __pyx_v_objtypecode -#line 274 "root_numpy/src/converters.pyx" +#line 250 "root_numpy/src/converters.pyx" +template + +#line 250 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_VectorVectorConverter ::__pyx_t_13_librootnumpy_VectorVectorConverter(void) { + TypeName __pyx_v_ast +#line 250 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_info = NULL +#line 250 "root_numpy/src/converters.pyx" +; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("", 0); + + /* "root_numpy/src/converters.pyx":251 + * + * __init__(): + * cdef TypeName[T] ast = TypeName[T]() # <<<<<<<<<<<<<< + * info = TYPES[ast.name] + * this.elesize = info[1].itemsize + */ + +#line 251 "root_numpy/src/converters.pyx" + __pyx_v_ast = TypeName (); + + /* "root_numpy/src/converters.pyx":252 + * __init__(): + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] # <<<<<<<<<<<<<< + * this.elesize = info[1].itemsize + * this.nptypecode = info[2] + */ + +#line 252 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 252 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 252 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_ast.name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 252 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 252 "root_numpy/src/converters.pyx" + __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + +#line 252 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 252 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 252 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 252 "root_numpy/src/converters.pyx" + __pyx_v_info = __pyx_t_3; + +#line 252 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; + + /* "root_numpy/src/converters.pyx":253 + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] + * this.elesize = info[1].itemsize # <<<<<<<<<<<<<< + * this.nptypecode = info[2] + * + */ + +#line 253 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + +#line 253 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 253 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 253 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 253 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 253 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 253 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 253 "root_numpy/src/converters.pyx" + this->elesize = __pyx_t_4; + + /* "root_numpy/src/converters.pyx":254 + * info = TYPES[ast.name] + * this.elesize = info[1].itemsize + * this.nptypecode = info[2] # <<<<<<<<<<<<<< + * + * int write(Column* col, void* buffer): + */ + +#line 254 "root_numpy/src/converters.pyx" + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + +#line 254 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 254 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 254 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 254 "root_numpy/src/converters.pyx" + this->nptypecode = __pyx_t_4; + + /* "root_numpy/src/converters.pyx":250 + * Vector2Array[T] v2a + * + * __init__(): # <<<<<<<<<<<<<< + * cdef TypeName[T] ast = TypeName[T]() + * info = TYPES[ast.name] + */ + +#line 250 "root_numpy/src/converters.pyx" + + +#line 250 "root_numpy/src/converters.pyx" + /* function exit code */ + +#line 250 "root_numpy/src/converters.pyx" + goto __pyx_L0; + +#line 250 "root_numpy/src/converters.pyx" + __pyx_L1_error:; + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_1); + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_2); + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_3); + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("VectorVectorConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + +#line 250 "root_numpy/src/converters.pyx" + __pyx_L0:; + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_info); + +#line 250 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); + +#line 250 "root_numpy/src/converters.pyx" +} + +/* "root_numpy/src/converters.pyx":256 + * this.nptypecode = info[2] + * + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef vector[vector[T]]* tmp = col.GetValuePointer() + * # this will hold number of subvectors + */ + +#line 256 "root_numpy/src/converters.pyx" + + +#line 256 "root_numpy/src/converters.pyx" +template + +#line 256 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_VectorVectorConverter ::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::vector > *__pyx_v_tmp +#line 256 "root_numpy/src/converters.pyx" +; + unsigned long __pyx_v_numele +#line 256 "root_numpy/src/converters.pyx" +; + T *__pyx_v_fa +#line 256 "root_numpy/src/converters.pyx" +; + int __pyx_v_objsize +#line 256 "root_numpy/src/converters.pyx" +; + int __pyx_v_objtypecode +#line 256 "root_numpy/src/converters.pyx" ; - npy_intp __pyx_v_dims[1] -#line 274 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_SIZE_t __pyx_v_dims[1] +#line 256 "root_numpy/src/converters.pyx" ; PyArrayObject *__pyx_v_outer = 0 -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" ; PyObject *__pyx_v_outerobj -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" ; char *__pyx_v_dataptr -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" ; unsigned long __pyx_v_i -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" ; -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6244,44 +6423,44 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":275 - * # Requires special treament since vector stores contents as bits... + /* "root_numpy/src/converters.pyx":257 + * * int write(Column* col, void* buffer): - * cdef vector[vector[bool]]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< + * cdef vector[vector[T]]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< * # this will hold number of subvectors * cdef unsigned long numele */ -#line 275 "root_numpy/src/converters.pyx" - __pyx_v_tmp = ((std::vector > *)__pyx_v_col->GetValuePointer()); +#line 257 "root_numpy/src/converters.pyx" + __pyx_v_tmp = ((std::vector > *)__pyx_v_col->GetValuePointer()); - /* "root_numpy/src/converters.pyx":279 - * cdef unsigned long numele + /* "root_numpy/src/converters.pyx":262 + * cdef T* fa * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< * cdef int objtypecode = np.NPY_OBJECT * numele = tmp[0].size() */ -#line 279 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 262 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 279 "root_numpy/src/converters.pyx" +#line 262 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 279 "root_numpy/src/converters.pyx" +#line 262 "root_numpy/src/converters.pyx" __pyx_t_2 = ((PyArray_Descr *)__pyx_t_1)->elsize; -#line 279 "root_numpy/src/converters.pyx" +#line 262 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 279 "root_numpy/src/converters.pyx" +#line 262 "root_numpy/src/converters.pyx" __pyx_v_objsize = __pyx_t_2; - /* "root_numpy/src/converters.pyx":280 + /* "root_numpy/src/converters.pyx":263 * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize * cdef int objtypecode = np.NPY_OBJECT # <<<<<<<<<<<<<< @@ -6289,10 +6468,10 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col * # create an outer array container that dataptr points to, */ -#line 280 "root_numpy/src/converters.pyx" +#line 263 "root_numpy/src/converters.pyx" __pyx_v_objtypecode = NPY_OBJECT; - /* "root_numpy/src/converters.pyx":281 + /* "root_numpy/src/converters.pyx":264 * cdef int objsize = np.dtype('O').itemsize * cdef int objtypecode = np.NPY_OBJECT * numele = tmp[0].size() # <<<<<<<<<<<<<< @@ -6300,44 +6479,44 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col * # containing pointers from create_numpyarray(). */ -#line 281 "root_numpy/src/converters.pyx" +#line 264 "root_numpy/src/converters.pyx" __pyx_v_numele = (__pyx_v_tmp[0]).size(); - /* "root_numpy/src/converters.pyx":286 + /* "root_numpy/src/converters.pyx":269 * # define an (numele)-dimensional outer array to hold our subvectors fa - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele # <<<<<<<<<<<<<< * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) * cdef PyObject* outerobj = outer # borrow ref */ -#line 286 "root_numpy/src/converters.pyx" +#line 269 "root_numpy/src/converters.pyx" (__pyx_v_dims[0]) = __pyx_v_numele; - /* "root_numpy/src/converters.pyx":287 - * cdef np.npy_intp dims[1] + /* "root_numpy/src/converters.pyx":270 + * cdef SIZE_t dims[1] * dims[0] = numele * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) # <<<<<<<<<<<<<< * cdef PyObject* outerobj = outer # borrow ref * # increase one since we are putting in buffer directly */ -#line 287 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyArray_EMPTY(1, __pyx_v_dims, __pyx_v_objtypecode, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 270 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyArray_EMPTY(1, __pyx_v_dims, __pyx_v_objtypecode, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 287 "root_numpy/src/converters.pyx" +#line 270 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 287 "root_numpy/src/converters.pyx" - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 270 "root_numpy/src/converters.pyx" + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 287 "root_numpy/src/converters.pyx" +#line 270 "root_numpy/src/converters.pyx" __pyx_v_outer = ((PyArrayObject *)__pyx_t_1); -#line 287 "root_numpy/src/converters.pyx" +#line 270 "root_numpy/src/converters.pyx" __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":288 + /* "root_numpy/src/converters.pyx":271 * dims[0] = numele * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) * cdef PyObject* outerobj = outer # borrow ref # <<<<<<<<<<<<<< @@ -6345,10 +6524,10 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col * Py_INCREF(outer) */ -#line 288 "root_numpy/src/converters.pyx" +#line 271 "root_numpy/src/converters.pyx" __pyx_v_outerobj = ((PyObject *)__pyx_v_outer); - /* "root_numpy/src/converters.pyx":290 + /* "root_numpy/src/converters.pyx":273 * cdef PyObject* outerobj = outer # borrow ref * # increase one since we are putting in buffer directly * Py_INCREF(outer) # <<<<<<<<<<<<<< @@ -6356,10 +6535,10 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col * memcpy(buffer, &outerobj, sizeof(PyObject*)) */ -#line 290 "root_numpy/src/converters.pyx" +#line 273 "root_numpy/src/converters.pyx" Py_INCREF(((PyObject *)__pyx_v_outer)); - /* "root_numpy/src/converters.pyx":292 + /* "root_numpy/src/converters.pyx":275 * Py_INCREF(outer) * # now write PyObject* to buffer * memcpy(buffer, &outerobj, sizeof(PyObject*)) # <<<<<<<<<<<<<< @@ -6367,10 +6546,10 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col * # of the subvectors */ -#line 292 "root_numpy/src/converters.pyx" +#line 275 "root_numpy/src/converters.pyx" memcpy(__pyx_v_buffer, (&__pyx_v_outerobj), (sizeof(PyObject *))); - /* "root_numpy/src/converters.pyx":295 + /* "root_numpy/src/converters.pyx":278 * # build a dataptr pointing to outer, so we can shift and write each * # of the subvectors * cdef char* dataptr = outer.data # <<<<<<<<<<<<<< @@ -6378,393 +6557,223 @@ int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col * cdef unsigned long i */ -#line 295 "root_numpy/src/converters.pyx" +#line 278 "root_numpy/src/converters.pyx" __pyx_v_dataptr = ((char *)__pyx_v_outer->data); - /* "root_numpy/src/converters.pyx":298 + /* "root_numpy/src/converters.pyx":281 * # loop through all subvectors * cdef unsigned long i * for i in range(numele): # <<<<<<<<<<<<<< - * create_numpyarray_vectorbool(&dataptr[i*objsize], &tmp[0][i]) - * return sizeof(outerobj) + * fa = this.v2a.convert(&tmp[0][i]) + * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, */ -#line 298 "root_numpy/src/converters.pyx" +#line 281 "root_numpy/src/converters.pyx" __pyx_t_3 = __pyx_v_numele; -#line 298 "root_numpy/src/converters.pyx" +#line 281 "root_numpy/src/converters.pyx" for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { -#line 298 "root_numpy/src/converters.pyx" +#line 281 "root_numpy/src/converters.pyx" __pyx_v_i = __pyx_t_4; - /* "root_numpy/src/converters.pyx":299 + /* "root_numpy/src/converters.pyx":282 * cdef unsigned long i * for i in range(numele): - * create_numpyarray_vectorbool(&dataptr[i*objsize], &tmp[0][i]) # <<<<<<<<<<<<<< + * fa = this.v2a.convert(&tmp[0][i]) # <<<<<<<<<<<<<< + * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, + * tmp[0][i].size(), this.elesize) + */ + +#line 282 "root_numpy/src/converters.pyx" + __pyx_v_fa = this->v2a.convert((&((__pyx_v_tmp[0])[__pyx_v_i]))); + + /* "root_numpy/src/converters.pyx":283 + * for i in range(numele): + * fa = this.v2a.convert(&tmp[0][i]) + * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, # <<<<<<<<<<<<<< + * tmp[0][i].size(), this.elesize) * return sizeof(outerobj) - * */ -#line 299 "root_numpy/src/converters.pyx" - __pyx_f_13_librootnumpy_create_numpyarray_vectorbool((&(__pyx_v_dataptr[(__pyx_v_i * __pyx_v_objsize)])), (&((__pyx_v_tmp[0])[__pyx_v_i]))); +#line 283 "root_numpy/src/converters.pyx" + __pyx_f_13_librootnumpy_create_numpyarray((&(__pyx_v_dataptr[(__pyx_v_i * __pyx_v_objsize)])), __pyx_v_fa, this->nptypecode, ((__pyx_v_tmp[0])[__pyx_v_i]).size(), this->elesize, NULL); -#line 299 "root_numpy/src/converters.pyx" +#line 283 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":300 - * for i in range(numele): - * create_numpyarray_vectorbool(&dataptr[i*objsize], &tmp[0][i]) + /* "root_numpy/src/converters.pyx":285 + * create_numpyarray(&dataptr[i*objsize], fa, this.nptypecode, + * tmp[0][i].size(), this.elesize) * return sizeof(outerobj) # <<<<<<<<<<<<<< * * */ -#line 300 "root_numpy/src/converters.pyx" +#line 285 "root_numpy/src/converters.pyx" __pyx_r = (sizeof(__pyx_v_outerobj)); -#line 300 "root_numpy/src/converters.pyx" +#line 285 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/converters.pyx":274 - * cdef cppclass VectorVectorBoolConverter(ObjectConverterBase): - * # Requires special treament since vector stores contents as bits... + /* "root_numpy/src/converters.pyx":256 + * this.nptypecode = info[2] + * * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[vector[bool]]* tmp = col.GetValuePointer() + * cdef vector[vector[T]]* tmp = col.GetValuePointer() * # this will hold number of subvectors */ -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" /* function exit code */ -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __pyx_L1_error:; -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_1); -#line 274 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("VectorVectorBoolConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 256 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("VectorVectorConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __pyx_r = 0; -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 274 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __Pyx_XDECREF((PyObject *)__pyx_v_outer); -#line 274 "root_numpy/src/converters.pyx" - __Pyx_RefNannyFinishContext(); - -#line 274 "root_numpy/src/converters.pyx" - return __pyx_r; - -#line 274 "root_numpy/src/converters.pyx" -} - -/* "root_numpy/src/converters.pyx":304 - * - * cdef cppclass StringConverter(ObjectConverterBase): - * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef string* s = col.GetValuePointer() - * py_bytes = str(s[0]) - */ - -#line 304 "root_numpy/src/converters.pyx" - - -#line 304 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_StringConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::string *__pyx_v_s -#line 304 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_py_bytes = NULL -#line 304 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_tmpobj -#line 304 "root_numpy/src/converters.pyx" -; - -#line 304 "root_numpy/src/converters.pyx" - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - -#line 304 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("write", 0); - - /* "root_numpy/src/converters.pyx":305 - * cdef cppclass StringConverter(ObjectConverterBase): - * int write(Column* col, void* buffer): - * cdef string* s = col.GetValuePointer() # <<<<<<<<<<<<<< - * py_bytes = str(s[0]) - * cdef PyObject* tmpobj = py_bytes # borrow ref - */ - -#line 305 "root_numpy/src/converters.pyx" - __pyx_v_s = ((std::string *)__pyx_v_col->GetValuePointer()); - - /* "root_numpy/src/converters.pyx":306 - * int write(Column* col, void* buffer): - * cdef string* s = col.GetValuePointer() - * py_bytes = str(s[0]) # <<<<<<<<<<<<<< - * cdef PyObject* tmpobj = py_bytes # borrow ref - * # increase one since we are putting in buffer directly - */ - -#line 306 "root_numpy/src/converters.pyx" - __pyx_t_1 = __pyx_convert_PyStr_string_to_py_std__string((__pyx_v_s[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 306 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); - -#line 306 "root_numpy/src/converters.pyx" - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 306 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 306 "root_numpy/src/converters.pyx" - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); - -#line 306 "root_numpy/src/converters.pyx" - __Pyx_GIVEREF(__pyx_t_1); - -#line 306 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; - -#line 306 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 306 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); - -#line 306 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 306 "root_numpy/src/converters.pyx" - __pyx_v_py_bytes = __pyx_t_1; - -#line 306 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; - - /* "root_numpy/src/converters.pyx":307 - * cdef string* s = col.GetValuePointer() - * py_bytes = str(s[0]) - * cdef PyObject* tmpobj = py_bytes # borrow ref # <<<<<<<<<<<<<< - * # increase one since we are putting in buffer directly - * Py_INCREF(py_bytes) - */ - -#line 307 "root_numpy/src/converters.pyx" - __pyx_v_tmpobj = ((PyObject *)__pyx_v_py_bytes); - - /* "root_numpy/src/converters.pyx":309 - * cdef PyObject* tmpobj = py_bytes # borrow ref - * # increase one since we are putting in buffer directly - * Py_INCREF(py_bytes) # <<<<<<<<<<<<<< - * # now write PyObject* to buffer - * memcpy(buffer, &tmpobj, sizeof(PyObject*)) - */ - -#line 309 "root_numpy/src/converters.pyx" - Py_INCREF(__pyx_v_py_bytes); - - /* "root_numpy/src/converters.pyx":311 - * Py_INCREF(py_bytes) - * # now write PyObject* to buffer - * memcpy(buffer, &tmpobj, sizeof(PyObject*)) # <<<<<<<<<<<<<< - * return sizeof(tmpobj) - * - */ - -#line 311 "root_numpy/src/converters.pyx" - memcpy(__pyx_v_buffer, (&__pyx_v_tmpobj), (sizeof(PyObject *))); - - /* "root_numpy/src/converters.pyx":312 - * # now write PyObject* to buffer - * memcpy(buffer, &tmpobj, sizeof(PyObject*)) - * return sizeof(tmpobj) # <<<<<<<<<<<<<< - * - * - */ - -#line 312 "root_numpy/src/converters.pyx" - __pyx_r = (sizeof(__pyx_v_tmpobj)); - -#line 312 "root_numpy/src/converters.pyx" - goto __pyx_L0; - - /* "root_numpy/src/converters.pyx":304 - * - * cdef cppclass StringConverter(ObjectConverterBase): - * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef string* s = col.GetValuePointer() - * py_bytes = str(s[0]) - */ - -#line 304 "root_numpy/src/converters.pyx" - - -#line 304 "root_numpy/src/converters.pyx" - /* function exit code */ - -#line 304 "root_numpy/src/converters.pyx" - __pyx_L1_error:; - -#line 304 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_1); - -#line 304 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_2); - -#line 304 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("StringConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); - -#line 304 "root_numpy/src/converters.pyx" - __pyx_r = 0; - -#line 304 "root_numpy/src/converters.pyx" - __pyx_L0:; - -#line 304 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_py_bytes); - -#line 304 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 304 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" return __pyx_r; -#line 304 "root_numpy/src/converters.pyx" +#line 256 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":316 - * - * cdef cppclass VectorStringConverter(ObjectConverterBase): +/* "root_numpy/src/converters.pyx":290 + * cdef cppclass VectorBoolConverter(ObjectConverterBase): + * # Requires special treament since vector stores contents as bits... * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[string]* tmp = col.GetValuePointer() - * return create_numpyarray_vectorstring(buffer, tmp) + * cdef vector[bool]* tmp = col.GetValuePointer() + * return create_numpyarray_vectorbool(buffer, tmp) */ -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" -#line 316 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_VectorStringConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::vector *__pyx_v_tmp -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_VectorBoolConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::vector *__pyx_v_tmp +#line 290 "root_numpy/src/converters.pyx" ; -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" int __pyx_r; __Pyx_RefNannyDeclarations -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":317 - * cdef cppclass VectorStringConverter(ObjectConverterBase): + /* "root_numpy/src/converters.pyx":291 + * # Requires special treament since vector stores contents as bits... * int write(Column* col, void* buffer): - * cdef vector[string]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< - * return create_numpyarray_vectorstring(buffer, tmp) + * cdef vector[bool]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< + * return create_numpyarray_vectorbool(buffer, tmp) * */ -#line 317 "root_numpy/src/converters.pyx" - __pyx_v_tmp = ((std::vector *)__pyx_v_col->GetValuePointer()); +#line 291 "root_numpy/src/converters.pyx" + __pyx_v_tmp = ((std::vector *)__pyx_v_col->GetValuePointer()); - /* "root_numpy/src/converters.pyx":318 + /* "root_numpy/src/converters.pyx":292 * int write(Column* col, void* buffer): - * cdef vector[string]* tmp = col.GetValuePointer() - * return create_numpyarray_vectorstring(buffer, tmp) # <<<<<<<<<<<<<< + * cdef vector[bool]* tmp = col.GetValuePointer() + * return create_numpyarray_vectorbool(buffer, tmp) # <<<<<<<<<<<<<< * * */ -#line 318 "root_numpy/src/converters.pyx" - __pyx_r = __pyx_f_13_librootnumpy_create_numpyarray_vectorstring(__pyx_v_buffer, __pyx_v_tmp); +#line 292 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_f_13_librootnumpy_create_numpyarray_vectorbool(__pyx_v_buffer, __pyx_v_tmp); -#line 318 "root_numpy/src/converters.pyx" +#line 292 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/converters.pyx":316 - * - * cdef cppclass VectorStringConverter(ObjectConverterBase): + /* "root_numpy/src/converters.pyx":290 + * cdef cppclass VectorBoolConverter(ObjectConverterBase): + * # Requires special treament since vector stores contents as bits... * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[string]* tmp = col.GetValuePointer() - * return create_numpyarray_vectorstring(buffer, tmp) + * cdef vector[bool]* tmp = col.GetValuePointer() + * return create_numpyarray_vectorbool(buffer, tmp) */ -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" /* function exit code */ -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" return __pyx_r; -#line 316 "root_numpy/src/converters.pyx" +#line 290 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":322 - * - * cdef cppclass VectorVectorStringConverter(ObjectConverterBase): +/* "root_numpy/src/converters.pyx":297 + * cdef cppclass VectorVectorBoolConverter(ObjectConverterBase): + * # Requires special treament since vector stores contents as bits... * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[vector[string]]* tmp = col.GetValuePointer() + * cdef vector[vector[bool]]* tmp = col.GetValuePointer() * # this will hold number of subvectors */ -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" -#line 322 "root_numpy/src/converters.pyx" -int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { - std::vector > *__pyx_v_tmp -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_VectorVectorBoolConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::vector > *__pyx_v_tmp +#line 297 "root_numpy/src/converters.pyx" ; unsigned long __pyx_v_numele -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; int __pyx_v_objsize -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; int __pyx_v_objtypecode -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; - npy_intp __pyx_v_dims[1] -#line 322 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_SIZE_t __pyx_v_dims[1] +#line 297 "root_numpy/src/converters.pyx" ; PyArrayObject *__pyx_v_outer = 0 -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; PyObject *__pyx_v_outerobj -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; char *__pyx_v_dataptr -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; unsigned long __pyx_v_i -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" ; -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -6775,21 +6784,21 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":323 - * cdef cppclass VectorVectorStringConverter(ObjectConverterBase): + /* "root_numpy/src/converters.pyx":298 + * # Requires special treament since vector stores contents as bits... * int write(Column* col, void* buffer): - * cdef vector[vector[string]]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< + * cdef vector[vector[bool]]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< * # this will hold number of subvectors * cdef unsigned long numele */ -#line 323 "root_numpy/src/converters.pyx" - __pyx_v_tmp = ((std::vector > *)__pyx_v_col->GetValuePointer()); +#line 298 "root_numpy/src/converters.pyx" + __pyx_v_tmp = ((std::vector > *)__pyx_v_col->GetValuePointer()); - /* "root_numpy/src/converters.pyx":327 + /* "root_numpy/src/converters.pyx":302 * cdef unsigned long numele * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< @@ -6797,22 +6806,22 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * numele = tmp[0].size() */ -#line 327 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 302 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 327 "root_numpy/src/converters.pyx" +#line 302 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 327 "root_numpy/src/converters.pyx" +#line 302 "root_numpy/src/converters.pyx" __pyx_t_2 = ((PyArray_Descr *)__pyx_t_1)->elsize; -#line 327 "root_numpy/src/converters.pyx" +#line 302 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 327 "root_numpy/src/converters.pyx" +#line 302 "root_numpy/src/converters.pyx" __pyx_v_objsize = __pyx_t_2; - /* "root_numpy/src/converters.pyx":328 + /* "root_numpy/src/converters.pyx":303 * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize * cdef int objtypecode = np.NPY_OBJECT # <<<<<<<<<<<<<< @@ -6820,10 +6829,10 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * # create an outer array container that dataptr points to, */ -#line 328 "root_numpy/src/converters.pyx" +#line 303 "root_numpy/src/converters.pyx" __pyx_v_objtypecode = NPY_OBJECT; - /* "root_numpy/src/converters.pyx":329 + /* "root_numpy/src/converters.pyx":304 * cdef int objsize = np.dtype('O').itemsize * cdef int objtypecode = np.NPY_OBJECT * numele = tmp[0].size() # <<<<<<<<<<<<<< @@ -6831,44 +6840,44 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * # containing pointers from create_numpyarray(). */ -#line 329 "root_numpy/src/converters.pyx" +#line 304 "root_numpy/src/converters.pyx" __pyx_v_numele = (__pyx_v_tmp[0]).size(); - /* "root_numpy/src/converters.pyx":334 + /* "root_numpy/src/converters.pyx":309 * # define an (numele)-dimensional outer array to hold our subvectors fa - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele # <<<<<<<<<<<<<< * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) * cdef PyObject* outerobj = outer # borrow ref */ -#line 334 "root_numpy/src/converters.pyx" +#line 309 "root_numpy/src/converters.pyx" (__pyx_v_dims[0]) = __pyx_v_numele; - /* "root_numpy/src/converters.pyx":335 - * cdef np.npy_intp dims[1] + /* "root_numpy/src/converters.pyx":310 + * cdef SIZE_t dims[1] * dims[0] = numele * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) # <<<<<<<<<<<<<< * cdef PyObject* outerobj = outer # borrow ref * # increase one since we are putting in buffer directly */ -#line 335 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyArray_EMPTY(1, __pyx_v_dims, __pyx_v_objtypecode, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 310 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyArray_EMPTY(1, __pyx_v_dims, __pyx_v_objtypecode, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 335 "root_numpy/src/converters.pyx" +#line 310 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 335 "root_numpy/src/converters.pyx" - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 310 "root_numpy/src/converters.pyx" + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 335 "root_numpy/src/converters.pyx" +#line 310 "root_numpy/src/converters.pyx" __pyx_v_outer = ((PyArrayObject *)__pyx_t_1); -#line 335 "root_numpy/src/converters.pyx" +#line 310 "root_numpy/src/converters.pyx" __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":336 + /* "root_numpy/src/converters.pyx":311 * dims[0] = numele * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) * cdef PyObject* outerobj = outer # borrow ref # <<<<<<<<<<<<<< @@ -6876,10 +6885,10 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * Py_INCREF(outer) */ -#line 336 "root_numpy/src/converters.pyx" +#line 311 "root_numpy/src/converters.pyx" __pyx_v_outerobj = ((PyObject *)__pyx_v_outer); - /* "root_numpy/src/converters.pyx":338 + /* "root_numpy/src/converters.pyx":313 * cdef PyObject* outerobj = outer # borrow ref * # increase one since we are putting in buffer directly * Py_INCREF(outer) # <<<<<<<<<<<<<< @@ -6887,10 +6896,10 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * memcpy(buffer, &outerobj, sizeof(PyObject*)) */ -#line 338 "root_numpy/src/converters.pyx" +#line 313 "root_numpy/src/converters.pyx" Py_INCREF(((PyObject *)__pyx_v_outer)); - /* "root_numpy/src/converters.pyx":340 + /* "root_numpy/src/converters.pyx":315 * Py_INCREF(outer) * # now write PyObject* to buffer * memcpy(buffer, &outerobj, sizeof(PyObject*)) # <<<<<<<<<<<<<< @@ -6898,10 +6907,10 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * # of the subvectors */ -#line 340 "root_numpy/src/converters.pyx" +#line 315 "root_numpy/src/converters.pyx" memcpy(__pyx_v_buffer, (&__pyx_v_outerobj), (sizeof(PyObject *))); - /* "root_numpy/src/converters.pyx":343 + /* "root_numpy/src/converters.pyx":318 * # build a dataptr pointing to outer, so we can shift and write each * # of the subvectors * cdef char* dataptr = outer.data # <<<<<<<<<<<<<< @@ -6909,12034 +6918,14003 @@ int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_c * cdef unsigned long i */ -#line 343 "root_numpy/src/converters.pyx" +#line 318 "root_numpy/src/converters.pyx" __pyx_v_dataptr = ((char *)__pyx_v_outer->data); - /* "root_numpy/src/converters.pyx":346 + /* "root_numpy/src/converters.pyx":321 * # loop through all subvectors * cdef unsigned long i * for i in range(numele): # <<<<<<<<<<<<<< - * create_numpyarray_vectorstring(&dataptr[i*objsize], &tmp[0][i]) + * create_numpyarray_vectorbool(&dataptr[i*objsize], &tmp[0][i]) * return sizeof(outerobj) */ -#line 346 "root_numpy/src/converters.pyx" +#line 321 "root_numpy/src/converters.pyx" __pyx_t_3 = __pyx_v_numele; -#line 346 "root_numpy/src/converters.pyx" +#line 321 "root_numpy/src/converters.pyx" for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { -#line 346 "root_numpy/src/converters.pyx" +#line 321 "root_numpy/src/converters.pyx" __pyx_v_i = __pyx_t_4; - /* "root_numpy/src/converters.pyx":347 + /* "root_numpy/src/converters.pyx":322 * cdef unsigned long i * for i in range(numele): - * create_numpyarray_vectorstring(&dataptr[i*objsize], &tmp[0][i]) # <<<<<<<<<<<<<< + * create_numpyarray_vectorbool(&dataptr[i*objsize], &tmp[0][i]) # <<<<<<<<<<<<<< * return sizeof(outerobj) * */ -#line 347 "root_numpy/src/converters.pyx" - __pyx_f_13_librootnumpy_create_numpyarray_vectorstring((&(__pyx_v_dataptr[(__pyx_v_i * __pyx_v_objsize)])), (&((__pyx_v_tmp[0])[__pyx_v_i]))); - -#line 347 "root_numpy/src/converters.pyx" +#line 322 "root_numpy/src/converters.pyx" + __pyx_f_13_librootnumpy_create_numpyarray_vectorbool((&(__pyx_v_dataptr[(__pyx_v_i * __pyx_v_objsize)])), (&((__pyx_v_tmp[0])[__pyx_v_i]))); + +#line 322 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":348 + /* "root_numpy/src/converters.pyx":323 * for i in range(numele): - * create_numpyarray_vectorstring(&dataptr[i*objsize], &tmp[0][i]) + * create_numpyarray_vectorbool(&dataptr[i*objsize], &tmp[0][i]) * return sizeof(outerobj) # <<<<<<<<<<<<<< * * */ -#line 348 "root_numpy/src/converters.pyx" +#line 323 "root_numpy/src/converters.pyx" __pyx_r = (sizeof(__pyx_v_outerobj)); -#line 348 "root_numpy/src/converters.pyx" +#line 323 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/converters.pyx":322 - * - * cdef cppclass VectorVectorStringConverter(ObjectConverterBase): + /* "root_numpy/src/converters.pyx":297 + * cdef cppclass VectorVectorBoolConverter(ObjectConverterBase): + * # Requires special treament since vector stores contents as bits... * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< - * cdef vector[vector[string]]* tmp = col.GetValuePointer() + * cdef vector[vector[bool]]* tmp = col.GetValuePointer() * # this will hold number of subvectors */ -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" /* function exit code */ -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __pyx_L1_error:; -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_1); -#line 322 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("VectorVectorStringConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 297 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("VectorVectorBoolConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __pyx_r = 0; -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __Pyx_XDECREF((PyObject *)__pyx_v_outer); -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" return __pyx_r; -#line 322 "root_numpy/src/converters.pyx" +#line 297 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":425 +/* "root_numpy/src/converters.pyx":327 * - * - * cdef Converter* find_converter_by_typename(string typename): # <<<<<<<<<<<<<< - * it = CONVERTERS.find(typename) - * if it == CONVERTERS.end(): + * cdef cppclass StringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef string* s = col.GetValuePointer() + * py_bytes = str(s[0]) */ -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" -#line 425 "root_numpy/src/converters.pyx" -static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_find_converter_by_typename(std::string __pyx_v_typename) { - std::map ::iterator __pyx_v_it -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_StringConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::string *__pyx_v_s +#line 327 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_py_bytes = NULL +#line 327 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_tmpobj +#line 327 "root_numpy/src/converters.pyx" ; -#line 425 "root_numpy/src/converters.pyx" - __pyx_t_13_librootnumpy_Converter *__pyx_r; +#line 327 "root_numpy/src/converters.pyx" + int __pyx_r; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 425 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("find_converter_by_typename", 0); +#line 327 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":426 - * - * cdef Converter* find_converter_by_typename(string typename): - * it = CONVERTERS.find(typename) # <<<<<<<<<<<<<< - * if it == CONVERTERS.end(): - * return NULL + /* "root_numpy/src/converters.pyx":328 + * cdef cppclass StringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): + * cdef string* s = col.GetValuePointer() # <<<<<<<<<<<<<< + * py_bytes = str(s[0]) + * cdef PyObject* tmpobj = py_bytes # borrow ref */ -#line 426 "root_numpy/src/converters.pyx" - __pyx_v_it = __pyx_v_13_librootnumpy_CONVERTERS.find(__pyx_v_typename); +#line 328 "root_numpy/src/converters.pyx" + __pyx_v_s = ((std::string *)__pyx_v_col->GetValuePointer()); - /* "root_numpy/src/converters.pyx":427 - * cdef Converter* find_converter_by_typename(string typename): - * it = CONVERTERS.find(typename) - * if it == CONVERTERS.end(): # <<<<<<<<<<<<<< - * return NULL - * return deref(it).second + /* "root_numpy/src/converters.pyx":329 + * int write(Column* col, void* buffer): + * cdef string* s = col.GetValuePointer() + * py_bytes = str(s[0]) # <<<<<<<<<<<<<< + * cdef PyObject* tmpobj = py_bytes # borrow ref + * # increase one since we are putting in buffer directly */ -#line 427 "root_numpy/src/converters.pyx" - __pyx_t_1 = ((__pyx_v_it == __pyx_v_13_librootnumpy_CONVERTERS.end()) != 0); +#line 329 "root_numpy/src/converters.pyx" + __pyx_t_1 = __pyx_convert_PyStr_string_to_py_std__string((__pyx_v_s[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 427 "root_numpy/src/converters.pyx" - if (__pyx_t_1) { +#line 329 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); - /* "root_numpy/src/converters.pyx":428 - * it = CONVERTERS.find(typename) - * if it == CONVERTERS.end(): - * return NULL # <<<<<<<<<<<<<< - * return deref(it).second - * +#line 329 "root_numpy/src/converters.pyx" + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 329 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 329 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + +#line 329 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_1); + +#line 329 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; + +#line 329 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 329 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 329 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 329 "root_numpy/src/converters.pyx" + __pyx_v_py_bytes = __pyx_t_1; + +#line 329 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; + + /* "root_numpy/src/converters.pyx":330 + * cdef string* s = col.GetValuePointer() + * py_bytes = str(s[0]) + * cdef PyObject* tmpobj = py_bytes # borrow ref # <<<<<<<<<<<<<< + * # increase one since we are putting in buffer directly + * Py_INCREF(py_bytes) */ -#line 428 "root_numpy/src/converters.pyx" - __pyx_r = NULL; +#line 330 "root_numpy/src/converters.pyx" + __pyx_v_tmpobj = ((PyObject *)__pyx_v_py_bytes); -#line 428 "root_numpy/src/converters.pyx" - goto __pyx_L0; + /* "root_numpy/src/converters.pyx":332 + * cdef PyObject* tmpobj = py_bytes # borrow ref + * # increase one since we are putting in buffer directly + * Py_INCREF(py_bytes) # <<<<<<<<<<<<<< + * # now write PyObject* to buffer + * memcpy(buffer, &tmpobj, sizeof(PyObject*)) + */ -#line 428 "root_numpy/src/converters.pyx" - } +#line 332 "root_numpy/src/converters.pyx" + Py_INCREF(__pyx_v_py_bytes); - /* "root_numpy/src/converters.pyx":429 - * if it == CONVERTERS.end(): - * return NULL - * return deref(it).second # <<<<<<<<<<<<<< + /* "root_numpy/src/converters.pyx":334 + * Py_INCREF(py_bytes) + * # now write PyObject* to buffer + * memcpy(buffer, &tmpobj, sizeof(PyObject*)) # <<<<<<<<<<<<<< + * return sizeof(tmpobj) + * + */ + +#line 334 "root_numpy/src/converters.pyx" + memcpy(__pyx_v_buffer, (&__pyx_v_tmpobj), (sizeof(PyObject *))); + + /* "root_numpy/src/converters.pyx":335 + * # now write PyObject* to buffer + * memcpy(buffer, &tmpobj, sizeof(PyObject*)) + * return sizeof(tmpobj) # <<<<<<<<<<<<<< * * */ -#line 429 "root_numpy/src/converters.pyx" - __pyx_r = (*__pyx_v_it).second; +#line 335 "root_numpy/src/converters.pyx" + __pyx_r = (sizeof(__pyx_v_tmpobj)); -#line 429 "root_numpy/src/converters.pyx" +#line 335 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/converters.pyx":425 - * + /* "root_numpy/src/converters.pyx":327 * - * cdef Converter* find_converter_by_typename(string typename): # <<<<<<<<<<<<<< - * it = CONVERTERS.find(typename) - * if it == CONVERTERS.end(): + * cdef cppclass StringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef string* s = col.GetValuePointer() + * py_bytes = str(s[0]) */ -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" /* function exit code */ -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" + __pyx_L1_error:; + +#line 327 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_1); + +#line 327 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_2); + +#line 327 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("StringConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + +#line 327 "root_numpy/src/converters.pyx" + __pyx_r = 0; + +#line 327 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_py_bytes); + +#line 327 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" return __pyx_r; -#line 425 "root_numpy/src/converters.pyx" +#line 327 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/converters.pyx":438 +/* "root_numpy/src/converters.pyx":339 * - * - * cdef Converter* get_converter(TLeaf* leaf): # <<<<<<<<<<<<<< - * # Find existing converter or attempt to create a new one - * cdef Converter* conv + * cdef cppclass VectorStringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef vector[string]* tmp = col.GetValuePointer() + * return create_numpyarray_vectorstring(buffer, tmp) */ -#line 438 "root_numpy/src/converters.pyx" +#line 339 "root_numpy/src/converters.pyx" -#line 438 "root_numpy/src/converters.pyx" -static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_get_converter(TLeaf *__pyx_v_leaf) { - __pyx_t_13_librootnumpy_Converter *__pyx_v_conv -#line 438 "root_numpy/src/converters.pyx" -; - __pyx_t_13_librootnumpy_Converter *__pyx_v_basic_conv -#line 438 "root_numpy/src/converters.pyx" -; - TLeaf *__pyx_v_leaf_count -#line 438 "root_numpy/src/converters.pyx" -; - enum __pyx_t_13_librootnumpy_LeafShapeType __pyx_v_leaf_shape_type -#line 438 "root_numpy/src/converters.pyx" -; - __pyx_t_13_librootnumpy_SIZE_t *__pyx_v_dims -#line 438 "root_numpy/src/converters.pyx" -; - int __pyx_v_ndim -#line 438 "root_numpy/src/converters.pyx" -; - int __pyx_v_idim -#line 438 "root_numpy/src/converters.pyx" -; - CYTHON_UNUSED const char *__pyx_v_leaf_name -#line 438 "root_numpy/src/converters.pyx" -; - const char *__pyx_v_leaf_title -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_leaf_type = NULL -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_leaf_shape = NULL -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_match = NULL -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_arraydef = NULL -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_arraytokens = NULL -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_shape = NULL -#line 438 "root_numpy/src/converters.pyx" -; - PyObject *__pyx_v_token = NULL -#line 438 "root_numpy/src/converters.pyx" +#line 339 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_VectorStringConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::vector *__pyx_v_tmp +#line 339 "root_numpy/src/converters.pyx" ; -#line 438 "root_numpy/src/converters.pyx" - __pyx_t_13_librootnumpy_Converter *__pyx_r; +#line 339 "root_numpy/src/converters.pyx" + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - int __pyx_t_9; - PyObject *(*__pyx_t_10)(PyObject *); - int __pyx_t_11; - std::string __pyx_t_12; - int __pyx_t_13; - long __pyx_t_14; - __pyx_t_13_librootnumpy_SIZE_t __pyx_t_15; - __pyx_t_13_librootnumpy_CONVERTERS_ITEM __pyx_t_16; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - -#line 438 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("get_converter", 0); - - /* "root_numpy/src/converters.pyx":442 - * cdef Converter* conv - * cdef Converter* basic_conv - * cdef TLeaf* leaf_count = leaf.GetLeafCount() # <<<<<<<<<<<<<< - * cdef LeafShapeType leaf_shape_type = SINGLE_VALUE - * cdef SIZE_t* dims - */ - -#line 442 "root_numpy/src/converters.pyx" - __pyx_v_leaf_count = __pyx_v_leaf->GetLeafCount(); - - /* "root_numpy/src/converters.pyx":443 - * cdef Converter* basic_conv - * cdef TLeaf* leaf_count = leaf.GetLeafCount() - * cdef LeafShapeType leaf_shape_type = SINGLE_VALUE # <<<<<<<<<<<<<< - * cdef SIZE_t* dims - * cdef int ndim, idim - */ -#line 443 "root_numpy/src/converters.pyx" - __pyx_v_leaf_shape_type = __pyx_e_13_librootnumpy_SINGLE_VALUE; +#line 339 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("write", 0); - /* "root_numpy/src/converters.pyx":447 - * cdef int ndim, idim + /* "root_numpy/src/converters.pyx":340 + * cdef cppclass VectorStringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): + * cdef vector[string]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< + * return create_numpyarray_vectorstring(buffer, tmp) * - * leaf_name = leaf.GetName() # <<<<<<<<<<<<<< - * leaf_title = leaf.GetTitle() - * leaf_type = resolve_type(leaf.GetTypeName()) */ -#line 447 "root_numpy/src/converters.pyx" - __pyx_v_leaf_name = __pyx_v_leaf->GetName(); +#line 340 "root_numpy/src/converters.pyx" + __pyx_v_tmp = ((std::vector *)__pyx_v_col->GetValuePointer()); - /* "root_numpy/src/converters.pyx":448 + /* "root_numpy/src/converters.pyx":341 + * int write(Column* col, void* buffer): + * cdef vector[string]* tmp = col.GetValuePointer() + * return create_numpyarray_vectorstring(buffer, tmp) # <<<<<<<<<<<<<< + * * - * leaf_name = leaf.GetName() - * leaf_title = leaf.GetTitle() # <<<<<<<<<<<<<< - * leaf_type = resolve_type(leaf.GetTypeName()) - * leaf_shape = () */ -#line 448 "root_numpy/src/converters.pyx" - __pyx_v_leaf_title = __pyx_v_leaf->GetTitle(); +#line 341 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_f_13_librootnumpy_create_numpyarray_vectorstring(__pyx_v_buffer, __pyx_v_tmp); - /* "root_numpy/src/converters.pyx":449 - * leaf_name = leaf.GetName() - * leaf_title = leaf.GetTitle() - * leaf_type = resolve_type(leaf.GetTypeName()) # <<<<<<<<<<<<<< - * leaf_shape = () +#line 341 "root_numpy/src/converters.pyx" + goto __pyx_L0; + + /* "root_numpy/src/converters.pyx":339 * + * cdef cppclass VectorStringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef vector[string]* tmp = col.GetValuePointer() + * return create_numpyarray_vectorstring(buffer, tmp) */ -#line 449 "root_numpy/src/converters.pyx" - __pyx_t_1 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_leaf->GetTypeName()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 339 "root_numpy/src/converters.pyx" -#line 449 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); -#line 449 "root_numpy/src/converters.pyx" - __pyx_v_leaf_type = ((PyObject*)__pyx_t_1); +#line 339 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 449 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; +#line 339 "root_numpy/src/converters.pyx" + __pyx_L0:; - /* "root_numpy/src/converters.pyx":450 - * leaf_title = leaf.GetTitle() - * leaf_type = resolve_type(leaf.GetTypeName()) - * leaf_shape = () # <<<<<<<<<<<<<< - * - * # Determine shape of this leaf - */ +#line 339 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 450 "root_numpy/src/converters.pyx" - __Pyx_INCREF(__pyx_empty_tuple); +#line 339 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 450 "root_numpy/src/converters.pyx" - __pyx_v_leaf_shape = __pyx_empty_tuple; +#line 339 "root_numpy/src/converters.pyx" +} - /* "root_numpy/src/converters.pyx":453 +/* "root_numpy/src/converters.pyx":345 * - * # Determine shape of this leaf - * match = re.match(LEAF_PATTERN, leaf_title) # <<<<<<<<<<<<<< - * if match is not None: - * arraydef = match.group(1) + * cdef cppclass VectorVectorStringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef vector[vector[string]]* tmp = col.GetValuePointer() + * # this will hold number of subvectors */ -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 345 "root_numpy/src/converters.pyx" -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 345 "root_numpy/src/converters.pyx" +int __pyx_t_13_librootnumpy_VectorVectorStringConverter::write(Column *__pyx_v_col, void *__pyx_v_buffer) { + std::vector > *__pyx_v_tmp +#line 345 "root_numpy/src/converters.pyx" +; + unsigned long __pyx_v_numele +#line 345 "root_numpy/src/converters.pyx" +; + int __pyx_v_objsize +#line 345 "root_numpy/src/converters.pyx" +; + int __pyx_v_objtypecode +#line 345 "root_numpy/src/converters.pyx" +; + __pyx_t_13_librootnumpy_SIZE_t __pyx_v_dims[1] +#line 345 "root_numpy/src/converters.pyx" +; + PyArrayObject *__pyx_v_outer = 0 +#line 345 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_outerobj +#line 345 "root_numpy/src/converters.pyx" +; + char *__pyx_v_dataptr +#line 345 "root_numpy/src/converters.pyx" +; + unsigned long __pyx_v_i +#line 345 "root_numpy/src/converters.pyx" +; -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 345 "root_numpy/src/converters.pyx" + int __pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + unsigned long __pyx_t_3; + unsigned long __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 453 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 345 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("write", 0); -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_LEAF_PATTERN); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":346 + * cdef cppclass VectorVectorStringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): + * cdef vector[vector[string]]* tmp = col.GetValuePointer() # <<<<<<<<<<<<<< + * # this will hold number of subvectors + * cdef unsigned long numele + */ -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 346 "root_numpy/src/converters.pyx" + __pyx_v_tmp = ((std::vector > *)__pyx_v_col->GetValuePointer()); -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_4 = __Pyx_PyStr_FromString(__pyx_v_leaf_title); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":350 + * cdef unsigned long numele + * # these are defined solely for the outer array wrapper + * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< + * cdef int objtypecode = np.NPY_OBJECT + * numele = tmp[0].size() + */ -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 350 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_5 = NULL; +#line 350 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_6 = 0; +#line 350 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((PyArray_Descr *)__pyx_t_1)->elsize; -#line 453 "root_numpy/src/converters.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { +#line 350 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); +#line 350 "root_numpy/src/converters.pyx" + __pyx_v_objsize = __pyx_t_2; -#line 453 "root_numpy/src/converters.pyx" - if (likely(__pyx_t_5)) { + /* "root_numpy/src/converters.pyx":351 + * # these are defined solely for the outer array wrapper + * cdef int objsize = np.dtype('O').itemsize + * cdef int objtypecode = np.NPY_OBJECT # <<<<<<<<<<<<<< + * numele = tmp[0].size() + * # create an outer array container that dataptr points to, + */ -#line 453 "root_numpy/src/converters.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 351 "root_numpy/src/converters.pyx" + __pyx_v_objtypecode = NPY_OBJECT; -#line 453 "root_numpy/src/converters.pyx" - __Pyx_INCREF(__pyx_t_5); + /* "root_numpy/src/converters.pyx":352 + * cdef int objsize = np.dtype('O').itemsize + * cdef int objtypecode = np.NPY_OBJECT + * numele = tmp[0].size() # <<<<<<<<<<<<<< + * # create an outer array container that dataptr points to, + * # containing pointers from create_numpyarray(). + */ -#line 453 "root_numpy/src/converters.pyx" - __Pyx_INCREF(function); +#line 352 "root_numpy/src/converters.pyx" + __pyx_v_numele = (__pyx_v_tmp[0]).size(); -#line 453 "root_numpy/src/converters.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); + /* "root_numpy/src/converters.pyx":357 + * # define an (numele)-dimensional outer array to hold our subvectors fa + * cdef SIZE_t dims[1] + * dims[0] = numele # <<<<<<<<<<<<<< + * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) + * cdef PyObject* outerobj = outer # borrow ref + */ -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_6 = 1; +#line 357 "root_numpy/src/converters.pyx" + (__pyx_v_dims[0]) = __pyx_v_numele; -#line 453 "root_numpy/src/converters.pyx" - } + /* "root_numpy/src/converters.pyx":358 + * cdef SIZE_t dims[1] + * dims[0] = numele + * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) # <<<<<<<<<<<<<< + * cdef PyObject* outerobj = outer # borrow ref + * # increase one since we are putting in buffer directly + */ -#line 453 "root_numpy/src/converters.pyx" - } +#line 358 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyArray_EMPTY(1, __pyx_v_dims, __pyx_v_objtypecode, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 358 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 358 "root_numpy/src/converters.pyx" + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 453 "root_numpy/src/converters.pyx" - if (__pyx_t_5) { +#line 358 "root_numpy/src/converters.pyx" + __pyx_v_outer = ((PyArrayObject *)__pyx_t_1); -#line 453 "root_numpy/src/converters.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; +#line 358 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; -#line 453 "root_numpy/src/converters.pyx" - } + /* "root_numpy/src/converters.pyx":359 + * dims[0] = numele + * cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) + * cdef PyObject* outerobj = outer # borrow ref # <<<<<<<<<<<<<< + * # increase one since we are putting in buffer directly + * Py_INCREF(outer) + */ -#line 453 "root_numpy/src/converters.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2); +#line 359 "root_numpy/src/converters.pyx" + __pyx_v_outerobj = ((PyObject *)__pyx_v_outer); -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GIVEREF(__pyx_t_2); + /* "root_numpy/src/converters.pyx":361 + * cdef PyObject* outerobj = outer # borrow ref + * # increase one since we are putting in buffer directly + * Py_INCREF(outer) # <<<<<<<<<<<<<< + * # now write PyObject* to buffer + * memcpy(buffer, &outerobj, sizeof(PyObject*)) + */ -#line 453 "root_numpy/src/converters.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); +#line 361 "root_numpy/src/converters.pyx" + Py_INCREF(((PyObject *)__pyx_v_outer)); -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GIVEREF(__pyx_t_4); + /* "root_numpy/src/converters.pyx":363 + * Py_INCREF(outer) + * # now write PyObject* to buffer + * memcpy(buffer, &outerobj, sizeof(PyObject*)) # <<<<<<<<<<<<<< + * # build a dataptr pointing to outer, so we can shift and write each + * # of the subvectors + */ -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_2 = 0; +#line 363 "root_numpy/src/converters.pyx" + memcpy(__pyx_v_buffer, (&__pyx_v_outerobj), (sizeof(PyObject *))); -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_4 = 0; + /* "root_numpy/src/converters.pyx":366 + * # build a dataptr pointing to outer, so we can shift and write each + * # of the subvectors + * cdef char* dataptr = outer.data # <<<<<<<<<<<<<< + * # loop through all subvectors + * cdef unsigned long i + */ -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 366 "root_numpy/src/converters.pyx" + __pyx_v_dataptr = ((char *)__pyx_v_outer->data); -#line 453 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); + /* "root_numpy/src/converters.pyx":369 + * # loop through all subvectors + * cdef unsigned long i + * for i in range(numele): # <<<<<<<<<<<<<< + * create_numpyarray_vectorstring(&dataptr[i*objsize], &tmp[0][i]) + * return sizeof(outerobj) + */ -#line 453 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - -#line 453 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 369 "root_numpy/src/converters.pyx" + __pyx_t_3 = __pyx_v_numele; -#line 453 "root_numpy/src/converters.pyx" - __pyx_v_match = __pyx_t_1; +#line 369 "root_numpy/src/converters.pyx" + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { -#line 453 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; +#line 369 "root_numpy/src/converters.pyx" + __pyx_v_i = __pyx_t_4; - /* "root_numpy/src/converters.pyx":454 - * # Determine shape of this leaf - * match = re.match(LEAF_PATTERN, leaf_title) - * if match is not None: # <<<<<<<<<<<<<< - * arraydef = match.group(1) - * if arraydef is not None: + /* "root_numpy/src/converters.pyx":370 + * cdef unsigned long i + * for i in range(numele): + * create_numpyarray_vectorstring(&dataptr[i*objsize], &tmp[0][i]) # <<<<<<<<<<<<<< + * return sizeof(outerobj) + * */ -#line 454 "root_numpy/src/converters.pyx" - __pyx_t_8 = (__pyx_v_match != Py_None); - -#line 454 "root_numpy/src/converters.pyx" - __pyx_t_9 = (__pyx_t_8 != 0); +#line 370 "root_numpy/src/converters.pyx" + __pyx_f_13_librootnumpy_create_numpyarray_vectorstring((&(__pyx_v_dataptr[(__pyx_v_i * __pyx_v_objsize)])), (&((__pyx_v_tmp[0])[__pyx_v_i]))); -#line 454 "root_numpy/src/converters.pyx" - if (__pyx_t_9) { +#line 370 "root_numpy/src/converters.pyx" + } - /* "root_numpy/src/converters.pyx":455 - * match = re.match(LEAF_PATTERN, leaf_title) - * if match is not None: - * arraydef = match.group(1) # <<<<<<<<<<<<<< - * if arraydef is not None: - * arraytokens = arraydef.strip('[]').split('][') + /* "root_numpy/src/converters.pyx":371 + * for i in range(numele): + * create_numpyarray_vectorstring(&dataptr[i*objsize], &tmp[0][i]) + * return sizeof(outerobj) # <<<<<<<<<<<<<< + * + * */ -#line 455 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 455 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); - -#line 455 "root_numpy/src/converters.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 455 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); - -#line 455 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - -#line 455 "root_numpy/src/converters.pyx" - __pyx_v_arraydef = __pyx_t_3; +#line 371 "root_numpy/src/converters.pyx" + __pyx_r = (sizeof(__pyx_v_outerobj)); -#line 455 "root_numpy/src/converters.pyx" - __pyx_t_3 = 0; +#line 371 "root_numpy/src/converters.pyx" + goto __pyx_L0; - /* "root_numpy/src/converters.pyx":456 - * if match is not None: - * arraydef = match.group(1) - * if arraydef is not None: # <<<<<<<<<<<<<< - * arraytokens = arraydef.strip('[]').split('][') - * shape = [] + /* "root_numpy/src/converters.pyx":345 + * + * cdef cppclass VectorVectorStringConverter(ObjectConverterBase): + * int write(Column* col, void* buffer): # <<<<<<<<<<<<<< + * cdef vector[vector[string]]* tmp = col.GetValuePointer() + * # this will hold number of subvectors */ -#line 456 "root_numpy/src/converters.pyx" - __pyx_t_9 = (__pyx_v_arraydef != Py_None); +#line 345 "root_numpy/src/converters.pyx" -#line 456 "root_numpy/src/converters.pyx" - __pyx_t_8 = (__pyx_t_9 != 0); -#line 456 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 345 "root_numpy/src/converters.pyx" + /* function exit code */ - /* "root_numpy/src/converters.pyx":457 - * arraydef = match.group(1) - * if arraydef is not None: - * arraytokens = arraydef.strip('[]').split('][') # <<<<<<<<<<<<<< - * shape = [] - * # First group might be the name of the length-leaf - */ +#line 345 "root_numpy/src/converters.pyx" + __pyx_L1_error:; -#line 457 "root_numpy/src/converters.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arraydef, __pyx_n_s_strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 345 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_1); -#line 457 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 345 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("VectorVectorStringConverter.write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); -#line 457 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 345 "root_numpy/src/converters.pyx" + __pyx_r = 0; -#line 457 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 345 "root_numpy/src/converters.pyx" + __pyx_L0:; -#line 457 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 345 "root_numpy/src/converters.pyx" + __Pyx_XDECREF((PyObject *)__pyx_v_outer); -#line 457 "root_numpy/src/converters.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 345 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 457 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 345 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 457 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 345 "root_numpy/src/converters.pyx" +} -#line 457 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +/* "root_numpy/src/converters.pyx":448 + * + * + * cdef Converter* find_converter_by_typename(string typename): # <<<<<<<<<<<<<< + * it = CONVERTERS.find(typename) + * if it == CONVERTERS.end(): + */ -#line 457 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 448 "root_numpy/src/converters.pyx" -#line 457 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 457 "root_numpy/src/converters.pyx" - __pyx_v_arraytokens = __pyx_t_1; +#line 448 "root_numpy/src/converters.pyx" +static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_find_converter_by_typename(std::string __pyx_v_typename) { + std::map ::iterator __pyx_v_it +#line 448 "root_numpy/src/converters.pyx" +; -#line 457 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; +#line 448 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_Converter *__pyx_r; + __Pyx_RefNannyDeclarations + int __pyx_t_1; - /* "root_numpy/src/converters.pyx":458 - * if arraydef is not None: - * arraytokens = arraydef.strip('[]').split('][') - * shape = [] # <<<<<<<<<<<<<< - * # First group might be the name of the length-leaf - * if leaf_count != NULL: +#line 448 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("find_converter_by_typename", 0); + + /* "root_numpy/src/converters.pyx":449 + * + * cdef Converter* find_converter_by_typename(string typename): + * it = CONVERTERS.find(typename) # <<<<<<<<<<<<<< + * if it == CONVERTERS.end(): + * return NULL */ -#line 458 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 449 "root_numpy/src/converters.pyx" + __pyx_v_it = __pyx_v_13_librootnumpy_CONVERTERS.find(__pyx_v_typename); -#line 458 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); + /* "root_numpy/src/converters.pyx":450 + * cdef Converter* find_converter_by_typename(string typename): + * it = CONVERTERS.find(typename) + * if it == CONVERTERS.end(): # <<<<<<<<<<<<<< + * return NULL + * return deref(it).second + */ -#line 458 "root_numpy/src/converters.pyx" - __pyx_v_shape = ((PyObject*)__pyx_t_1); +#line 450 "root_numpy/src/converters.pyx" + __pyx_t_1 = ((__pyx_v_it == __pyx_v_13_librootnumpy_CONVERTERS.end()) != 0); -#line 458 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; +#line 450 "root_numpy/src/converters.pyx" + if (__pyx_t_1) { - /* "root_numpy/src/converters.pyx":460 - * shape = [] - * # First group might be the name of the length-leaf - * if leaf_count != NULL: # <<<<<<<<<<<<<< - * # Ignore leaf name token - * arraytokens.pop(0) + /* "root_numpy/src/converters.pyx":451 + * it = CONVERTERS.find(typename) + * if it == CONVERTERS.end(): + * return NULL # <<<<<<<<<<<<<< + * return deref(it).second + * */ -#line 460 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_leaf_count != NULL) != 0); +#line 451 "root_numpy/src/converters.pyx" + __pyx_r = NULL; -#line 460 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 451 "root_numpy/src/converters.pyx" + goto __pyx_L0; - /* "root_numpy/src/converters.pyx":462 - * if leaf_count != NULL: - * # Ignore leaf name token - * arraytokens.pop(0) # <<<<<<<<<<<<<< - * leaf_shape_type = VARIABLE_LENGTH_ARRAY - * else: - */ +#line 451 "root_numpy/src/converters.pyx" + } -#line 462 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_PopIndex(__pyx_v_arraytokens, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":452 + * if it == CONVERTERS.end(): + * return NULL + * return deref(it).second # <<<<<<<<<<<<<< + * + * + */ -#line 462 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 452 "root_numpy/src/converters.pyx" + __pyx_r = (*__pyx_v_it).second; -#line 462 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 452 "root_numpy/src/converters.pyx" + goto __pyx_L0; - /* "root_numpy/src/converters.pyx":463 - * # Ignore leaf name token - * arraytokens.pop(0) - * leaf_shape_type = VARIABLE_LENGTH_ARRAY # <<<<<<<<<<<<<< - * else: - * leaf_shape_type = FIXED_LENGTH_ARRAY + /* "root_numpy/src/converters.pyx":448 + * + * + * cdef Converter* find_converter_by_typename(string typename): # <<<<<<<<<<<<<< + * it = CONVERTERS.find(typename) + * if it == CONVERTERS.end(): */ -#line 463 "root_numpy/src/converters.pyx" - __pyx_v_leaf_shape_type = __pyx_e_13_librootnumpy_VARIABLE_LENGTH_ARRAY; - -#line 463 "root_numpy/src/converters.pyx" - goto __pyx_L5; +#line 448 "root_numpy/src/converters.pyx" -#line 463 "root_numpy/src/converters.pyx" - } -#line 463 "root_numpy/src/converters.pyx" - /*else*/ { +#line 448 "root_numpy/src/converters.pyx" + /* function exit code */ - /* "root_numpy/src/converters.pyx":465 - * leaf_shape_type = VARIABLE_LENGTH_ARRAY - * else: - * leaf_shape_type = FIXED_LENGTH_ARRAY # <<<<<<<<<<<<<< - * shape.extend([int(token) for token in arraytokens]) - * leaf_shape = tuple(shape) - */ +#line 448 "root_numpy/src/converters.pyx" + __pyx_L0:; -#line 465 "root_numpy/src/converters.pyx" - __pyx_v_leaf_shape_type = __pyx_e_13_librootnumpy_FIXED_LENGTH_ARRAY; +#line 448 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 465 "root_numpy/src/converters.pyx" - } +#line 448 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 465 "root_numpy/src/converters.pyx" - __pyx_L5:; +#line 448 "root_numpy/src/converters.pyx" +} - /* "root_numpy/src/converters.pyx":466 - * else: - * leaf_shape_type = FIXED_LENGTH_ARRAY - * shape.extend([int(token) for token in arraytokens]) # <<<<<<<<<<<<<< - * leaf_shape = tuple(shape) +/* "root_numpy/src/converters.pyx":461 * + * + * cdef Converter* get_converter(TLeaf* leaf, char type_code): # <<<<<<<<<<<<<< + * # Find existing converter or attempt to create a new one + * cdef Converter* conv */ -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 466 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 461 "root_numpy/src/converters.pyx" -#line 466 "root_numpy/src/converters.pyx" - if (likely(PyList_CheckExact(__pyx_v_arraytokens)) || PyTuple_CheckExact(__pyx_v_arraytokens)) { -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_3 = __pyx_v_arraytokens; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0; +#line 461 "root_numpy/src/converters.pyx" +static __pyx_t_13_librootnumpy_Converter *__pyx_f_13_librootnumpy_get_converter(TLeaf *__pyx_v_leaf, char __pyx_v_type_code) { + __pyx_t_13_librootnumpy_Converter *__pyx_v_conv +#line 461 "root_numpy/src/converters.pyx" +; + __pyx_t_13_librootnumpy_Converter *__pyx_v_basic_conv +#line 461 "root_numpy/src/converters.pyx" +; + TLeaf *__pyx_v_leaf_count +#line 461 "root_numpy/src/converters.pyx" +; + enum __pyx_t_13_librootnumpy_LeafShapeType __pyx_v_leaf_shape_type +#line 461 "root_numpy/src/converters.pyx" +; + __pyx_t_13_librootnumpy_SIZE_t *__pyx_v_dims +#line 461 "root_numpy/src/converters.pyx" +; + int __pyx_v_ndim +#line 461 "root_numpy/src/converters.pyx" +; + int __pyx_v_idim +#line 461 "root_numpy/src/converters.pyx" +; + int __pyx_v_leaf_length +#line 461 "root_numpy/src/converters.pyx" +; + CYTHON_UNUSED const char *__pyx_v_leaf_name +#line 461 "root_numpy/src/converters.pyx" +; + const char *__pyx_v_leaf_title +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_leaf_type = NULL +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_leaf_shape = NULL +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_match = NULL +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_arraydef = NULL +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_arraytokens = NULL +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_shape = NULL +#line 461 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_token = NULL +#line 461 "root_numpy/src/converters.pyx" +; -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_10 = NULL; +#line 461 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_Converter *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + std::string __pyx_t_7; + __pyx_t_13_librootnumpy_CONVERTERS_ITEM __pyx_t_8; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + int __pyx_t_11; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + int __pyx_t_14; + long __pyx_t_15; + __pyx_t_13_librootnumpy_SIZE_t __pyx_t_16; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 466 "root_numpy/src/converters.pyx" - } else { - __pyx_t_6 = -1; -#line 466 "root_numpy/src/converters.pyx" -__pyx_t_3 = PyObject_GetIter(__pyx_v_arraytokens); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 461 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("get_converter", 0); -#line 466 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_3); + /* "root_numpy/src/converters.pyx":465 + * cdef Converter* conv + * cdef Converter* basic_conv + * cdef TLeaf* leaf_count = leaf.GetLeafCount() # <<<<<<<<<<<<<< + * cdef LeafShapeType leaf_shape_type = SINGLE_VALUE + * cdef SIZE_t* dims + */ -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 465 "root_numpy/src/converters.pyx" + __pyx_v_leaf_count = __pyx_v_leaf->GetLeafCount(); -#line 466 "root_numpy/src/converters.pyx" - } + /* "root_numpy/src/converters.pyx":466 + * cdef Converter* basic_conv + * cdef TLeaf* leaf_count = leaf.GetLeafCount() + * cdef LeafShapeType leaf_shape_type = SINGLE_VALUE # <<<<<<<<<<<<<< + * cdef SIZE_t* dims + * cdef int ndim, idim, leaf_length + */ #line 466 "root_numpy/src/converters.pyx" - for (;;) { + __pyx_v_leaf_shape_type = __pyx_e_13_librootnumpy_SINGLE_VALUE; -#line 466 "root_numpy/src/converters.pyx" - if (likely(!__pyx_t_10)) { + /* "root_numpy/src/converters.pyx":470 + * cdef int ndim, idim, leaf_length + * + * leaf_name = leaf.GetName() # <<<<<<<<<<<<<< + * leaf_title = leaf.GetTitle() + * leaf_type = resolve_type(leaf.GetTypeName()) + */ -#line 466 "root_numpy/src/converters.pyx" - if (likely(PyList_CheckExact(__pyx_t_3))) { +#line 470 "root_numpy/src/converters.pyx" + __pyx_v_leaf_name = __pyx_v_leaf->GetName(); -#line 466 "root_numpy/src/converters.pyx" - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break; + /* "root_numpy/src/converters.pyx":471 + * + * leaf_name = leaf.GetName() + * leaf_title = leaf.GetTitle() # <<<<<<<<<<<<<< + * leaf_type = resolve_type(leaf.GetTypeName()) + * + */ -#line 466 "root_numpy/src/converters.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 471 "root_numpy/src/converters.pyx" + __pyx_v_leaf_title = __pyx_v_leaf->GetTitle(); -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":472 + * leaf_name = leaf.GetName() + * leaf_title = leaf.GetTitle() + * leaf_type = resolve_type(leaf.GetTypeName()) # <<<<<<<<<<<<<< + * + * # Special case for null-terminated char array string + */ -#line 466 "root_numpy/src/converters.pyx" - #else +#line 472 "root_numpy/src/converters.pyx" + __pyx_t_1 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_leaf->GetTypeName()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 472 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 466 "root_numpy/src/converters.pyx" - #endif +#line 472 "root_numpy/src/converters.pyx" + __pyx_v_leaf_type = ((PyObject*)__pyx_t_1); -#line 466 "root_numpy/src/converters.pyx" - } else { +#line 472 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; -#line 466 "root_numpy/src/converters.pyx" - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break; + /* "root_numpy/src/converters.pyx":475 + * + * # Special case for null-terminated char array string + * if type_code == 'C': # <<<<<<<<<<<<<< + * leaf_length = leaf.GetLenStatic() + * conv = find_converter_by_typename(leaf_type + '[{0:d}]/C'.format(leaf_length)) + */ -#line 466 "root_numpy/src/converters.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 475 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_type_code == 'C') != 0); -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 475 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 466 "root_numpy/src/converters.pyx" - #else + /* "root_numpy/src/converters.pyx":476 + * # Special case for null-terminated char array string + * if type_code == 'C': + * leaf_length = leaf.GetLenStatic() # <<<<<<<<<<<<<< + * conv = find_converter_by_typename(leaf_type + '[{0:d}]/C'.format(leaf_length)) + * if conv == NULL: + */ -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 476 "root_numpy/src/converters.pyx" + __pyx_v_leaf_length = __pyx_v_leaf->GetLenStatic(); -#line 466 "root_numpy/src/converters.pyx" - #endif + /* "root_numpy/src/converters.pyx":477 + * if type_code == 'C': + * leaf_length = leaf.GetLenStatic() + * conv = find_converter_by_typename(leaf_type + '[{0:d}]/C'.format(leaf_length)) # <<<<<<<<<<<<<< + * if conv == NULL: + * conv = new CharArrayConverter(leaf_length - 1) # exclude null-termination + */ -#line 466 "root_numpy/src/converters.pyx" - } - } else -#line 466 "root_numpy/src/converters.pyx" -{ +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d_C, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = __pyx_t_10(__pyx_t_3); +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 466 "root_numpy/src/converters.pyx" - if (unlikely(!__pyx_t_7)) { +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_leaf_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 466 "root_numpy/src/converters.pyx" - PyObject* exc_type = PyErr_Occurred(); +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 466 "root_numpy/src/converters.pyx" - if (exc_type) { +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_5 = NULL; -#line 466 "root_numpy/src/converters.pyx" - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); +#line 477 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { -#line 466 "root_numpy/src/converters.pyx" - else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); -#line 466 "root_numpy/src/converters.pyx" - } +#line 477 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_5)) { -#line 466 "root_numpy/src/converters.pyx" - break; +#line 477 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); -#line 466 "root_numpy/src/converters.pyx" - } +#line 477 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_5); -#line 466 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 477 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); -#line 466 "root_numpy/src/converters.pyx" - } +#line 477 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); -#line 466 "root_numpy/src/converters.pyx" - __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_7); +#line 477 "root_numpy/src/converters.pyx" + } -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = 0; +#line 477 "root_numpy/src/converters.pyx" + } -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_7 = PyNumber_Int(__pyx_v_token); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 477 "root_numpy/src/converters.pyx" + if (!__pyx_t_5) { -#line 466 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 466 "root_numpy/src/converters.pyx" - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 477 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 466 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 466 "root_numpy/src/converters.pyx" - } +#line 477 "root_numpy/src/converters.pyx" + } else { -#line 466 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 466 "root_numpy/src/converters.pyx" - __pyx_t_11 = __Pyx_PyList_Extend(__pyx_v_shape, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_6); -#line 466 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 477 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; - /* "root_numpy/src/converters.pyx":467 - * leaf_shape_type = FIXED_LENGTH_ARRAY - * shape.extend([int(token) for token in arraytokens]) - * leaf_shape = tuple(shape) # <<<<<<<<<<<<<< - * - * if leaf_shape_type == SINGLE_VALUE: - */ +#line 477 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); -#line 467 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyList_AsTuple(__pyx_v_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_4); -#line 467 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_4 = 0; -#line 467 "root_numpy/src/converters.pyx" - __Pyx_DECREF_SET(__pyx_v_leaf_shape, ((PyObject*)__pyx_t_1)); +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 467 "root_numpy/src/converters.pyx" - __pyx_t_1 = 0; +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 467 "root_numpy/src/converters.pyx" - goto __pyx_L4; +#line 477 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 467 "root_numpy/src/converters.pyx" +#line 477 "root_numpy/src/converters.pyx" } -#line 467 "root_numpy/src/converters.pyx" - __pyx_L4:; +#line 477 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 467 "root_numpy/src/converters.pyx" - goto __pyx_L3; +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_3 = PyNumber_Add(__pyx_v_leaf_type, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 467 "root_numpy/src/converters.pyx" - } +#line 477 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 467 "root_numpy/src/converters.pyx" - __pyx_L3:; +#line 477 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":469 - * leaf_shape = tuple(shape) - * - * if leaf_shape_type == SINGLE_VALUE: # <<<<<<<<<<<<<< - * return find_converter_by_typename(leaf_type) - * - */ +#line 477 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_t_3); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 469 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_leaf_shape_type == __pyx_e_13_librootnumpy_SINGLE_VALUE) != 0); +#line 477 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 469 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 477 "root_numpy/src/converters.pyx" + __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_7); - /* "root_numpy/src/converters.pyx":470 - * - * if leaf_shape_type == SINGLE_VALUE: - * return find_converter_by_typename(leaf_type) # <<<<<<<<<<<<<< - * - * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: + /* "root_numpy/src/converters.pyx":478 + * leaf_length = leaf.GetLenStatic() + * conv = find_converter_by_typename(leaf_type + '[{0:d}]/C'.format(leaf_length)) + * if conv == NULL: # <<<<<<<<<<<<<< + * conv = new CharArrayConverter(leaf_length - 1) # exclude null-termination + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + '[{0:d}]/C'.format(leaf_length), conv)) */ -#line 470 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_v_leaf_type); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 470 "root_numpy/src/converters.pyx" - __pyx_r = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_12); - -#line 470 "root_numpy/src/converters.pyx" - goto __pyx_L0; +#line 478 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_conv == NULL) != 0); -#line 470 "root_numpy/src/converters.pyx" - } +#line 478 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { - /* "root_numpy/src/converters.pyx":472 - * return find_converter_by_typename(leaf_type) - * - * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: # <<<<<<<<<<<<<< - * conv = find_converter_by_typename(leaf_type + arraydef) + /* "root_numpy/src/converters.pyx":479 + * conv = find_converter_by_typename(leaf_type + '[{0:d}]/C'.format(leaf_length)) * if conv == NULL: + * conv = new CharArrayConverter(leaf_length - 1) # exclude null-termination # <<<<<<<<<<<<<< + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + '[{0:d}]/C'.format(leaf_length), conv)) + * return conv */ -#line 472 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_leaf_shape_type == __pyx_e_13_librootnumpy_VARIABLE_LENGTH_ARRAY) != 0); - -#line 472 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 479 "root_numpy/src/converters.pyx" + __pyx_v_conv = new __pyx_t_13_librootnumpy_CharArrayConverter((__pyx_v_leaf_length - 1)); - /* "root_numpy/src/converters.pyx":473 - * - * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: - * conv = find_converter_by_typename(leaf_type + arraydef) # <<<<<<<<<<<<<< + /* "root_numpy/src/converters.pyx":480 * if conv == NULL: - * # Create new converter on demand + * conv = new CharArrayConverter(leaf_length - 1) # exclude null-termination + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + '[{0:d}]/C'.format(leaf_length), conv)) # <<<<<<<<<<<<<< + * return conv + * */ -#line 473 "root_numpy/src/converters.pyx" - if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d_C, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 473 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 480 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 473 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_leaf_length); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 473 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 480 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_6); -#line 473 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_4 = NULL; -#line 473 "root_numpy/src/converters.pyx" - __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_12); +#line 480 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) { - /* "root_numpy/src/converters.pyx":474 - * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: - * conv = find_converter_by_typename(leaf_type + arraydef) - * if conv == NULL: # <<<<<<<<<<<<<< - * # Create new converter on demand - * basic_conv = find_converter_by_typename(leaf_type) - */ +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); -#line 474 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_conv == NULL) != 0); +#line 480 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_4)) { -#line 474 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 480 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - /* "root_numpy/src/converters.pyx":476 - * if conv == NULL: - * # Create new converter on demand - * basic_conv = find_converter_by_typename(leaf_type) # <<<<<<<<<<<<<< - * if basic_conv == NULL: - * return NULL - */ +#line 480 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_4); -#line 476 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_v_leaf_type); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 480 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); -#line 476 "root_numpy/src/converters.pyx" - __pyx_v_basic_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_12); +#line 480 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_1, function); - /* "root_numpy/src/converters.pyx":477 - * # Create new converter on demand - * basic_conv = find_converter_by_typename(leaf_type) - * if basic_conv == NULL: # <<<<<<<<<<<<<< - * return NULL - * ndim = len(leaf_shape) + 1 - */ +#line 480 "root_numpy/src/converters.pyx" + } -#line 477 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_basic_conv == NULL) != 0); +#line 480 "root_numpy/src/converters.pyx" + } -#line 477 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 480 "root_numpy/src/converters.pyx" + if (!__pyx_t_4) { - /* "root_numpy/src/converters.pyx":478 - * basic_conv = find_converter_by_typename(leaf_type) - * if basic_conv == NULL: - * return NULL # <<<<<<<<<<<<<< - * ndim = len(leaf_shape) + 1 - * dims = malloc(ndim * sizeof(SIZE_t)) - */ +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 478 "root_numpy/src/converters.pyx" - __pyx_r = NULL; +#line 480 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 478 "root_numpy/src/converters.pyx" - goto __pyx_L0; +#line 480 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 478 "root_numpy/src/converters.pyx" - } +#line 480 "root_numpy/src/converters.pyx" + } else { - /* "root_numpy/src/converters.pyx":479 - * if basic_conv == NULL: - * return NULL - * ndim = len(leaf_shape) + 1 # <<<<<<<<<<<<<< - * dims = malloc(ndim * sizeof(SIZE_t)) - * for idim from 1 <= idim < ndim: - */ +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 479 "root_numpy/src/converters.pyx" - __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v_leaf_shape); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 480 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 479 "root_numpy/src/converters.pyx" - __pyx_v_ndim = (__pyx_t_6 + 1); +#line 480 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; - /* "root_numpy/src/converters.pyx":480 - * return NULL - * ndim = len(leaf_shape) + 1 - * dims = malloc(ndim * sizeof(SIZE_t)) # <<<<<<<<<<<<<< - * for idim from 1 <= idim < ndim: - * dims[idim] = leaf_shape[idim - 1] - */ +#line 480 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6); #line 480 "root_numpy/src/converters.pyx" - __pyx_v_dims = ((__pyx_t_13_librootnumpy_SIZE_t *)malloc((__pyx_v_ndim * (sizeof(__pyx_t_13_librootnumpy_SIZE_t))))); + __Pyx_GIVEREF(__pyx_t_6); - /* "root_numpy/src/converters.pyx":481 - * ndim = len(leaf_shape) + 1 - * dims = malloc(ndim * sizeof(SIZE_t)) - * for idim from 1 <= idim < ndim: # <<<<<<<<<<<<<< - * dims[idim] = leaf_shape[idim - 1] - * conv = new VaryArrayConverter( - */ +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_6 = 0; -#line 481 "root_numpy/src/converters.pyx" - __pyx_t_13 = __pyx_v_ndim; +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 481 "root_numpy/src/converters.pyx" - for (__pyx_v_idim = 1; __pyx_v_idim < __pyx_t_13; __pyx_v_idim++) { +#line 480 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); - /* "root_numpy/src/converters.pyx":482 - * dims = malloc(ndim * sizeof(SIZE_t)) - * for idim from 1 <= idim < ndim: - * dims[idim] = leaf_shape[idim - 1] # <<<<<<<<<<<<<< - * conv = new VaryArrayConverter( - * basic_conv, ndim, dims) - */ +#line 480 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 482 "root_numpy/src/converters.pyx" - __pyx_t_14 = (__pyx_v_idim - 1); +#line 480 "root_numpy/src/converters.pyx" + } -#line 482 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_leaf_shape, __pyx_t_14, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 480 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 482 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyNumber_Add(__pyx_v_leaf_type, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 482 "root_numpy/src/converters.pyx" - __pyx_t_15 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_15 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 480 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 482 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 480 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 480 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 480 "root_numpy/src/converters.pyx" + try { + +#line 480 "root_numpy/src/converters.pyx" + __pyx_t_8 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_7, __pyx_v_conv); -#line 482 "root_numpy/src/converters.pyx" - (__pyx_v_dims[__pyx_v_idim]) = __pyx_t_15; +#line 480 "root_numpy/src/converters.pyx" + } catch(...) { + +#line 480 "root_numpy/src/converters.pyx" + __Pyx_CppExn2PyErr(); + +#line 480 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 482 "root_numpy/src/converters.pyx" +#line 480 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":483 - * for idim from 1 <= idim < ndim: - * dims[idim] = leaf_shape[idim - 1] - * conv = new VaryArrayConverter( # <<<<<<<<<<<<<< - * basic_conv, ndim, dims) - * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) +#line 480 "root_numpy/src/converters.pyx" + __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_8); + +#line 480 "root_numpy/src/converters.pyx" + goto __pyx_L4; + +#line 480 "root_numpy/src/converters.pyx" + } + +#line 480 "root_numpy/src/converters.pyx" + __pyx_L4:; + + /* "root_numpy/src/converters.pyx":481 + * conv = new CharArrayConverter(leaf_length - 1) # exclude null-termination + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + '[{0:d}]/C'.format(leaf_length), conv)) + * return conv # <<<<<<<<<<<<<< + * + * # Determine shape of this leaf */ -#line 483 "root_numpy/src/converters.pyx" - __pyx_v_conv = new __pyx_t_13_librootnumpy_VaryArrayConverter(((__pyx_t_13_librootnumpy_BasicConverter *)__pyx_v_basic_conv), __pyx_v_ndim, __pyx_v_dims); +#line 481 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_v_conv; - /* "root_numpy/src/converters.pyx":485 - * conv = new VaryArrayConverter( - * basic_conv, ndim, dims) - * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) # <<<<<<<<<<<<<< - * return conv +#line 481 "root_numpy/src/converters.pyx" + goto __pyx_L0; + +#line 481 "root_numpy/src/converters.pyx" + } + + /* "root_numpy/src/converters.pyx":484 * + * # Determine shape of this leaf + * leaf_shape = () # <<<<<<<<<<<<<< + * match = re.match(LEAF_PATTERN, leaf_title) + * if match is not None: + */ + +#line 484 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_empty_tuple); + +#line 484 "root_numpy/src/converters.pyx" + __pyx_v_leaf_shape = __pyx_empty_tuple; + + /* "root_numpy/src/converters.pyx":485 + * # Determine shape of this leaf + * leaf_shape = () + * match = re.match(LEAF_PATTERN, leaf_title) # <<<<<<<<<<<<<< + * if match is not None: + * arraydef = match.group(1) */ #line 485 "root_numpy/src/converters.pyx" - if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 485 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); #line 485 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_match); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 485 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); #line 485 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; #line 485 "root_numpy/src/converters.pyx" - try { + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_LEAF_PATTERN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 485 "root_numpy/src/converters.pyx" - __pyx_t_16 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_12, __pyx_v_conv); + __Pyx_GOTREF(__pyx_t_3); #line 485 "root_numpy/src/converters.pyx" - } catch(...) { + __pyx_t_6 = __Pyx_PyStr_FromString(__pyx_v_leaf_title); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 485 "root_numpy/src/converters.pyx" - __Pyx_CppExn2PyErr(); + __Pyx_GOTREF(__pyx_t_6); #line 485 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = NULL; #line 485 "root_numpy/src/converters.pyx" - } + __pyx_t_9 = 0; #line 485 "root_numpy/src/converters.pyx" - __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_16); + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { #line 485 "root_numpy/src/converters.pyx" - goto __pyx_L10; + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); + +#line 485 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_4)) { + +#line 485 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_4); + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_5, function); + +#line 485 "root_numpy/src/converters.pyx" + __pyx_t_9 = 1; #line 485 "root_numpy/src/converters.pyx" } #line 485 "root_numpy/src/converters.pyx" - __pyx_L10:; + } - /* "root_numpy/src/converters.pyx":486 - * basic_conv, ndim, dims) - * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) - * return conv # <<<<<<<<<<<<<< - * - * # Fixed-length array +#line 485 "root_numpy/src/converters.pyx" + __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_10); + +#line 485 "root_numpy/src/converters.pyx" + if (__pyx_t_4) { + +#line 485 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + +#line 485 "root_numpy/src/converters.pyx" + } + +#line 485 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_3); + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_3); + +#line 485 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6); + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_6); + +#line 485 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; + +#line 485 "root_numpy/src/converters.pyx" + __pyx_t_6 = 0; + +#line 485 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + +#line 485 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 485 "root_numpy/src/converters.pyx" + __pyx_v_match = __pyx_t_1; + +#line 485 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; + + /* "root_numpy/src/converters.pyx":486 + * leaf_shape = () + * match = re.match(LEAF_PATTERN, leaf_title) + * if match is not None: # <<<<<<<<<<<<<< + * arraydef = match.group(1) + * if arraydef is not None: */ #line 486 "root_numpy/src/converters.pyx" - __pyx_r = __pyx_v_conv; + __pyx_t_2 = (__pyx_v_match != Py_None); #line 486 "root_numpy/src/converters.pyx" - goto __pyx_L0; + __pyx_t_11 = (__pyx_t_2 != 0); #line 486 "root_numpy/src/converters.pyx" - } + if (__pyx_t_11) { - /* "root_numpy/src/converters.pyx":489 - * - * # Fixed-length array - * conv = find_converter_by_typename(leaf_type + arraydef) # <<<<<<<<<<<<<< - * if conv == NULL: - * # Create new converter on demand + /* "root_numpy/src/converters.pyx":487 + * match = re.match(LEAF_PATTERN, leaf_title) + * if match is not None: + * arraydef = match.group(1) # <<<<<<<<<<<<<< + * if arraydef is not None: + * arraytokens = arraydef.strip('[]').split('][') + */ + +#line 487 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 487 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 487 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 487 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); + +#line 487 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 487 "root_numpy/src/converters.pyx" + __pyx_v_arraydef = __pyx_t_5; + +#line 487 "root_numpy/src/converters.pyx" + __pyx_t_5 = 0; + + /* "root_numpy/src/converters.pyx":488 + * if match is not None: + * arraydef = match.group(1) + * if arraydef is not None: # <<<<<<<<<<<<<< + * arraytokens = arraydef.strip('[]').split('][') + * shape = [] + */ + +#line 488 "root_numpy/src/converters.pyx" + __pyx_t_11 = (__pyx_v_arraydef != Py_None); + +#line 488 "root_numpy/src/converters.pyx" + __pyx_t_2 = (__pyx_t_11 != 0); + +#line 488 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/converters.pyx":489 + * arraydef = match.group(1) + * if arraydef is not None: + * arraytokens = arraydef.strip('[]').split('][') # <<<<<<<<<<<<<< + * shape = [] + * # First group might be the name of the length-leaf */ #line 489 "root_numpy/src/converters.pyx" - if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arraydef, __pyx_n_s_strip); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 489 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); #line 489 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 489 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); #line 489 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; #line 489 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 489 "root_numpy/src/converters.pyx" - __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_12); + __Pyx_GOTREF(__pyx_t_5); - /* "root_numpy/src/converters.pyx":490 - * # Fixed-length array - * conv = find_converter_by_typename(leaf_type + arraydef) - * if conv == NULL: # <<<<<<<<<<<<<< - * # Create new converter on demand - * basic_conv = find_converter_by_typename(leaf_type) +#line 489 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 489 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 489 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 489 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 489 "root_numpy/src/converters.pyx" + __pyx_v_arraytokens = __pyx_t_1; + +#line 489 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; + + /* "root_numpy/src/converters.pyx":490 + * if arraydef is not None: + * arraytokens = arraydef.strip('[]').split('][') + * shape = [] # <<<<<<<<<<<<<< + * # First group might be the name of the length-leaf + * if leaf_count != NULL: */ #line 490 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_conv == NULL) != 0); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 490 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { - - /* "root_numpy/src/converters.pyx":492 - * if conv == NULL: - * # Create new converter on demand - * basic_conv = find_converter_by_typename(leaf_type) # <<<<<<<<<<<<<< - * if basic_conv == NULL: - * return NULL - */ + __Pyx_GOTREF(__pyx_t_1); -#line 492 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_v_leaf_type); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 490 "root_numpy/src/converters.pyx" + __pyx_v_shape = ((PyObject*)__pyx_t_1); -#line 492 "root_numpy/src/converters.pyx" - __pyx_v_basic_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_12); +#line 490 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":493 - * # Create new converter on demand - * basic_conv = find_converter_by_typename(leaf_type) - * if basic_conv == NULL: # <<<<<<<<<<<<<< - * return NULL - * conv = new FixedArrayConverter( + /* "root_numpy/src/converters.pyx":492 + * shape = [] + * # First group might be the name of the length-leaf + * if leaf_count != NULL: # <<<<<<<<<<<<<< + * # Ignore leaf name token + * arraytokens.pop(0) */ -#line 493 "root_numpy/src/converters.pyx" - __pyx_t_8 = ((__pyx_v_basic_conv == NULL) != 0); +#line 492 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_leaf_count != NULL) != 0); -#line 493 "root_numpy/src/converters.pyx" - if (__pyx_t_8) { +#line 492 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { - /* "root_numpy/src/converters.pyx":494 - * basic_conv = find_converter_by_typename(leaf_type) - * if basic_conv == NULL: - * return NULL # <<<<<<<<<<<<<< - * conv = new FixedArrayConverter( - * basic_conv, leaf_shape) + /* "root_numpy/src/converters.pyx":494 + * if leaf_count != NULL: + * # Ignore leaf name token + * arraytokens.pop(0) # <<<<<<<<<<<<<< + * leaf_shape_type = VARIABLE_LENGTH_ARRAY + * else: */ #line 494 "root_numpy/src/converters.pyx" - __pyx_r = NULL; + __pyx_t_1 = __Pyx_PyObject_PopIndex(__pyx_v_arraytokens, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 494 "root_numpy/src/converters.pyx" - goto __pyx_L0; + __Pyx_GOTREF(__pyx_t_1); #line 494 "root_numpy/src/converters.pyx" - } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":495 - * if basic_conv == NULL: - * return NULL - * conv = new FixedArrayConverter( # <<<<<<<<<<<<<< - * basic_conv, leaf_shape) - * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) + /* "root_numpy/src/converters.pyx":495 + * # Ignore leaf name token + * arraytokens.pop(0) + * leaf_shape_type = VARIABLE_LENGTH_ARRAY # <<<<<<<<<<<<<< + * else: + * leaf_shape_type = FIXED_LENGTH_ARRAY */ #line 495 "root_numpy/src/converters.pyx" - __pyx_v_conv = new __pyx_t_13_librootnumpy_FixedArrayConverter(((__pyx_t_13_librootnumpy_BasicConverter *)__pyx_v_basic_conv), ((PyObject *)__pyx_v_leaf_shape)); + __pyx_v_leaf_shape_type = __pyx_e_13_librootnumpy_VARIABLE_LENGTH_ARRAY; - /* "root_numpy/src/converters.pyx":497 - * conv = new FixedArrayConverter( - * basic_conv, leaf_shape) - * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) # <<<<<<<<<<<<<< - * return conv - * - */ +#line 495 "root_numpy/src/converters.pyx" + goto __pyx_L7; -#line 497 "root_numpy/src/converters.pyx" - if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } +#line 495 "root_numpy/src/converters.pyx" + } -#line 497 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 495 "root_numpy/src/converters.pyx" + /*else*/ { -#line 497 "root_numpy/src/converters.pyx" - __Pyx_GOTREF(__pyx_t_1); + /* "root_numpy/src/converters.pyx":497 + * leaf_shape_type = VARIABLE_LENGTH_ARRAY + * else: + * leaf_shape_type = FIXED_LENGTH_ARRAY # <<<<<<<<<<<<<< + * shape.extend([int(token) for token in arraytokens]) + * leaf_shape = tuple(shape) + */ #line 497 "root_numpy/src/converters.pyx" - __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_leaf_shape_type = __pyx_e_13_librootnumpy_FIXED_LENGTH_ARRAY; #line 497 "root_numpy/src/converters.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } #line 497 "root_numpy/src/converters.pyx" - try { + __pyx_L7:; -#line 497 "root_numpy/src/converters.pyx" - __pyx_t_16 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_12, __pyx_v_conv); + /* "root_numpy/src/converters.pyx":498 + * else: + * leaf_shape_type = FIXED_LENGTH_ARRAY + * shape.extend([int(token) for token in arraytokens]) # <<<<<<<<<<<<<< + * leaf_shape = tuple(shape) + * + */ -#line 497 "root_numpy/src/converters.pyx" - } catch(...) { +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 497 "root_numpy/src/converters.pyx" - __Pyx_CppExn2PyErr(); +#line 498 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 497 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 498 "root_numpy/src/converters.pyx" + if (likely(PyList_CheckExact(__pyx_v_arraytokens)) || PyTuple_CheckExact(__pyx_v_arraytokens)) { -#line 497 "root_numpy/src/converters.pyx" - } +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_5 = __pyx_v_arraytokens; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0; -#line 497 "root_numpy/src/converters.pyx" - __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_16); +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_12 = NULL; -#line 497 "root_numpy/src/converters.pyx" - goto __pyx_L14; +#line 498 "root_numpy/src/converters.pyx" + } else { + __pyx_t_9 = -1; +#line 498 "root_numpy/src/converters.pyx" +__pyx_t_5 = PyObject_GetIter(__pyx_v_arraytokens); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 497 "root_numpy/src/converters.pyx" - } +#line 498 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 497 "root_numpy/src/converters.pyx" - __pyx_L14:; +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_12 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":498 - * basic_conv, leaf_shape) - * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) - * return conv # <<<<<<<<<<<<<< - * - * - */ +#line 498 "root_numpy/src/converters.pyx" + } #line 498 "root_numpy/src/converters.pyx" - __pyx_r = __pyx_v_conv; + for (;;) { #line 498 "root_numpy/src/converters.pyx" - goto __pyx_L0; + if (likely(!__pyx_t_12)) { - /* "root_numpy/src/converters.pyx":438 - * - * - * cdef Converter* get_converter(TLeaf* leaf): # <<<<<<<<<<<<<< - * # Find existing converter or attempt to create a new one - * cdef Converter* conv - */ +#line 498 "root_numpy/src/converters.pyx" + if (likely(PyList_CheckExact(__pyx_t_5))) { -#line 438 "root_numpy/src/converters.pyx" +#line 498 "root_numpy/src/converters.pyx" + if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break; +#line 498 "root_numpy/src/converters.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 438 "root_numpy/src/converters.pyx" - /* function exit code */ +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 438 "root_numpy/src/converters.pyx" - __pyx_L1_error:; +#line 498 "root_numpy/src/converters.pyx" + #else -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_1); +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_2); +#line 498 "root_numpy/src/converters.pyx" + #endif -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 498 "root_numpy/src/converters.pyx" + } else { -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_4); +#line 498 "root_numpy/src/converters.pyx" + if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break; -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_5); +#line 498 "root_numpy/src/converters.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_t_7); +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 438 "root_numpy/src/converters.pyx" - __Pyx_WriteUnraisable("_librootnumpy.get_converter", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 498 "root_numpy/src/converters.pyx" + #else -#line 438 "root_numpy/src/converters.pyx" - __pyx_r = 0; +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 438 "root_numpy/src/converters.pyx" - __pyx_L0:; +#line 498 "root_numpy/src/converters.pyx" + #endif -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_leaf_type); +#line 498 "root_numpy/src/converters.pyx" + } + } else +#line 498 "root_numpy/src/converters.pyx" +{ -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_leaf_shape); +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = __pyx_t_12(__pyx_t_5); -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_match); +#line 498 "root_numpy/src/converters.pyx" + if (unlikely(!__pyx_t_10)) { -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_arraydef); +#line 498 "root_numpy/src/converters.pyx" + PyObject* exc_type = PyErr_Occurred(); -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_arraytokens); +#line 498 "root_numpy/src/converters.pyx" + if (exc_type) { -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_shape); +#line 498 "root_numpy/src/converters.pyx" + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 438 "root_numpy/src/converters.pyx" - __Pyx_XDECREF(__pyx_v_token); +#line 498 "root_numpy/src/converters.pyx" + else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 438 "root_numpy/src/converters.pyx" - __Pyx_RefNannyFinishContext(); +#line 498 "root_numpy/src/converters.pyx" + } -#line 438 "root_numpy/src/converters.pyx" - return __pyx_r; +#line 498 "root_numpy/src/converters.pyx" + break; -#line 438 "root_numpy/src/converters.pyx" -} +#line 498 "root_numpy/src/converters.pyx" + } + +#line 498 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_10); + +#line 498 "root_numpy/src/converters.pyx" + } + +#line 498 "root_numpy/src/converters.pyx" + __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_10); + +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = 0; + +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_10 = PyNumber_Int(__pyx_v_token); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 498 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_10); + +#line 498 "root_numpy/src/converters.pyx" + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_10))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 498 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + +#line 498 "root_numpy/src/converters.pyx" + } + +#line 498 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 498 "root_numpy/src/converters.pyx" + __pyx_t_13 = __Pyx_PyList_Extend(__pyx_v_shape, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -/* "root_numpy/src/converters.pyx":502 +#line 498 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "root_numpy/src/converters.pyx":499 + * leaf_shape_type = FIXED_LENGTH_ARRAY + * shape.extend([int(token) for token in arraytokens]) + * leaf_shape = tuple(shape) # <<<<<<<<<<<<<< * - * @atexit.register - * def cleanup(): # <<<<<<<<<<<<<< - * # Delete all converters when module is town down - * it = CONVERTERS.begin() + * if leaf_shape_type == SINGLE_VALUE: */ -#line 502 "root_numpy/src/converters.pyx" +#line 499 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyList_AsTuple(__pyx_v_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 499 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 502 "root_numpy/src/converters.pyx" -/* Python wrapper */ +#line 499 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_v_leaf_shape, ((PyObject*)__pyx_t_1)); -#line 502 "root_numpy/src/converters.pyx" -static PyObject *__pyx_pw_13_librootnumpy_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyMethodDef __pyx_mdef_13_librootnumpy_1cleanup = -#line 502 "root_numpy/src/converters.pyx" -{"cleanup", (PyCFunction)__pyx_pw_13_librootnumpy_1cleanup, METH_NOARGS, 0}; +#line 499 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; -#line 502 "root_numpy/src/converters.pyx" -static PyObject *__pyx_pw_13_librootnumpy_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { +#line 499 "root_numpy/src/converters.pyx" + goto __pyx_L6; -#line 502 "root_numpy/src/converters.pyx" - PyObject *__pyx_r = 0; +#line 499 "root_numpy/src/converters.pyx" + } -#line 502 "root_numpy/src/converters.pyx" - __Pyx_RefNannyDeclarations +#line 499 "root_numpy/src/converters.pyx" + __pyx_L6:; -#line 502 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("cleanup (wrapper)", 0); - __pyx_r = -#line 502 "root_numpy/src/converters.pyx" -__pyx_pf_13_librootnumpy_cleanup(__pyx_self); +#line 499 "root_numpy/src/converters.pyx" + goto __pyx_L5; -#line 502 "root_numpy/src/converters.pyx" +#line 499 "root_numpy/src/converters.pyx" + } +#line 499 "root_numpy/src/converters.pyx" + __pyx_L5:; -#line 502 "root_numpy/src/converters.pyx" - /* function exit code */ + /* "root_numpy/src/converters.pyx":501 + * leaf_shape = tuple(shape) + * + * if leaf_shape_type == SINGLE_VALUE: # <<<<<<<<<<<<<< + * return find_converter_by_typename(leaf_type) + * + */ -#line 502 "root_numpy/src/converters.pyx" - __Pyx_RefNannyFinishContext(); +#line 501 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_leaf_shape_type == __pyx_e_13_librootnumpy_SINGLE_VALUE) != 0); -#line 502 "root_numpy/src/converters.pyx" - return __pyx_r; +#line 501 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 502 "root_numpy/src/converters.pyx" -} + /* "root_numpy/src/converters.pyx":502 + * + * if leaf_shape_type == SINGLE_VALUE: + * return find_converter_by_typename(leaf_type) # <<<<<<<<<<<<<< + * + * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: + */ #line 502 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_v_leaf_type); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 502 "root_numpy/src/converters.pyx" -static PyObject *__pyx_pf_13_librootnumpy_cleanup(CYTHON_UNUSED PyObject *__pyx_self) { - std::map ::iterator __pyx_v_it #line 502 "root_numpy/src/converters.pyx" -; + __pyx_r = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_7); #line 502 "root_numpy/src/converters.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; + goto __pyx_L0; #line 502 "root_numpy/src/converters.pyx" - __Pyx_RefNannySetupContext("cleanup", 0); + } /* "root_numpy/src/converters.pyx":504 - * def cleanup(): - * # Delete all converters when module is town down - * it = CONVERTERS.begin() # <<<<<<<<<<<<<< - * while it != CONVERTERS.end(): - * del deref(it).second + * return find_converter_by_typename(leaf_type) + * + * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: # <<<<<<<<<<<<<< + * conv = find_converter_by_typename(leaf_type + arraydef) + * if conv == NULL: */ #line 504 "root_numpy/src/converters.pyx" - __pyx_v_it = __pyx_v_13_librootnumpy_CONVERTERS.begin(); + __pyx_t_2 = ((__pyx_v_leaf_shape_type == __pyx_e_13_librootnumpy_VARIABLE_LENGTH_ARRAY) != 0); - /* "root_numpy/src/converters.pyx":505 - * # Delete all converters when module is town down - * it = CONVERTERS.begin() - * while it != CONVERTERS.end(): # <<<<<<<<<<<<<< - * del deref(it).second - * inc(it) +#line 504 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/converters.pyx":505 + * + * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: + * conv = find_converter_by_typename(leaf_type + arraydef) # <<<<<<<<<<<<<< + * if conv == NULL: + * # Create new converter on demand */ #line 505 "root_numpy/src/converters.pyx" - while (1) { + if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #line 505 "root_numpy/src/converters.pyx" - __pyx_t_1 = ((__pyx_v_it != __pyx_v_13_librootnumpy_CONVERTERS.end()) != 0); + __pyx_t_1 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 505 "root_numpy/src/converters.pyx" - if (!__pyx_t_1) break; + __Pyx_GOTREF(__pyx_t_1); + +#line 505 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 505 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 505 "root_numpy/src/converters.pyx" + __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_7); /* "root_numpy/src/converters.pyx":506 - * it = CONVERTERS.begin() - * while it != CONVERTERS.end(): - * del deref(it).second # <<<<<<<<<<<<<< - * inc(it) + * if leaf_shape_type == VARIABLE_LENGTH_ARRAY: + * conv = find_converter_by_typename(leaf_type + arraydef) + * if conv == NULL: # <<<<<<<<<<<<<< + * # Create new converter on demand + * basic_conv = find_converter_by_typename(leaf_type) */ #line 506 "root_numpy/src/converters.pyx" - delete (*__pyx_v_it).second; + __pyx_t_2 = ((__pyx_v_conv == NULL) != 0); - /* "root_numpy/src/converters.pyx":507 - * while it != CONVERTERS.end(): - * del deref(it).second - * inc(it) # <<<<<<<<<<<<<< +#line 506 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/converters.pyx":508 + * if conv == NULL: + * # Create new converter on demand + * basic_conv = find_converter_by_typename(leaf_type) # <<<<<<<<<<<<<< + * if basic_conv == NULL: + * return NULL */ -#line 507 "root_numpy/src/converters.pyx" - (++__pyx_v_it); +#line 508 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_v_leaf_type); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 507 "root_numpy/src/converters.pyx" - } +#line 508 "root_numpy/src/converters.pyx" + __pyx_v_basic_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_7); - /* "root_numpy/src/converters.pyx":502 - * - * @atexit.register - * def cleanup(): # <<<<<<<<<<<<<< - * # Delete all converters when module is town down - * it = CONVERTERS.begin() + /* "root_numpy/src/converters.pyx":509 + * # Create new converter on demand + * basic_conv = find_converter_by_typename(leaf_type) + * if basic_conv == NULL: # <<<<<<<<<<<<<< + * return NULL + * ndim = len(leaf_shape) + 1 */ -#line 502 "root_numpy/src/converters.pyx" +#line 509 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_basic_conv == NULL) != 0); +#line 509 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 502 "root_numpy/src/converters.pyx" - /* function exit code */ + /* "root_numpy/src/converters.pyx":510 + * basic_conv = find_converter_by_typename(leaf_type) + * if basic_conv == NULL: + * return NULL # <<<<<<<<<<<<<< + * ndim = len(leaf_shape) + 1 + * dims = malloc(ndim * sizeof(SIZE_t)) + */ -#line 502 "root_numpy/src/converters.pyx" - __pyx_r = Py_None; __Pyx_INCREF(Py_None); +#line 510 "root_numpy/src/converters.pyx" + __pyx_r = NULL; -#line 502 "root_numpy/src/converters.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 510 "root_numpy/src/converters.pyx" + goto __pyx_L0; -#line 502 "root_numpy/src/converters.pyx" - __Pyx_RefNannyFinishContext(); +#line 510 "root_numpy/src/converters.pyx" + } -#line 502 "root_numpy/src/converters.pyx" - return __pyx_r; + /* "root_numpy/src/converters.pyx":511 + * if basic_conv == NULL: + * return NULL + * ndim = len(leaf_shape) + 1 # <<<<<<<<<<<<<< + * dims = malloc(ndim * sizeof(SIZE_t)) + * if dims == NULL: + */ -#line 502 "root_numpy/src/converters.pyx" -} +#line 511 "root_numpy/src/converters.pyx" + __pyx_t_9 = PyTuple_GET_SIZE(__pyx_v_leaf_shape); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -/* "root_numpy/src/tree.pyx":4 - * - * - * def list_trees(fname): # <<<<<<<<<<<<<< - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: +#line 511 "root_numpy/src/converters.pyx" + __pyx_v_ndim = (__pyx_t_9 + 1); + + /* "root_numpy/src/converters.pyx":512 + * return NULL + * ndim = len(leaf_shape) + 1 + * dims = malloc(ndim * sizeof(SIZE_t)) # <<<<<<<<<<<<<< + * if dims == NULL: + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) */ -#line 4 "root_numpy/src/tree.pyx" +#line 512 "root_numpy/src/converters.pyx" + __pyx_v_dims = ((__pyx_t_13_librootnumpy_SIZE_t *)malloc((__pyx_v_ndim * (sizeof(__pyx_t_13_librootnumpy_SIZE_t))))); + /* "root_numpy/src/converters.pyx":513 + * ndim = len(leaf_shape) + 1 + * dims = malloc(ndim * sizeof(SIZE_t)) + * if dims == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + * for idim from 1 <= idim < ndim: + */ -#line 4 "root_numpy/src/tree.pyx" -/* Python wrapper */ +#line 513 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_dims == NULL) != 0); -#line 4 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_3list_trees(PyObject *__pyx_self, PyObject *__pyx_v_fname); /*proto*/ -static PyMethodDef __pyx_mdef_13_librootnumpy_3list_trees = -#line 4 "root_numpy/src/tree.pyx" -{"list_trees", (PyCFunction)__pyx_pw_13_librootnumpy_3list_trees, METH_O, 0}; +#line 513 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 4 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_3list_trees(PyObject *__pyx_self, PyObject *__pyx_v_fname) { + /* "root_numpy/src/converters.pyx":514 + * dims = malloc(ndim * sizeof(SIZE_t)) + * if dims == NULL: + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) # <<<<<<<<<<<<<< + * for idim from 1 <= idim < ndim: + * dims[idim] = leaf_shape[idim - 1] + */ -#line 4 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = 0; +#line 514 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyInt_FromSize_t((__pyx_v_ndim * (sizeof(__pyx_t_13_librootnumpy_SIZE_t)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 4 "root_numpy/src/tree.pyx" - __Pyx_RefNannyDeclarations +#line 514 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 4 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("list_trees (wrapper)", 0); - __pyx_r = -#line 4 "root_numpy/src/tree.pyx" -__pyx_pf_13_librootnumpy_2list_trees(__pyx_self, ((PyObject *)__pyx_v_fname)); +#line 514 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 4 "root_numpy/src/tree.pyx" +#line 514 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); +#line 514 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 4 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 514 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 4 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 514 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 4 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 514 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); -#line 4 "root_numpy/src/tree.pyx" -} +#line 514 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_5); -#line 4 "root_numpy/src/tree.pyx" +#line 514 "root_numpy/src/converters.pyx" + __pyx_t_5 = 0; +#line 514 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 4 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pf_13_librootnumpy_2list_trees(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname) { - TFile *__pyx_v_rfile -#line 4 "root_numpy/src/tree.pyx" -; - TList *__pyx_v_keys -#line 4 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_ret = NULL -#line 4 "root_numpy/src/tree.pyx" -; - int __pyx_v_nkeys -#line 4 "root_numpy/src/tree.pyx" -; - TKey *__pyx_v_key -#line 4 "root_numpy/src/tree.pyx" -; - int __pyx_v_i -#line 4 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_clsname = NULL -#line 4 "root_numpy/src/tree.pyx" -; +#line 514 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 4 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - const char *__pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 514 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 4 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("list_trees", 0); +#line 514 "root_numpy/src/converters.pyx" + __Pyx_Raise(__pyx_t_5, 0, 0, 0); - /* "root_numpy/src/tree.pyx":5 - * - * def list_trees(fname): - * cdef TFile* rfile = Open(fname, 'read') # <<<<<<<<<<<<<< - * if rfile == NULL: - * raise IOError("cannot read {0}".format(fname)) - */ +#line 514 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 5 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 514 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 5 "root_numpy/src/tree.pyx" - __pyx_v_rfile = TFile::Open(__pyx_t_1, __pyx_k_read); +#line 514 "root_numpy/src/converters.pyx" + } - /* "root_numpy/src/tree.pyx":6 - * def list_trees(fname): - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: # <<<<<<<<<<<<<< - * raise IOError("cannot read {0}".format(fname)) - * cdef TList* keys = rfile.GetListOfKeys() + /* "root_numpy/src/converters.pyx":515 + * if dims == NULL: + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + * for idim from 1 <= idim < ndim: # <<<<<<<<<<<<<< + * dims[idim] = leaf_shape[idim - 1] + * conv = new VaryArrayConverter( */ -#line 6 "root_numpy/src/tree.pyx" - __pyx_t_2 = ((__pyx_v_rfile == NULL) != 0); +#line 515 "root_numpy/src/converters.pyx" + __pyx_t_14 = __pyx_v_ndim; -#line 6 "root_numpy/src/tree.pyx" - if (__pyx_t_2) { +#line 515 "root_numpy/src/converters.pyx" + for (__pyx_v_idim = 1; __pyx_v_idim < __pyx_t_14; __pyx_v_idim++) { - /* "root_numpy/src/tree.pyx":7 - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: - * raise IOError("cannot read {0}".format(fname)) # <<<<<<<<<<<<<< - * cdef TList* keys = rfile.GetListOfKeys() - * if keys == NULL: + /* "root_numpy/src/converters.pyx":516 + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + * for idim from 1 <= idim < ndim: + * dims[idim] = leaf_shape[idim - 1] # <<<<<<<<<<<<<< + * conv = new VaryArrayConverter( + * basic_conv, ndim, dims) */ -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_read_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); - -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_5 = NULL; +#line 516 "root_numpy/src/converters.pyx" + __pyx_t_15 = (__pyx_v_idim - 1); -#line 7 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { +#line 516 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_leaf_shape, __pyx_t_15, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); +#line 516 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 7 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_5)) { +#line 516 "root_numpy/src/converters.pyx" + __pyx_t_16 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_5); if (unlikely((__pyx_t_16 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 7 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); +#line 516 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 7 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_5); +#line 516 "root_numpy/src/converters.pyx" + (__pyx_v_dims[__pyx_v_idim]) = __pyx_t_16; -#line 7 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 516 "root_numpy/src/converters.pyx" + } -#line 7 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_4, function); + /* "root_numpy/src/converters.pyx":517 + * for idim from 1 <= idim < ndim: + * dims[idim] = leaf_shape[idim - 1] + * conv = new VaryArrayConverter( # <<<<<<<<<<<<<< + * basic_conv, ndim, dims) + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) + */ -#line 7 "root_numpy/src/tree.pyx" - } +#line 517 "root_numpy/src/converters.pyx" + __pyx_v_conv = new __pyx_t_13_librootnumpy_VaryArrayConverter(((__pyx_t_13_librootnumpy_BasicConverter *)__pyx_v_basic_conv), __pyx_v_ndim, __pyx_v_dims); -#line 7 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/converters.pyx":519 + * conv = new VaryArrayConverter( + * basic_conv, ndim, dims) + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) # <<<<<<<<<<<<<< + * return conv + * + */ -#line 7 "root_numpy/src/tree.pyx" - if (!__pyx_t_5) { +#line 519 "root_numpy/src/converters.pyx" + if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 519 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 519 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 7 "root_numpy/src/tree.pyx" - } else { +#line 519 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 519 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 519 "root_numpy/src/converters.pyx" + try { -#line 7 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; +#line 519 "root_numpy/src/converters.pyx" + __pyx_t_8 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_7, __pyx_v_conv); -#line 7 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fname); +#line 519 "root_numpy/src/converters.pyx" + } catch(...) { -#line 7 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_fname); +#line 519 "root_numpy/src/converters.pyx" + __Pyx_CppExn2PyErr(); -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fname); +#line 519 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 519 "root_numpy/src/converters.pyx" + } -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 519 "root_numpy/src/converters.pyx" + __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_8); -#line 7 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 519 "root_numpy/src/converters.pyx" + goto __pyx_L12; -#line 7 "root_numpy/src/tree.pyx" +#line 519 "root_numpy/src/converters.pyx" } -#line 7 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 519 "root_numpy/src/converters.pyx" + __pyx_L12:; -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); + /* "root_numpy/src/converters.pyx":520 + * basic_conv, ndim, dims) + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) + * return conv # <<<<<<<<<<<<<< + * + * # Fixed-length array + */ -#line 7 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); +#line 520 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_v_conv; -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 520 "root_numpy/src/converters.pyx" + goto __pyx_L0; -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 520 "root_numpy/src/converters.pyx" + } -#line 7 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":523 + * + * # Fixed-length array + * conv = find_converter_by_typename(leaf_type + arraydef) # <<<<<<<<<<<<<< + * if conv == NULL: + * # Create new converter on demand + */ -#line 7 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 523 "root_numpy/src/converters.pyx" + if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } -#line 7 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 523 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 7 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_3, 0, 0, 0); +#line 523 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 7 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 523 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 7 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 523 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 7 "root_numpy/src/tree.pyx" - } +#line 523 "root_numpy/src/converters.pyx" + __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_7); - /* "root_numpy/src/tree.pyx":8 - * if rfile == NULL: - * raise IOError("cannot read {0}".format(fname)) - * cdef TList* keys = rfile.GetListOfKeys() # <<<<<<<<<<<<<< - * if keys == NULL: - * raise IOError("unable to get keys in {0}".format(fname)) + /* "root_numpy/src/converters.pyx":524 + * # Fixed-length array + * conv = find_converter_by_typename(leaf_type + arraydef) + * if conv == NULL: # <<<<<<<<<<<<<< + * # Create new converter on demand + * basic_conv = find_converter_by_typename(leaf_type) */ -#line 8 "root_numpy/src/tree.pyx" - __pyx_v_keys = __pyx_v_rfile->GetListOfKeys(); +#line 524 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_conv == NULL) != 0); - /* "root_numpy/src/tree.pyx":9 - * raise IOError("cannot read {0}".format(fname)) - * cdef TList* keys = rfile.GetListOfKeys() - * if keys == NULL: # <<<<<<<<<<<<<< - * raise IOError("unable to get keys in {0}".format(fname)) - * ret = dict() +#line 524 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/converters.pyx":526 + * if conv == NULL: + * # Create new converter on demand + * basic_conv = find_converter_by_typename(leaf_type) # <<<<<<<<<<<<<< + * if basic_conv == NULL: + * return NULL */ -#line 9 "root_numpy/src/tree.pyx" - __pyx_t_2 = ((__pyx_v_keys == NULL) != 0); +#line 526 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_v_leaf_type); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 9 "root_numpy/src/tree.pyx" - if (__pyx_t_2) { +#line 526 "root_numpy/src/converters.pyx" + __pyx_v_basic_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_7); - /* "root_numpy/src/tree.pyx":10 - * cdef TList* keys = rfile.GetListOfKeys() - * if keys == NULL: - * raise IOError("unable to get keys in {0}".format(fname)) # <<<<<<<<<<<<<< - * ret = dict() - * cdef int nkeys = keys.GetEntries() + /* "root_numpy/src/converters.pyx":527 + * # Create new converter on demand + * basic_conv = find_converter_by_typename(leaf_type) + * if basic_conv == NULL: # <<<<<<<<<<<<<< + * return NULL + * conv = new FixedArrayConverter( */ -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unable_to_get_keys_in_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 527 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_basic_conv == NULL) != 0); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 527 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_6 = NULL; + /* "root_numpy/src/converters.pyx":528 + * basic_conv = find_converter_by_typename(leaf_type) + * if basic_conv == NULL: + * return NULL # <<<<<<<<<<<<<< + * conv = new FixedArrayConverter( + * basic_conv, leaf_shape) + */ -#line 10 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { +#line 528 "root_numpy/src/converters.pyx" + __pyx_r = NULL; -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); +#line 528 "root_numpy/src/converters.pyx" + goto __pyx_L0; -#line 10 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_6)) { +#line 528 "root_numpy/src/converters.pyx" + } -#line 10 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + /* "root_numpy/src/converters.pyx":529 + * if basic_conv == NULL: + * return NULL + * conv = new FixedArrayConverter( # <<<<<<<<<<<<<< + * basic_conv, leaf_shape) + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) + */ -#line 10 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_6); +#line 529 "root_numpy/src/converters.pyx" + __pyx_v_conv = new __pyx_t_13_librootnumpy_FixedArrayConverter(((__pyx_t_13_librootnumpy_BasicConverter *)__pyx_v_basic_conv), ((PyObject *)__pyx_v_leaf_shape)); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); + /* "root_numpy/src/converters.pyx":531 + * conv = new FixedArrayConverter( + * basic_conv, leaf_shape) + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) # <<<<<<<<<<<<<< + * return conv + * + */ -#line 10 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_4, function); +#line 531 "root_numpy/src/converters.pyx" + if (unlikely(!__pyx_v_arraydef)) { __Pyx_RaiseUnboundLocalError("arraydef"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } -#line 10 "root_numpy/src/tree.pyx" - } +#line 531 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyNumber_Add(__pyx_v_leaf_type, __pyx_v_arraydef); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 10 "root_numpy/src/tree.pyx" - } +#line 531 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 10 "root_numpy/src/tree.pyx" - if (!__pyx_t_6) { +#line 531 "root_numpy/src/converters.pyx" + __pyx_t_7 = __pyx_convert_string_from_py_std__string(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 531 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 531 "root_numpy/src/converters.pyx" + try { -#line 10 "root_numpy/src/tree.pyx" - } else { +#line 531 "root_numpy/src/converters.pyx" + __pyx_t_8 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_7, __pyx_v_conv); -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 531 "root_numpy/src/converters.pyx" + } catch(...) { -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 531 "root_numpy/src/converters.pyx" + __Pyx_CppExn2PyErr(); -#line 10 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL; +#line 531 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 10 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fname); +#line 531 "root_numpy/src/converters.pyx" + } -#line 10 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname); +#line 531 "root_numpy/src/converters.pyx" + __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_8); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fname); +#line 531 "root_numpy/src/converters.pyx" + goto __pyx_L17; -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 531 "root_numpy/src/converters.pyx" + } -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 531 "root_numpy/src/converters.pyx" + __pyx_L17:; -#line 10 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "root_numpy/src/converters.pyx":532 + * basic_conv, leaf_shape) + * CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + arraydef, conv)) + * return conv # <<<<<<<<<<<<<< + * + * + */ -#line 10 "root_numpy/src/tree.pyx" - } +#line 532 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_v_conv; -#line 10 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 532 "root_numpy/src/converters.pyx" + goto __pyx_L0; -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":461 + * + * + * cdef Converter* get_converter(TLeaf* leaf, char type_code): # <<<<<<<<<<<<<< + * # Find existing converter or attempt to create a new one + * cdef Converter* conv + */ -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 461 "root_numpy/src/converters.pyx" -#line 10 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 461 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 461 "root_numpy/src/converters.pyx" + __pyx_L1_error:; -#line 10 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_1); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_3); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_4); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_3, 0, 0, 0); +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_5); -#line 10 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_6); -#line 10 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_10); -#line 10 "root_numpy/src/tree.pyx" - } +#line 461 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("_librootnumpy.get_converter", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); - /* "root_numpy/src/tree.pyx":11 - * if keys == NULL: - * raise IOError("unable to get keys in {0}".format(fname)) - * ret = dict() # <<<<<<<<<<<<<< - * cdef int nkeys = keys.GetEntries() - * cdef TKey* key - */ +#line 461 "root_numpy/src/converters.pyx" + __pyx_r = 0; -#line 11 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 461 "root_numpy/src/converters.pyx" + __pyx_L0:; -#line 11 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_leaf_type); -#line 11 "root_numpy/src/tree.pyx" - __pyx_v_ret = ((PyObject*)__pyx_t_3); +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_leaf_shape); -#line 11 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_match); - /* "root_numpy/src/tree.pyx":12 - * raise IOError("unable to get keys in {0}".format(fname)) - * ret = dict() - * cdef int nkeys = keys.GetEntries() # <<<<<<<<<<<<<< - * cdef TKey* key - * for i in range(nkeys): - */ +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_arraydef); -#line 12 "root_numpy/src/tree.pyx" - __pyx_v_nkeys = __pyx_v_keys->GetEntries(); +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_arraytokens); - /* "root_numpy/src/tree.pyx":14 - * cdef int nkeys = keys.GetEntries() - * cdef TKey* key - * for i in range(nkeys): # <<<<<<<<<<<<<< - * key = keys.At(i) - * clsname = str(key.GetClassName()) - */ +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_shape); -#line 14 "root_numpy/src/tree.pyx" - __pyx_t_7 = __pyx_v_nkeys; +#line 461 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_token); -#line 14 "root_numpy/src/tree.pyx" - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { +#line 461 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 14 "root_numpy/src/tree.pyx" - __pyx_v_i = __pyx_t_8; +#line 461 "root_numpy/src/converters.pyx" + return __pyx_r; - /* "root_numpy/src/tree.pyx":15 - * cdef TKey* key - * for i in range(nkeys): - * key = keys.At(i) # <<<<<<<<<<<<<< - * clsname = str(key.GetClassName()) - * if clsname == 'TTree' or clsname == 'TNtuple': +#line 461 "root_numpy/src/converters.pyx" +} + +/* "root_numpy/src/converters.pyx":536 + * + * @atexit.register + * def cleanup(): # <<<<<<<<<<<<<< + * # Delete all converters when module is town down + * it = CONVERTERS.begin() */ -#line 15 "root_numpy/src/tree.pyx" - __pyx_v_key = ((TKey *)__pyx_v_keys->At(__pyx_v_i)); +#line 536 "root_numpy/src/converters.pyx" - /* "root_numpy/src/tree.pyx":16 - * for i in range(nkeys): - * key = keys.At(i) - * clsname = str(key.GetClassName()) # <<<<<<<<<<<<<< - * if clsname == 'TTree' or clsname == 'TNtuple': - * ret[str(key.GetName())] = None - */ -#line 16 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_key->GetClassName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" +/* Python wrapper */ -#line 16 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" +static PyObject *__pyx_pw_13_librootnumpy_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyMethodDef __pyx_mdef_13_librootnumpy_1cleanup = +#line 536 "root_numpy/src/converters.pyx" +{"cleanup", (PyCFunction)__pyx_pw_13_librootnumpy_1cleanup, METH_NOARGS, 0}; -#line 16 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" +static PyObject *__pyx_pw_13_librootnumpy_1cleanup(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { -#line 16 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 536 "root_numpy/src/converters.pyx" + PyObject *__pyx_r = 0; -#line 16 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" + __Pyx_RefNannyDeclarations -#line 16 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("cleanup (wrapper)", 0); + __pyx_r = +#line 536 "root_numpy/src/converters.pyx" +__pyx_pf_13_librootnumpy_cleanup(__pyx_self); -#line 16 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 536 "root_numpy/src/converters.pyx" -#line 16 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 16 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 16 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 536 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 16 "root_numpy/src/tree.pyx" - __Pyx_XDECREF_SET(__pyx_v_clsname, __pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 16 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 536 "root_numpy/src/converters.pyx" +} - /* "root_numpy/src/tree.pyx":17 - * key = keys.At(i) - * clsname = str(key.GetClassName()) - * if clsname == 'TTree' or clsname == 'TNtuple': # <<<<<<<<<<<<<< - * ret[str(key.GetName())] = None - * rfile.Close() - */ +#line 536 "root_numpy/src/converters.pyx" -#line 17 "root_numpy/src/tree.pyx" - __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_clsname, __pyx_n_s_TTree, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 17 "root_numpy/src/tree.pyx" - if (!__pyx_t_9) { +#line 536 "root_numpy/src/converters.pyx" +static PyObject *__pyx_pf_13_librootnumpy_cleanup(CYTHON_UNUSED PyObject *__pyx_self) { + std::map ::iterator __pyx_v_it +#line 536 "root_numpy/src/converters.pyx" +; -#line 17 "root_numpy/src/tree.pyx" - } else { +#line 536 "root_numpy/src/converters.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; -#line 17 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_t_9; +#line 536 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("cleanup", 0); -#line 17 "root_numpy/src/tree.pyx" - goto __pyx_L8_bool_binop_done; + /* "root_numpy/src/converters.pyx":538 + * def cleanup(): + * # Delete all converters when module is town down + * it = CONVERTERS.begin() # <<<<<<<<<<<<<< + * while it != CONVERTERS.end(): + * del deref(it).second + */ -#line 17 "root_numpy/src/tree.pyx" - } +#line 538 "root_numpy/src/converters.pyx" + __pyx_v_it = __pyx_v_13_librootnumpy_CONVERTERS.begin(); -#line 17 "root_numpy/src/tree.pyx" - __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_clsname, __pyx_n_s_TNtuple, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":539 + * # Delete all converters when module is town down + * it = CONVERTERS.begin() + * while it != CONVERTERS.end(): # <<<<<<<<<<<<<< + * del deref(it).second + * inc(it) + */ -#line 17 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_t_9; +#line 539 "root_numpy/src/converters.pyx" + while (1) { -#line 17 "root_numpy/src/tree.pyx" - __pyx_L8_bool_binop_done:; +#line 539 "root_numpy/src/converters.pyx" + __pyx_t_1 = ((__pyx_v_it != __pyx_v_13_librootnumpy_CONVERTERS.end()) != 0); -#line 17 "root_numpy/src/tree.pyx" - if (__pyx_t_2) { +#line 539 "root_numpy/src/converters.pyx" + if (!__pyx_t_1) break; - /* "root_numpy/src/tree.pyx":18 - * clsname = str(key.GetClassName()) - * if clsname == 'TTree' or clsname == 'TNtuple': - * ret[str(key.GetName())] = None # <<<<<<<<<<<<<< - * rfile.Close() - * del rfile + /* "root_numpy/src/converters.pyx":540 + * it = CONVERTERS.begin() + * while it != CONVERTERS.end(): + * del deref(it).second # <<<<<<<<<<<<<< + * inc(it) + * */ -#line 18 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_key->GetName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 540 "root_numpy/src/converters.pyx" + delete (*__pyx_v_it).second; -#line 18 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); + /* "root_numpy/src/converters.pyx":541 + * while it != CONVERTERS.end(): + * del deref(it).second + * inc(it) # <<<<<<<<<<<<<< + * + * + */ -#line 18 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 541 "root_numpy/src/converters.pyx" + (++__pyx_v_it); -#line 18 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 541 "root_numpy/src/converters.pyx" + } -#line 18 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + /* "root_numpy/src/converters.pyx":536 + * + * @atexit.register + * def cleanup(): # <<<<<<<<<<<<<< + * # Delete all converters when module is town down + * it = CONVERTERS.begin() + */ -#line 18 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" -#line 18 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; -#line 18 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 18 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 536 "root_numpy/src/converters.pyx" + __pyx_r = Py_None; __Pyx_INCREF(Py_None); -#line 18 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 536 "root_numpy/src/converters.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 18 "root_numpy/src/tree.pyx" - if (unlikely(PyDict_SetItem(__pyx_v_ret, __pyx_t_3, Py_None) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 18 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 536 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 18 "root_numpy/src/tree.pyx" - goto __pyx_L7; +#line 536 "root_numpy/src/converters.pyx" +} -#line 18 "root_numpy/src/tree.pyx" - } +/* "root_numpy/src/converters.pyx":550 + * cdef cppclass NP2ROOTConverter: + * + * void fill_from(void* source): # <<<<<<<<<<<<<< + * pass + * + */ -#line 18 "root_numpy/src/tree.pyx" - __pyx_L7:; +#line 550 "root_numpy/src/converters.pyx" -#line 18 "root_numpy/src/tree.pyx" - } - /* "root_numpy/src/tree.pyx":19 - * if clsname == 'TTree' or clsname == 'TNtuple': - * ret[str(key.GetName())] = None - * rfile.Close() # <<<<<<<<<<<<<< - * del rfile - * return list(ret.keys()) - */ +#line 550 "root_numpy/src/converters.pyx" +void __pyx_t_13_librootnumpy_NP2ROOTConverter::fill_from(CYTHON_UNUSED void *__pyx_v_source) { + __Pyx_RefNannyDeclarations -#line 19 "root_numpy/src/tree.pyx" - __pyx_v_rfile->Close(); +#line 550 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("fill_from", 0); - /* "root_numpy/src/tree.pyx":20 - * ret[str(key.GetName())] = None - * rfile.Close() - * del rfile # <<<<<<<<<<<<<< - * return list(ret.keys()) - * - */ +#line 550 "root_numpy/src/converters.pyx" -#line 20 "root_numpy/src/tree.pyx" - delete __pyx_v_rfile; - /* "root_numpy/src/tree.pyx":21 - * rfile.Close() - * del rfile - * return list(ret.keys()) # <<<<<<<<<<<<<< +#line 550 "root_numpy/src/converters.pyx" + /* function exit code */ + +#line 550 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); + +#line 550 "root_numpy/src/converters.pyx" +} + +/* "root_numpy/src/converters.pyx":553 + * pass * + * __dealloc__(): # <<<<<<<<<<<<<< + * pass * */ -#line 21 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 553 "root_numpy/src/converters.pyx" -#line 21 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 21 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 553 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_NP2ROOTConverter::~__pyx_t_13_librootnumpy_NP2ROOTConverter(void) { + __Pyx_RefNannyDeclarations -#line 21 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 553 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("", 0); -#line 21 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 553 "root_numpy/src/converters.pyx" -#line 21 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 21 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 553 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 21 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 553 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 21 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 553 "root_numpy/src/converters.pyx" +} -#line 21 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +/* "root_numpy/src/converters.pyx":562 + * TBranch* branch + * + * __init__(TTree* tree, string name, string roottype, # <<<<<<<<<<<<<< + * int length, int elembytes, + * int ndim=0, SIZE_t* dims=NULL): + */ -#line 21 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 562 "root_numpy/src/converters.pyx" -#line 21 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_t_3; -#line 21 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 562 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_FixedNP2ROOTConverter::__pyx_t_13_librootnumpy_FixedNP2ROOTConverter(TTree *__pyx_v_tree, std::string __pyx_v_name, std::string __pyx_v_roottype, int __pyx_v_length, int __pyx_v_elembytes, struct __pyx_opt_args_21FixedNP2ROOTConverter___init__ *__pyx_optional_args) { -#line 21 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 562 "root_numpy/src/converters.pyx" + int __pyx_v_ndim = ((int)0); - /* "root_numpy/src/tree.pyx":4 - * - * - * def list_trees(fname): # <<<<<<<<<<<<<< - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: + /* "root_numpy/src/converters.pyx":564 + * __init__(TTree* tree, string name, string roottype, + * int length, int elembytes, + * int ndim=0, SIZE_t* dims=NULL): # <<<<<<<<<<<<<< + * cdef string leaflist + * cdef int axis */ -#line 4 "root_numpy/src/tree.pyx" +#line 564 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_SIZE_t *__pyx_v_dims = ((__pyx_t_13_librootnumpy_SIZE_t *)NULL); + std::string __pyx_v_leaflist +#line 564 "root_numpy/src/converters.pyx" +; + int __pyx_v_axis +#line 564 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_token = NULL +#line 564 "root_numpy/src/converters.pyx" +; + __Pyx_RefNannyDeclarations + std::string __pyx_t_1; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_t_6; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + char *__pyx_t_11; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; +#line 564 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("", 0); -#line 4 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 564 "root_numpy/src/converters.pyx" + if (__pyx_optional_args) { -#line 4 "root_numpy/src/tree.pyx" - __pyx_L1_error:; +#line 564 "root_numpy/src/converters.pyx" + if (__pyx_optional_args->__pyx_n > 0) { -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 564 "root_numpy/src/converters.pyx" + __pyx_v_ndim = __pyx_optional_args->ndim; -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); +#line 564 "root_numpy/src/converters.pyx" + if (__pyx_optional_args->__pyx_n > 1) { -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_5); +#line 564 "root_numpy/src/converters.pyx" + __pyx_v_dims = __pyx_optional_args->dims; -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_6); +#line 564 "root_numpy/src/converters.pyx" + } -#line 4 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.list_trees", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 564 "root_numpy/src/converters.pyx" + } -#line 4 "root_numpy/src/tree.pyx" - __pyx_r = NULL; +#line 564 "root_numpy/src/converters.pyx" + } -#line 4 "root_numpy/src/tree.pyx" - __pyx_L0:; + /* "root_numpy/src/converters.pyx":567 + * cdef string leaflist + * cdef int axis + * this.nbytes = length * elembytes # <<<<<<<<<<<<<< + * if roottype.compare('C') == 0: + * # include null-termination + */ -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_ret); +#line 567 "root_numpy/src/converters.pyx" + this->nbytes = (__pyx_v_length * __pyx_v_elembytes); -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_clsname); + /* "root_numpy/src/converters.pyx":568 + * cdef int axis + * this.nbytes = length * elembytes + * if roottype.compare('C') == 0: # <<<<<<<<<<<<<< + * # include null-termination + * this.value = malloc(nbytes + 1) + */ -#line 4 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 568 "root_numpy/src/converters.pyx" + __pyx_t_1 = __pyx_convert_string_from_py_std__string(__pyx_n_b_C); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 4 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 568 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_roottype.compare(__pyx_t_1) == 0) != 0); -#line 4 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 568 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 4 "root_numpy/src/tree.pyx" -} + /* "root_numpy/src/converters.pyx":570 + * if roottype.compare('C') == 0: + * # include null-termination + * this.value = malloc(nbytes + 1) # <<<<<<<<<<<<<< + * if this.value == NULL: + * raise MemoryError("could not allocate %d bytes" % (nbytes + 1)) + */ -/* "root_numpy/src/tree.pyx":24 - * - * - * def list_structures(fname, tree=None): # <<<<<<<<<<<<<< - * if tree == None: - * # automatically select single tree +#line 570 "root_numpy/src/converters.pyx" + this->value = malloc((nbytes + 1)); + + /* "root_numpy/src/converters.pyx":571 + * # include null-termination + * this.value = malloc(nbytes + 1) + * if this.value == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("could not allocate %d bytes" % (nbytes + 1)) + * ( this.value)[nbytes] = '\0' */ -#line 24 "root_numpy/src/tree.pyx" +#line 571 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((this->value == NULL) != 0); +#line 571 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 24 "root_numpy/src/tree.pyx" -/* Python wrapper */ + /* "root_numpy/src/converters.pyx":572 + * this.value = malloc(nbytes + 1) + * if this.value == NULL: + * raise MemoryError("could not allocate %d bytes" % (nbytes + 1)) # <<<<<<<<<<<<<< + * ( this.value)[nbytes] = '\0' + * else: + */ -#line 24 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_5list_structures(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_13_librootnumpy_5list_structures = -#line 24 "root_numpy/src/tree.pyx" -{"list_structures", (PyCFunction)__pyx_pw_13_librootnumpy_5list_structures, METH_VARARGS|METH_KEYWORDS, 0}; +#line 572 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyInt_From_long((nbytes + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_5list_structures(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_fname = 0 -#line 24 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_tree = 0 -#line 24 "root_numpy/src/tree.pyx" -; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 572 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 24 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = 0; +#line 572 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - __Pyx_RefNannyDeclarations +#line 572 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 24 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("list_structures (wrapper)", 0); +#line 572 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 24 "root_numpy/src/tree.pyx" - { +#line 572 "root_numpy/src/converters.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fname,&__pyx_n_s_tree,0}; +#line 572 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 24 "root_numpy/src/tree.pyx" - PyObject* values[2] = {0,0}; +#line 572 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); -#line 24 "root_numpy/src/tree.pyx" - values[1] = ((PyObject *)Py_None); +#line 572 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_4); -#line 24 "root_numpy/src/tree.pyx" - if (unlikely(__pyx_kwds)) { +#line 572 "root_numpy/src/converters.pyx" + __pyx_t_4 = 0; -#line 24 "root_numpy/src/tree.pyx" - Py_ssize_t kw_args; +#line 572 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); +#line 572 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 24 "root_numpy/src/tree.pyx" - switch (pos_args) { - case 2: -#line 24 "root_numpy/src/tree.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: -#line 24 "root_numpy/src/tree.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 572 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 24 "root_numpy/src/tree.pyx" - case 0: break; - default: -#line 24 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 572 "root_numpy/src/converters.pyx" + __Pyx_Raise(__pyx_t_4, 0, 0, 0); -#line 24 "root_numpy/src/tree.pyx" - } +#line 572 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 24 "root_numpy/src/tree.pyx" - kw_args = PyDict_Size(__pyx_kwds); +#line 572 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - switch (pos_args) { +#line 572 "root_numpy/src/converters.pyx" + } -#line 24 "root_numpy/src/tree.pyx" - case 0: + /* "root_numpy/src/converters.pyx":573 + * if this.value == NULL: + * raise MemoryError("could not allocate %d bytes" % (nbytes + 1)) + * ( this.value)[nbytes] = '\0' # <<<<<<<<<<<<<< + * else: + * this.value = malloc(nbytes) + */ -#line 24 "root_numpy/src/tree.pyx" - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--; - else -#line 24 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 573 "root_numpy/src/converters.pyx" + (((char *)this->value)[nbytes]) = '\x00'; -#line 24 "root_numpy/src/tree.pyx" - case 1: +#line 573 "root_numpy/src/converters.pyx" + goto __pyx_L3; -#line 24 "root_numpy/src/tree.pyx" - if (kw_args > 0) { +#line 573 "root_numpy/src/converters.pyx" + } -#line 24 "root_numpy/src/tree.pyx" - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree); +#line 573 "root_numpy/src/converters.pyx" + /*else*/ { -#line 24 "root_numpy/src/tree.pyx" - if (value) { values[1] = value; kw_args--; } + /* "root_numpy/src/converters.pyx":575 + * ( this.value)[nbytes] = '\0' + * else: + * this.value = malloc(nbytes) # <<<<<<<<<<<<<< + * if this.value == NULL: + * raise MemoryError("could not allocate %d bytes" % nbytes) + */ -#line 24 "root_numpy/src/tree.pyx" - } +#line 575 "root_numpy/src/converters.pyx" + this->value = malloc(nbytes); -#line 24 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/converters.pyx":576 + * else: + * this.value = malloc(nbytes) + * if this.value == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("could not allocate %d bytes" % nbytes) + * # Construct leaflist name + */ -#line 24 "root_numpy/src/tree.pyx" - if (unlikely(kw_args > 0)) { +#line 576 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((this->value == NULL) != 0); -#line 24 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_structures") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 576 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 24 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/converters.pyx":577 + * this.value = malloc(nbytes) + * if this.value == NULL: + * raise MemoryError("could not allocate %d bytes" % nbytes) # <<<<<<<<<<<<<< + * # Construct leaflist name + * leaflist = name + */ -#line 24 "root_numpy/src/tree.pyx" - } else { +#line 577 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_From_int(nbytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: -#line 24 "root_numpy/src/tree.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: -#line 24 "root_numpy/src/tree.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 577 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 24 "root_numpy/src/tree.pyx" - break; - default: -#line 24 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 577 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - } +#line 577 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 24 "root_numpy/src/tree.pyx" - } +#line 577 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 24 "root_numpy/src/tree.pyx" - __pyx_v_fname = values[0]; +#line 577 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - __pyx_v_tree = values[1]; +#line 577 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 24 "root_numpy/src/tree.pyx" - } +#line 577 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 24 "root_numpy/src/tree.pyx" - goto __pyx_L4_argument_unpacking_done; +#line 577 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_3); -#line 24 "root_numpy/src/tree.pyx" - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("list_structures", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 24 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 577 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; -#line 24 "root_numpy/src/tree.pyx" - __pyx_L3_error:; +#line 577 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.list_structures", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 577 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 24 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 577 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 24 "root_numpy/src/tree.pyx" - return NULL; +#line 577 "root_numpy/src/converters.pyx" + __Pyx_Raise(__pyx_t_3, 0, 0, 0); -#line 24 "root_numpy/src/tree.pyx" - __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 24 "root_numpy/src/tree.pyx" -__pyx_pf_13_librootnumpy_4list_structures(__pyx_self, __pyx_v_fname, __pyx_v_tree); +#line 577 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 24 "root_numpy/src/tree.pyx" +#line 577 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 577 "root_numpy/src/converters.pyx" + } -#line 24 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 577 "root_numpy/src/converters.pyx" + } -#line 24 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 577 "root_numpy/src/converters.pyx" + __pyx_L3:; -#line 24 "root_numpy/src/tree.pyx" - return __pyx_r; + /* "root_numpy/src/converters.pyx":579 + * raise MemoryError("could not allocate %d bytes" % nbytes) + * # Construct leaflist name + * leaflist = name # <<<<<<<<<<<<<< + * if ndim > 0 and roottype.compare('C') != 0: + * for axis in range(ndim): + */ -#line 24 "root_numpy/src/tree.pyx" -} +#line 579 "root_numpy/src/converters.pyx" + __pyx_v_leaflist = __pyx_v_name; -#line 24 "root_numpy/src/tree.pyx" + /* "root_numpy/src/converters.pyx":580 + * # Construct leaflist name + * leaflist = name + * if ndim > 0 and roottype.compare('C') != 0: # <<<<<<<<<<<<<< + * for axis in range(ndim): + * token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') + */ +#line 580 "root_numpy/src/converters.pyx" + __pyx_t_5 = ((__pyx_v_ndim > 0) != 0); -#line 24 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pf_13_librootnumpy_4list_structures(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname, PyObject *__pyx_v_tree) { - TFile *__pyx_v_rfile -#line 24 "root_numpy/src/tree.pyx" -; - TTree *__pyx_v_rtree -#line 24 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_structure = NULL -#line 24 "root_numpy/src/tree.pyx" -; +#line 580 "root_numpy/src/converters.pyx" + if (__pyx_t_5) { -#line 24 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - const char *__pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 580 "root_numpy/src/converters.pyx" + } else { -#line 24 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("list_structures", 0); +#line 580 "root_numpy/src/converters.pyx" + __pyx_t_2 = __pyx_t_5; -#line 24 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_tree); +#line 580 "root_numpy/src/converters.pyx" + goto __pyx_L7_bool_binop_done; - /* "root_numpy/src/tree.pyx":25 - * - * def list_structures(fname, tree=None): - * if tree == None: # <<<<<<<<<<<<<< - * # automatically select single tree - * tree = list_trees(fname) - */ +#line 580 "root_numpy/src/converters.pyx" + } -#line 25 "root_numpy/src/tree.pyx" - __pyx_t_1 = PyObject_RichCompare(__pyx_v_tree, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 580 "root_numpy/src/converters.pyx" + __pyx_t_1 = __pyx_convert_string_from_py_std__string(__pyx_n_b_C); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 25 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 580 "root_numpy/src/converters.pyx" + __pyx_t_5 = ((__pyx_v_roottype.compare(__pyx_t_1) != 0) != 0); -#line 25 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 580 "root_numpy/src/converters.pyx" + __pyx_t_2 = __pyx_t_5; -#line 25 "root_numpy/src/tree.pyx" +#line 580 "root_numpy/src/converters.pyx" + __pyx_L7_bool_binop_done:; + +#line 580 "root_numpy/src/converters.pyx" if (__pyx_t_2) { - /* "root_numpy/src/tree.pyx":27 - * if tree == None: - * # automatically select single tree - * tree = list_trees(fname) # <<<<<<<<<<<<<< - * if len(tree) != 1: - * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) + /* "root_numpy/src/converters.pyx":581 + * leaflist = name + * if ndim > 0 and roottype.compare('C') != 0: + * for axis in range(ndim): # <<<<<<<<<<<<<< + * token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') + * leaflist.append( token) */ -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_trees); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 581 "root_numpy/src/converters.pyx" + __pyx_t_6 = __pyx_v_ndim; -#line 27 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 581 "root_numpy/src/converters.pyx" + for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_4 = NULL; +#line 581 "root_numpy/src/converters.pyx" + __pyx_v_axis = __pyx_t_7; -#line 27 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + /* "root_numpy/src/converters.pyx":582 + * if ndim > 0 and roottype.compare('C') != 0: + * for axis in range(ndim): + * token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') # <<<<<<<<<<<<<< + * leaflist.append( token) + * leaflist.append(b'/') + */ -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_d, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 27 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_4)) { +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 27 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dims[__pyx_v_axis])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 27 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_4); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 27 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_9 = NULL; -#line 27 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 582 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { -#line 27 "root_numpy/src/tree.pyx" - } +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); -#line 27 "root_numpy/src/tree.pyx" - } +#line 582 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_9)) { -#line 27 "root_numpy/src/tree.pyx" - if (!__pyx_t_4) { +#line 582 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_fname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 582 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_9); -#line 27 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); -#line 27 "root_numpy/src/tree.pyx" - } else { +#line 582 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_4, function); -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 582 "root_numpy/src/converters.pyx" + } -#line 27 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 582 "root_numpy/src/converters.pyx" + } -#line 27 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; +#line 582 "root_numpy/src/converters.pyx" + if (!__pyx_t_9) { -#line 27 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fname); +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 27 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 27 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fname); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 582 "root_numpy/src/converters.pyx" + } else { -#line 27 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 27 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_10); -#line 27 "root_numpy/src/tree.pyx" - } +#line 582 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; -#line 27 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 582 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8); -#line 27 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_v_tree, __pyx_t_1); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_8); -#line 27 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_8 = 0; - /* "root_numpy/src/tree.pyx":28 - * # automatically select single tree - * tree = list_trees(fname) - * if len(tree) != 1: # <<<<<<<<<<<<<< - * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) - * tree = tree[0] - */ +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 28 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyObject_Length(__pyx_v_tree); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 28 "root_numpy/src/tree.pyx" - __pyx_t_2 = ((__pyx_t_6 != 1) != 0); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 28 "root_numpy/src/tree.pyx" - if (__pyx_t_2) { +#line 582 "root_numpy/src/converters.pyx" + } - /* "root_numpy/src/tree.pyx":29 - * tree = list_trees(fname) - * if len(tree) != 1: - * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) # <<<<<<<<<<<<<< - * tree = tree[0] - * cdef TFile* rfile = Open(fname, 'read') - */ +#line 582 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_multiple_trees_found_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 29 "root_numpy/src/tree.pyx" +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); + +#line 582 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 582 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_3); -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__10, __pyx_v_tree); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 582 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 582 "root_numpy/src/converters.pyx" + __Pyx_XDECREF_SET(__pyx_v_token, __pyx_t_3); -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_4 = NULL; +#line 582 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; -#line 29 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + /* "root_numpy/src/converters.pyx":583 + * for axis in range(ndim): + * token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') + * leaflist.append( token) # <<<<<<<<<<<<<< + * leaflist.append(b'/') + * leaflist.append(roottype) + */ -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); +#line 583 "root_numpy/src/converters.pyx" + __pyx_t_11 = __Pyx_PyObject_AsString(__pyx_v_token); if (unlikely((!__pyx_t_11) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 29 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_4)) { +#line 583 "root_numpy/src/converters.pyx" + __pyx_v_leaflist.append(((char *)__pyx_t_11)); -#line 29 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 583 "root_numpy/src/converters.pyx" + } -#line 29 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_4); +#line 583 "root_numpy/src/converters.pyx" + goto __pyx_L6; -#line 29 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 583 "root_numpy/src/converters.pyx" + } -#line 29 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 583 "root_numpy/src/converters.pyx" + __pyx_L6:; -#line 29 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/converters.pyx":584 + * token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') + * leaflist.append( token) + * leaflist.append(b'/') # <<<<<<<<<<<<<< + * leaflist.append(roottype) + * this.branch = tree.GetBranch(name.c_str()) + */ -#line 29 "root_numpy/src/tree.pyx" - } +#line 584 "root_numpy/src/converters.pyx" + __pyx_v_leaflist.append(__pyx_k__11); -#line 29 "root_numpy/src/tree.pyx" - if (!__pyx_t_4) { + /* "root_numpy/src/converters.pyx":585 + * leaflist.append( token) + * leaflist.append(b'/') + * leaflist.append(roottype) # <<<<<<<<<<<<<< + * this.branch = tree.GetBranch(name.c_str()) + * if this.branch == NULL: + */ -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 585 "root_numpy/src/converters.pyx" + __pyx_v_leaflist.append(__pyx_v_roottype); -#line 29 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "root_numpy/src/converters.pyx":586 + * leaflist.append(b'/') + * leaflist.append(roottype) + * this.branch = tree.GetBranch(name.c_str()) # <<<<<<<<<<<<<< + * if this.branch == NULL: + * this.branch = tree.Branch(name.c_str(), this.value, leaflist.c_str()) + */ -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 586 "root_numpy/src/converters.pyx" + this->branch = __pyx_v_tree->GetBranch(__pyx_v_name.c_str()); -#line 29 "root_numpy/src/tree.pyx" - } else { + /* "root_numpy/src/converters.pyx":587 + * leaflist.append(roottype) + * this.branch = tree.GetBranch(name.c_str()) + * if this.branch == NULL: # <<<<<<<<<<<<<< + * this.branch = tree.Branch(name.c_str(), this.value, leaflist.c_str()) + * else: + */ -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 587 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((this->branch == NULL) != 0); -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 587 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 29 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + /* "root_numpy/src/converters.pyx":588 + * this.branch = tree.GetBranch(name.c_str()) + * if this.branch == NULL: + * this.branch = tree.Branch(name.c_str(), this.value, leaflist.c_str()) # <<<<<<<<<<<<<< + * else: + * # check type compatibility of existing branch + */ -#line 29 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); +#line 588 "root_numpy/src/converters.pyx" + this->branch = __pyx_v_tree->Branch(__pyx_v_name.c_str(), this->value, __pyx_v_leaflist.c_str()); -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_5); +#line 588 "root_numpy/src/converters.pyx" + goto __pyx_L11; -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_5 = 0; +#line 588 "root_numpy/src/converters.pyx" + } -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 588 "root_numpy/src/converters.pyx" + /*else*/ { -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); + /* "root_numpy/src/converters.pyx":591 + * else: + * # check type compatibility of existing branch + * if leaflist.compare(string(this.branch.GetTitle())) != 0: # <<<<<<<<<<<<<< + * raise TypeError( + * "field '{0}' of type '{1}' is not compatible " + */ -#line 29 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 591 "root_numpy/src/converters.pyx" + try { -#line 29 "root_numpy/src/tree.pyx" - } +#line 591 "root_numpy/src/converters.pyx" + __pyx_t_1 = std::string(this->branch->GetTitle()); -#line 29 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 591 "root_numpy/src/converters.pyx" + } catch(...) { -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 591 "root_numpy/src/converters.pyx" + __Pyx_CppExn2PyErr(); -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 591 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 29 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); +#line 591 "root_numpy/src/converters.pyx" + } -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_1); +#line 591 "root_numpy/src/converters.pyx" + __pyx_t_2 = ((__pyx_v_leaflist.compare(__pyx_t_1) != 0) != 0); -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 591 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 29 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":594 + * raise TypeError( + * "field '{0}' of type '{1}' is not compatible " + * "with existing branch of type '{2}'".format( # <<<<<<<<<<<<<< + * name, leaflist, str(this.branch.GetTitle()))) + * this.branch.SetAddress(this.value) + */ -#line 29 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 594 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_field_0_of_type_1_is_not_compati, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 29 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 594 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 29 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_1, 0, 0, 0); + /* "root_numpy/src/converters.pyx":595 + * "field '{0}' of type '{1}' is not compatible " + * "with existing branch of type '{2}'".format( + * name, leaflist, str(this.branch.GetTitle()))) # <<<<<<<<<<<<<< + * this.branch.SetAddress(this.value) + * this.branch.SetStatus(1) + */ -#line 29 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_10 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 29 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_10); -#line 29 "root_numpy/src/tree.pyx" - } +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_8 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_leaflist); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":30 - * if len(tree) != 1: - * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) - * tree = tree[0] # <<<<<<<<<<<<<< - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: - */ +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 30 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_tree, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_9 = __Pyx_PyStr_FromString(this->branch->GetTitle()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 30 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 30 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_v_tree, __pyx_t_1); +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 30 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_12); -#line 30 "root_numpy/src/tree.pyx" - goto __pyx_L3; +#line 595 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); -#line 30 "root_numpy/src/tree.pyx" - } +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_9); -#line 30 "root_numpy/src/tree.pyx" - __pyx_L3:; +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_9 = 0; - /* "root_numpy/src/tree.pyx":31 - * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) - * tree = tree[0] - * cdef TFile* rfile = Open(fname, 'read') # <<<<<<<<<<<<<< - * if rfile == NULL: - * raise IOError("cannot read {0}".format(fname)) - */ +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 31 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 31 "root_numpy/src/tree.pyx" - __pyx_v_rfile = TFile::Open(__pyx_t_8, __pyx_k_read); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "root_numpy/src/tree.pyx":32 - * tree = tree[0] - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: # <<<<<<<<<<<<<< - * raise IOError("cannot read {0}".format(fname)) - * cdef TTree* rtree = rfile.Get(tree) - */ +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_12 = NULL; -#line 32 "root_numpy/src/tree.pyx" - __pyx_t_2 = ((__pyx_v_rfile == NULL) != 0); +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_13 = 0; -#line 32 "root_numpy/src/tree.pyx" - if (__pyx_t_2) { +#line 595 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { - /* "root_numpy/src/tree.pyx":33 - * cdef TFile* rfile = Open(fname, 'read') - * if rfile == NULL: - * raise IOError("cannot read {0}".format(fname)) # <<<<<<<<<<<<<< - * cdef TTree* rtree = rfile.Get(tree) - * if rtree == NULL: - */ - -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_read_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); - -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_7 = NULL; +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4); -#line 33 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { +#line 595 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_12)) { -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); +#line 595 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); -#line 33 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_7)) { +#line 595 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_12); -#line 33 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_7); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_4, function); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_13 = 1; -#line 33 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 595 "root_numpy/src/converters.pyx" + } -#line 33 "root_numpy/src/tree.pyx" +#line 595 "root_numpy/src/converters.pyx" } -#line 33 "root_numpy/src/tree.pyx" - } - -#line 33 "root_numpy/src/tree.pyx" - if (!__pyx_t_7) { - -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_fname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 33 "root_numpy/src/tree.pyx" - } else { +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_14); -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 595 "root_numpy/src/converters.pyx" + if (__pyx_t_12) { -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 595 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL; -#line 33 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL; +#line 595 "root_numpy/src/converters.pyx" + } -#line 33 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fname); +#line 595 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_10); -#line 33 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_10); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fname); +#line 595 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_8); -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_8); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 595 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_t_9); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_9); -#line 33 "root_numpy/src/tree.pyx" - } +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_10 = 0; -#line 33 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_8 = 0; -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_9 = 0; -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 595 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 33 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_1); +#line 595 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 595 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 33 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":592 + * # check type compatibility of existing branch + * if leaflist.compare(string(this.branch.GetTitle())) != 0: + * raise TypeError( # <<<<<<<<<<<<<< + * "field '{0}' of type '{1}' is not compatible " + * "with existing branch of type '{2}'".format( + */ -#line 33 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 592 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 33 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 592 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_1, 0, 0, 0); +#line 592 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 33 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 592 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_3); -#line 33 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 592 "root_numpy/src/converters.pyx" + __pyx_t_3 = 0; -#line 33 "root_numpy/src/tree.pyx" - } +#line 592 "root_numpy/src/converters.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":34 - * if rfile == NULL: - * raise IOError("cannot read {0}".format(fname)) - * cdef TTree* rtree = rfile.Get(tree) # <<<<<<<<<<<<<< - * if rtree == NULL: - * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) - */ +#line 592 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 34 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_tree); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 592 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 34 "root_numpy/src/tree.pyx" - __pyx_v_rtree = ((TTree *)__pyx_v_rfile->Get(__pyx_t_8)); +#line 592 "root_numpy/src/converters.pyx" + __Pyx_Raise(__pyx_t_3, 0, 0, 0); - /* "root_numpy/src/tree.pyx":35 - * raise IOError("cannot read {0}".format(fname)) - * cdef TTree* rtree = rfile.Get(tree) - * if rtree == NULL: # <<<<<<<<<<<<<< - * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) - * structure = get_tree_structure(rtree) - */ +#line 592 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 35 "root_numpy/src/tree.pyx" - __pyx_t_2 = ((__pyx_v_rtree == NULL) != 0); +#line 592 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 35 "root_numpy/src/tree.pyx" - if (__pyx_t_2) { +#line 592 "root_numpy/src/converters.pyx" + } - /* "root_numpy/src/tree.pyx":36 - * cdef TTree* rtree = rfile.Get(tree) - * if rtree == NULL: - * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) # <<<<<<<<<<<<<< - * structure = get_tree_structure(rtree) - * rfile.Close() + /* "root_numpy/src/converters.pyx":596 + * "with existing branch of type '{2}'".format( + * name, leaflist, str(this.branch.GetTitle()))) + * this.branch.SetAddress(this.value) # <<<<<<<<<<<<<< + * this.branch.SetStatus(1) + * */ -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_tree_0_not_found_in_1, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 596 "root_numpy/src/converters.pyx" + this->branch->SetAddress(this->value); -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_5 = NULL; +#line 596 "root_numpy/src/converters.pyx" + } -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_6 = 0; +#line 596 "root_numpy/src/converters.pyx" + __pyx_L11:; -#line 36 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + /* "root_numpy/src/converters.pyx":597 + * name, leaflist, str(this.branch.GetTitle()))) + * this.branch.SetAddress(this.value) + * this.branch.SetStatus(1) # <<<<<<<<<<<<<< + * + * __del__(self): + */ -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); +#line 597 "root_numpy/src/converters.pyx" + this->branch->SetStatus(1); -#line 36 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_5)) { + /* "root_numpy/src/converters.pyx":562 + * TBranch* branch + * + * __init__(TTree* tree, string name, string roottype, # <<<<<<<<<<<<<< + * int length, int elembytes, + * int ndim=0, SIZE_t* dims=NULL): + */ -#line 36 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 562 "root_numpy/src/converters.pyx" -#line 36 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_5); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 562 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 36 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 562 "root_numpy/src/converters.pyx" + goto __pyx_L0; -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_6 = 1; +#line 562 "root_numpy/src/converters.pyx" + __pyx_L1_error:; -#line 36 "root_numpy/src/tree.pyx" - } +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_3); -#line 36 "root_numpy/src/tree.pyx" - } +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_4); -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_8); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_9); -#line 36 "root_numpy/src/tree.pyx" - if (__pyx_t_5) { +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_10); -#line 36 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_12); -#line 36 "root_numpy/src/tree.pyx" - } +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_14); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_tree); +#line 562 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("FixedNP2ROOTConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); -#line 36 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_tree); +#line 562 "root_numpy/src/converters.pyx" + __pyx_L0:; -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_tree); +#line 562 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_token); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fname); +#line 562 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 36 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_fname); +#line 562 "root_numpy/src/converters.pyx" +} -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fname); +/* "root_numpy/src/converters.pyx":599 + * this.branch.SetStatus(1) + * + * __del__(self): # <<<<<<<<<<<<<< + * free(this.value) + * + */ -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 599 "root_numpy/src/converters.pyx" -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 599 "root_numpy/src/converters.pyx" +PyObject *__pyx_t_13_librootnumpy_FixedNP2ROOTConverter::__del__(CYTHON_UNUSED PyObject *__pyx_v_self) { -#line 36 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 599 "root_numpy/src/converters.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 599 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("__del__", 0); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); + /* "root_numpy/src/converters.pyx":600 + * + * __del__(self): + * free(this.value) # <<<<<<<<<<<<<< + * + * void fill_from(void* source): + */ -#line 36 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); +#line 600 "root_numpy/src/converters.pyx" + free(this->value); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_1); + /* "root_numpy/src/converters.pyx":599 + * this.branch.SetStatus(1) + * + * __del__(self): # <<<<<<<<<<<<<< + * free(this.value) + * + */ -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 599 "root_numpy/src/converters.pyx" -#line 36 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 36 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 599 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 36 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 599 "root_numpy/src/converters.pyx" + __pyx_r = Py_None; __Pyx_INCREF(Py_None); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_1, 0, 0, 0); +#line 599 "root_numpy/src/converters.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 36 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 599 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); -#line 36 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 599 "root_numpy/src/converters.pyx" + return __pyx_r; -#line 36 "root_numpy/src/tree.pyx" - } +#line 599 "root_numpy/src/converters.pyx" +} - /* "root_numpy/src/tree.pyx":37 - * if rtree == NULL: - * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) - * structure = get_tree_structure(rtree) # <<<<<<<<<<<<<< - * rfile.Close() - * del rfile +/* "root_numpy/src/converters.pyx":602 + * free(this.value) + * + * void fill_from(void* source): # <<<<<<<<<<<<<< + * memcpy(this.value, source, this.nbytes) + * this.branch.Fill() */ -#line 37 "root_numpy/src/tree.pyx" - __pyx_t_1 = __pyx_f_13_librootnumpy_get_tree_structure(__pyx_v_rtree, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 602 "root_numpy/src/converters.pyx" -#line 37 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); -#line 37 "root_numpy/src/tree.pyx" - __pyx_v_structure = __pyx_t_1; +#line 602 "root_numpy/src/converters.pyx" +void __pyx_t_13_librootnumpy_FixedNP2ROOTConverter::fill_from(void *__pyx_v_source) { + __Pyx_RefNannyDeclarations -#line 37 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 602 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("fill_from", 0); - /* "root_numpy/src/tree.pyx":38 - * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) - * structure = get_tree_structure(rtree) - * rfile.Close() # <<<<<<<<<<<<<< - * del rfile - * return structure + /* "root_numpy/src/converters.pyx":603 + * + * void fill_from(void* source): + * memcpy(this.value, source, this.nbytes) # <<<<<<<<<<<<<< + * this.branch.Fill() + * */ -#line 38 "root_numpy/src/tree.pyx" - __pyx_v_rfile->Close(); +#line 603 "root_numpy/src/converters.pyx" + memcpy(this->value, __pyx_v_source, this->nbytes); - /* "root_numpy/src/tree.pyx":39 - * structure = get_tree_structure(rtree) - * rfile.Close() - * del rfile # <<<<<<<<<<<<<< - * return structure + /* "root_numpy/src/converters.pyx":604 + * void fill_from(void* source): + * memcpy(this.value, source, this.nbytes) + * this.branch.Fill() # <<<<<<<<<<<<<< + * * */ -#line 39 "root_numpy/src/tree.pyx" - delete __pyx_v_rfile; +#line 604 "root_numpy/src/converters.pyx" + this->branch->Fill(); - /* "root_numpy/src/tree.pyx":40 - * rfile.Close() - * del rfile - * return structure # <<<<<<<<<<<<<< - * + /* "root_numpy/src/converters.pyx":602 + * free(this.value) * + * void fill_from(void* source): # <<<<<<<<<<<<<< + * memcpy(this.value, source, this.nbytes) + * this.branch.Fill() */ -#line 40 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 602 "root_numpy/src/converters.pyx" -#line 40 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_structure); -#line 40 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_v_structure; +#line 602 "root_numpy/src/converters.pyx" + /* function exit code */ -#line 40 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 602 "root_numpy/src/converters.pyx" + __Pyx_RefNannyFinishContext(); - /* "root_numpy/src/tree.pyx":24 +#line 602 "root_numpy/src/converters.pyx" +} + +/* "root_numpy/src/converters.pyx":607 * * - * def list_structures(fname, tree=None): # <<<<<<<<<<<<<< - * if tree == None: - * # automatically select single tree + * cdef NP2ROOTConverter* find_np2root_converter(TTree* tree, name, dtype): # <<<<<<<<<<<<<< + * # TODO: + * # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. */ -#line 24 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" -#line 24 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 607 "root_numpy/src/converters.pyx" +static __pyx_t_13_librootnumpy_NP2ROOTConverter *__pyx_f_13_librootnumpy_find_np2root_converter(TTree *__pyx_v_tree, PyObject *__pyx_v_name, PyObject *__pyx_v_dtype) { + __pyx_t_13_librootnumpy_NP2ROOTConverter *__pyx_v_conv +#line 607 "root_numpy/src/converters.pyx" +; + int __pyx_v_axis +#line 607 "root_numpy/src/converters.pyx" +; + int __pyx_v_ndim +#line 607 "root_numpy/src/converters.pyx" +; + int __pyx_v_length +#line 607 "root_numpy/src/converters.pyx" +; + __pyx_t_13_librootnumpy_SIZE_t *__pyx_v_dims +#line 607 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_subdtype = NULL +#line 607 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_shape = NULL +#line 607 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_elembytes = NULL +#line 607 "root_numpy/src/converters.pyx" +; + PyObject *__pyx_v_roottype = NULL +#line 607 "root_numpy/src/converters.pyx" +; -#line 24 "root_numpy/src/tree.pyx" - __pyx_L1_error:; +#line 607 "root_numpy/src/converters.pyx" + __pyx_t_13_librootnumpy_NP2ROOTConverter *__pyx_r; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *(*__pyx_t_6)(PyObject *); + Py_ssize_t __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + __pyx_t_13_librootnumpy_SIZE_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + std::string __pyx_t_12; + std::string __pyx_t_13; + __pyx_t_13_librootnumpy_FixedNP2ROOTConverter *__pyx_t_14; + struct __pyx_opt_args_21FixedNP2ROOTConverter___init__ __pyx_t_15; + PyObject *__pyx_t_16 = NULL; + PyObject *__pyx_t_17 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_1); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_RefNannySetupContext("find_np2root_converter", 0); -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_v_dtype); -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); + /* "root_numpy/src/converters.pyx":611 + * # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. + * # Handle np.object (array) columns + * cdef NP2ROOTConverter* conv = NULL # <<<<<<<<<<<<<< + * cdef int axis, ndim = 0 + * cdef int length = 1 + */ -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_5); +#line 611 "root_numpy/src/converters.pyx" + __pyx_v_conv = NULL; -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_7); + /* "root_numpy/src/converters.pyx":612 + * # Handle np.object (array) columns + * cdef NP2ROOTConverter* conv = NULL + * cdef int axis, ndim = 0 # <<<<<<<<<<<<<< + * cdef int length = 1 + * cdef SIZE_t* dims = NULL + */ -#line 24 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.list_structures", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 612 "root_numpy/src/converters.pyx" + __pyx_v_ndim = 0; -#line 24 "root_numpy/src/tree.pyx" - __pyx_r = NULL; + /* "root_numpy/src/converters.pyx":613 + * cdef NP2ROOTConverter* conv = NULL + * cdef int axis, ndim = 0 + * cdef int length = 1 # <<<<<<<<<<<<<< + * cdef SIZE_t* dims = NULL + * subdtype = dtype.subdtype + */ -#line 24 "root_numpy/src/tree.pyx" - __pyx_L0:; +#line 613 "root_numpy/src/converters.pyx" + __pyx_v_length = 1; -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_structure); + /* "root_numpy/src/converters.pyx":614 + * cdef int axis, ndim = 0 + * cdef int length = 1 + * cdef SIZE_t* dims = NULL # <<<<<<<<<<<<<< + * subdtype = dtype.subdtype + * if subdtype is not None: + */ -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_tree); +#line 614 "root_numpy/src/converters.pyx" + __pyx_v_dims = NULL; -#line 24 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); + /* "root_numpy/src/converters.pyx":615 + * cdef int length = 1 + * cdef SIZE_t* dims = NULL + * subdtype = dtype.subdtype # <<<<<<<<<<<<<< + * if subdtype is not None: + * # Fixed-size subarray type + */ -#line 24 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 615 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_subdtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 24 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 615 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 24 "root_numpy/src/tree.pyx" -} +#line 615 "root_numpy/src/converters.pyx" + __pyx_v_subdtype = __pyx_t_1; -/* "root_numpy/src/tree.pyx":43 - * - * - * def list_branches(fname, tree=None): # <<<<<<<<<<<<<< - * return list(list_structures(fname, tree).keys()) - * +#line 615 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; + + /* "root_numpy/src/converters.pyx":616 + * cdef SIZE_t* dims = NULL + * subdtype = dtype.subdtype + * if subdtype is not None: # <<<<<<<<<<<<<< + * # Fixed-size subarray type + * dtype, shape = subdtype */ -#line 43 "root_numpy/src/tree.pyx" +#line 616 "root_numpy/src/converters.pyx" + __pyx_t_2 = (__pyx_v_subdtype != Py_None); +#line 616 "root_numpy/src/converters.pyx" + __pyx_t_3 = (__pyx_t_2 != 0); -#line 43 "root_numpy/src/tree.pyx" -/* Python wrapper */ +#line 616 "root_numpy/src/converters.pyx" + if (__pyx_t_3) { -#line 43 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_7list_branches(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_13_librootnumpy_7list_branches = -#line 43 "root_numpy/src/tree.pyx" -{"list_branches", (PyCFunction)__pyx_pw_13_librootnumpy_7list_branches, METH_VARARGS|METH_KEYWORDS, 0}; + /* "root_numpy/src/converters.pyx":618 + * if subdtype is not None: + * # Fixed-size subarray type + * dtype, shape = subdtype # <<<<<<<<<<<<<< + * ndim = len(shape) + * dims = malloc(ndim * sizeof(SIZE_t)) + */ -#line 43 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_7list_branches(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_fname = 0 -#line 43 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_tree = 0 -#line 43 "root_numpy/src/tree.pyx" -; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 618 "root_numpy/src/converters.pyx" + if ((likely(PyTuple_CheckExact(__pyx_v_subdtype))) || (PyList_CheckExact(__pyx_v_subdtype))) { -#line 43 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = 0; +#line 618 "root_numpy/src/converters.pyx" + PyObject* sequence = __pyx_v_subdtype; -#line 43 "root_numpy/src/tree.pyx" - __Pyx_RefNannyDeclarations +#line 618 "root_numpy/src/converters.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 43 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("list_branches (wrapper)", 0); +#line 618 "root_numpy/src/converters.pyx" + Py_ssize_t size = Py_SIZE(sequence); -#line 43 "root_numpy/src/tree.pyx" - { +#line 618 "root_numpy/src/converters.pyx" + #else -#line 43 "root_numpy/src/tree.pyx" - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fname,&__pyx_n_s_tree,0}; +#line 618 "root_numpy/src/converters.pyx" + Py_ssize_t size = PySequence_Size(sequence); -#line 43 "root_numpy/src/tree.pyx" - PyObject* values[2] = {0,0}; +#line 618 "root_numpy/src/converters.pyx" + #endif -#line 43 "root_numpy/src/tree.pyx" - values[1] = ((PyObject *)Py_None); +#line 618 "root_numpy/src/converters.pyx" + if (unlikely(size != 2)) { -#line 43 "root_numpy/src/tree.pyx" - if (unlikely(__pyx_kwds)) { +#line 618 "root_numpy/src/converters.pyx" + if (size > 2) __Pyx_RaiseTooManyValuesError(2); -#line 43 "root_numpy/src/tree.pyx" - Py_ssize_t kw_args; +#line 618 "root_numpy/src/converters.pyx" + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); -#line 43 "root_numpy/src/tree.pyx" - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); +#line 618 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - switch (pos_args) { - case 2: -#line 43 "root_numpy/src/tree.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: -#line 43 "root_numpy/src/tree.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 618 "root_numpy/src/converters.pyx" + } -#line 43 "root_numpy/src/tree.pyx" - case 0: break; - default: -#line 43 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 618 "root_numpy/src/converters.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + if (likely(PyTuple_CheckExact(sequence))) { -#line 43 "root_numpy/src/tree.pyx" - kw_args = PyDict_Size(__pyx_kwds); +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); -#line 43 "root_numpy/src/tree.pyx" - switch (pos_args) { +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); -#line 43 "root_numpy/src/tree.pyx" - case 0: +#line 618 "root_numpy/src/converters.pyx" + } else { -#line 43 "root_numpy/src/tree.pyx" - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--; - else -#line 43 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); -#line 43 "root_numpy/src/tree.pyx" - case 1: +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); -#line 43 "root_numpy/src/tree.pyx" - if (kw_args > 0) { +#line 618 "root_numpy/src/converters.pyx" + } -#line 43 "root_numpy/src/tree.pyx" - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree); +#line 618 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_1); -#line 43 "root_numpy/src/tree.pyx" - if (value) { values[1] = value; kw_args--; } +#line 618 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_4); -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + #else -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - if (unlikely(kw_args > 0)) { +#line 618 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 43 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_branches") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 43 "root_numpy/src/tree.pyx" - } else { +#line 618 "root_numpy/src/converters.pyx" + #endif -#line 43 "root_numpy/src/tree.pyx" - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: -#line 43 "root_numpy/src/tree.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: -#line 43 "root_numpy/src/tree.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 618 "root_numpy/src/converters.pyx" + } else { -#line 43 "root_numpy/src/tree.pyx" - break; - default: -#line 43 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 618 "root_numpy/src/converters.pyx" + Py_ssize_t index = -1; -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyObject_GetIter(__pyx_v_subdtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 43 "root_numpy/src/tree.pyx" - __pyx_v_fname = values[0]; +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) +#line 618 "root_numpy/src/converters.pyx" +goto __pyx_L4_unpacking_failed; -#line 43 "root_numpy/src/tree.pyx" - __pyx_v_tree = values[1]; +#line 618 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) +#line 618 "root_numpy/src/converters.pyx" +goto __pyx_L4_unpacking_failed; -#line 43 "root_numpy/src/tree.pyx" - } +#line 618 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 43 "root_numpy/src/tree.pyx" - goto __pyx_L4_argument_unpacking_done; +#line 618 "root_numpy/src/converters.pyx" + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("list_branches", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); -#line 43 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_6 = NULL; -#line 43 "root_numpy/src/tree.pyx" - __pyx_L3_error:; +#line 618 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 43 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.list_branches", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 618 "root_numpy/src/converters.pyx" + goto __pyx_L5_unpacking_done; -#line 43 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 618 "root_numpy/src/converters.pyx" + __pyx_L4_unpacking_failed:; -#line 43 "root_numpy/src/tree.pyx" - return NULL; +#line 618 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 43 "root_numpy/src/tree.pyx" - __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 43 "root_numpy/src/tree.pyx" -__pyx_pf_13_librootnumpy_6list_branches(__pyx_self, __pyx_v_fname, __pyx_v_tree); +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_6 = NULL; -#line 43 "root_numpy/src/tree.pyx" +#line 618 "root_numpy/src/converters.pyx" + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); +#line 618 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 618 "root_numpy/src/converters.pyx" + __pyx_L5_unpacking_done:; -#line 43 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 618 "root_numpy/src/converters.pyx" + } -#line 43 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 618 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_1); -#line 43 "root_numpy/src/tree.pyx" -} +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; -#line 43 "root_numpy/src/tree.pyx" +#line 618 "root_numpy/src/converters.pyx" + __pyx_v_shape = __pyx_t_4; +#line 618 "root_numpy/src/converters.pyx" + __pyx_t_4 = 0; -#line 43 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pf_13_librootnumpy_6list_branches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname, PyObject *__pyx_v_tree) { + /* "root_numpy/src/converters.pyx":619 + * # Fixed-size subarray type + * dtype, shape = subdtype + * ndim = len(shape) # <<<<<<<<<<<<<< + * dims = malloc(ndim * sizeof(SIZE_t)) + * if dims == NULL: + */ -#line 43 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 619 "root_numpy/src/converters.pyx" + __pyx_t_7 = PyObject_Length(__pyx_v_shape); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("list_branches", 0); +#line 619 "root_numpy/src/converters.pyx" + __pyx_v_ndim = __pyx_t_7; - /* "root_numpy/src/tree.pyx":44 - * - * def list_branches(fname, tree=None): - * return list(list_structures(fname, tree).keys()) # <<<<<<<<<<<<<< - * - * + /* "root_numpy/src/converters.pyx":620 + * dtype, shape = subdtype + * ndim = len(shape) + * dims = malloc(ndim * sizeof(SIZE_t)) # <<<<<<<<<<<<<< + * if dims == NULL: + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) */ -#line 44 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 620 "root_numpy/src/converters.pyx" + __pyx_v_dims = ((__pyx_t_13_librootnumpy_SIZE_t *)malloc((__pyx_v_ndim * (sizeof(__pyx_t_13_librootnumpy_SIZE_t))))); -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_structures); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":621 + * ndim = len(shape) + * dims = malloc(ndim * sizeof(SIZE_t)) + * if dims == NULL: # <<<<<<<<<<<<<< + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + * for axis in range(ndim): + */ -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 621 "root_numpy/src/converters.pyx" + __pyx_t_3 = ((__pyx_v_dims == NULL) != 0); -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_4 = NULL; +#line 621 "root_numpy/src/converters.pyx" + if (__pyx_t_3) { -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_5 = 0; + /* "root_numpy/src/converters.pyx":622 + * dims = malloc(ndim * sizeof(SIZE_t)) + * if dims == NULL: + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) # <<<<<<<<<<<<<< + * for axis in range(ndim): + * dims[axis] = shape[axis] + */ -#line 44 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { +#line 622 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyInt_FromSize_t((__pyx_v_ndim * (sizeof(__pyx_t_13_librootnumpy_SIZE_t)))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); +#line 622 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 44 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_4)) { +#line 622 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_could_not_allocate_d_bytes, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 622 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_4); +#line 622 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 622 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 622 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_5 = 1; +#line 622 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - } +#line 622 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - } +#line 622 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 622 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 622 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - if (__pyx_t_4) { +#line 622 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 44 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; +#line 622 "root_numpy/src/converters.pyx" + __Pyx_Raise(__pyx_t_1, 0, 0, 0); -#line 44 "root_numpy/src/tree.pyx" - } +#line 622 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fname); +#line 622 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_fname); +#line 622 "root_numpy/src/converters.pyx" + } -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fname); + /* "root_numpy/src/converters.pyx":623 + * if dims == NULL: + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + * for axis in range(ndim): # <<<<<<<<<<<<<< + * dims[axis] = shape[axis] + * length *= dims[axis] + */ -#line 44 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_tree); +#line 623 "root_numpy/src/converters.pyx" + __pyx_t_8 = __pyx_v_ndim; -#line 44 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_tree); +#line 623 "root_numpy/src/converters.pyx" + for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) { -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_tree); +#line 623 "root_numpy/src/converters.pyx" + __pyx_v_axis = __pyx_t_9; -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":624 + * raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + * for axis in range(ndim): + * dims[axis] = shape[axis] # <<<<<<<<<<<<<< + * length *= dims[axis] + * if dtype in TYPES_NUMPY2ROOT: + */ -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 624 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shape, __pyx_v_axis, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 624 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 624 "root_numpy/src/converters.pyx" + __pyx_t_10 = __Pyx_PyInt_As_Py_intptr_t(__pyx_t_1); if (unlikely((__pyx_t_10 == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 624 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 624 "root_numpy/src/converters.pyx" + (__pyx_v_dims[__pyx_v_axis]) = __pyx_t_10; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "root_numpy/src/converters.pyx":625 + * for axis in range(ndim): + * dims[axis] = shape[axis] + * length *= dims[axis] # <<<<<<<<<<<<<< + * if dtype in TYPES_NUMPY2ROOT: + * elembytes, roottype = TYPES_NUMPY2ROOT[dtype] + */ -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_2 = NULL; +#line 625 "root_numpy/src/converters.pyx" + __pyx_v_length = (__pyx_v_length * (__pyx_v_dims[__pyx_v_axis])); -#line 44 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { +#line 625 "root_numpy/src/converters.pyx" + } -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); +#line 625 "root_numpy/src/converters.pyx" + goto __pyx_L3; -#line 44 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_2)) { +#line 625 "root_numpy/src/converters.pyx" + } -#line 44 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 625 "root_numpy/src/converters.pyx" + __pyx_L3:; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_2); + /* "root_numpy/src/converters.pyx":626 + * dims[axis] = shape[axis] + * length *= dims[axis] + * if dtype in TYPES_NUMPY2ROOT: # <<<<<<<<<<<<<< + * elembytes, roottype = TYPES_NUMPY2ROOT[dtype] + * conv = new FixedNP2ROOTConverter(tree, name, roottype, length, elembytes, ndim, dims) + */ -#line 44 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 626 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES_NUMPY2ROOT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 626 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - } +#line 626 "root_numpy/src/converters.pyx" + __pyx_t_3 = (__Pyx_PySequence_Contains(__pyx_v_dtype, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - } +#line 626 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 44 "root_numpy/src/tree.pyx" +#line 626 "root_numpy/src/converters.pyx" + __pyx_t_2 = (__pyx_t_3 != 0); + +#line 626 "root_numpy/src/converters.pyx" if (__pyx_t_2) { -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/converters.pyx":627 + * length *= dims[axis] + * if dtype in TYPES_NUMPY2ROOT: + * elembytes, roottype = TYPES_NUMPY2ROOT[dtype] # <<<<<<<<<<<<<< + * conv = new FixedNP2ROOTConverter(tree, name, roottype, length, elembytes, ndim, dims) + * elif dtype.kind == 'S': + */ -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES_NUMPY2ROOT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - } else { +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_dtype); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; -#line 44 "root_numpy/src/tree.pyx" - } +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 627 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 627 "root_numpy/src/converters.pyx" + if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 627 "root_numpy/src/converters.pyx" + PyObject* sequence = __pyx_t_4; -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 627 "root_numpy/src/converters.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 44 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); +#line 627 "root_numpy/src/converters.pyx" + Py_ssize_t size = Py_SIZE(sequence); -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_1); +#line 627 "root_numpy/src/converters.pyx" + #else -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 627 "root_numpy/src/converters.pyx" + Py_ssize_t size = PySequence_Size(sequence); -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 627 "root_numpy/src/converters.pyx" + #endif -#line 44 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 627 "root_numpy/src/converters.pyx" + if (unlikely(size != 2)) { -#line 44 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 627 "root_numpy/src/converters.pyx" + if (size > 2) __Pyx_RaiseTooManyValuesError(2); -#line 44 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_t_1; +#line 627 "root_numpy/src/converters.pyx" + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); -#line 44 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 627 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 44 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 627 "root_numpy/src/converters.pyx" + } - /* "root_numpy/src/tree.pyx":43 - * - * - * def list_branches(fname, tree=None): # <<<<<<<<<<<<<< - * return list(list_structures(fname, tree).keys()) - * - */ +#line 627 "root_numpy/src/converters.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 43 "root_numpy/src/tree.pyx" +#line 627 "root_numpy/src/converters.pyx" + if (likely(PyTuple_CheckExact(sequence))) { +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); -#line 43 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); -#line 43 "root_numpy/src/tree.pyx" - __pyx_L1_error:; +#line 627 "root_numpy/src/converters.pyx" + } else { -#line 43 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_1); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); -#line 43 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); -#line 43 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 627 "root_numpy/src/converters.pyx" + } -#line 43 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); +#line 627 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_1); -#line 43 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_6); +#line 627 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_5); -#line 43 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.list_branches", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 627 "root_numpy/src/converters.pyx" + #else -#line 43 "root_numpy/src/tree.pyx" - __pyx_r = NULL; +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - __pyx_L0:; +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 43 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 43 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 43 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 627 "root_numpy/src/converters.pyx" + #endif -#line 43 "root_numpy/src/tree.pyx" -} +#line 627 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -/* "root_numpy/src/tree.pyx":47 - * - * - * cdef get_branch_structure(TBranch* branch): # <<<<<<<<<<<<<< - * cdef TObjArray* leaves - * cdef TLeaf* leaf - */ +#line 627 "root_numpy/src/converters.pyx" + } else { -#line 47 "root_numpy/src/tree.pyx" +#line 627 "root_numpy/src/converters.pyx" + Py_ssize_t index = -1; +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 47 "root_numpy/src/tree.pyx" -static PyObject *__pyx_f_13_librootnumpy_get_branch_structure(TBranch *__pyx_v_branch) { - TObjArray *__pyx_v_leaves -#line 47 "root_numpy/src/tree.pyx" -; - TLeaf *__pyx_v_leaf -#line 47 "root_numpy/src/tree.pyx" -; - int __pyx_v_ileaf -#line 47 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_leaflist = NULL -#line 47 "root_numpy/src/tree.pyx" -; +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_11); -#line 47 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 627 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 47 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("get_branch_structure", 0); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_6 = Py_TYPE(__pyx_t_11)->tp_iternext; + index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_11); if (unlikely(!__pyx_t_1)) +#line 627 "root_numpy/src/converters.pyx" +goto __pyx_L10_unpacking_failed; - /* "root_numpy/src/tree.pyx":51 - * cdef TLeaf* leaf - * cdef int ileaf - * leaves = branch.GetListOfLeaves() # <<<<<<<<<<<<<< - * if leaves == NULL: - * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) - */ +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); + index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_11); if (unlikely(!__pyx_t_5)) +#line 627 "root_numpy/src/converters.pyx" +goto __pyx_L10_unpacking_failed; -#line 51 "root_numpy/src/tree.pyx" - __pyx_v_leaves = __pyx_v_branch->GetListOfLeaves(); +#line 627 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); - /* "root_numpy/src/tree.pyx":52 - * cdef int ileaf - * leaves = branch.GetListOfLeaves() - * if leaves == NULL: # <<<<<<<<<<<<<< - * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) - * leaflist = [] - */ +#line 627 "root_numpy/src/converters.pyx" + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 52 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_leaves == NULL) != 0); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_6 = NULL; -#line 52 "root_numpy/src/tree.pyx" - if (__pyx_t_1) { +#line 627 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "root_numpy/src/tree.pyx":53 - * leaves = branch.GetListOfLeaves() - * if leaves == NULL: - * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) # <<<<<<<<<<<<<< - * leaflist = [] - * for ileaf in range(leaves.GetEntries()): - */ +#line 627 "root_numpy/src/converters.pyx" + goto __pyx_L11_unpacking_done; -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_branch_0_has_no_leaves, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 627 "root_numpy/src/converters.pyx" + __pyx_L10_unpacking_failed:; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 627 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_6 = NULL; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 627 "root_numpy/src/converters.pyx" + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_5 = NULL; +#line 627 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { +#line 627 "root_numpy/src/converters.pyx" + __pyx_L11_unpacking_done:; -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); +#line 627 "root_numpy/src/converters.pyx" + } -#line 53 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_5)) { +#line 627 "root_numpy/src/converters.pyx" + __pyx_v_elembytes = __pyx_t_1; -#line 53 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_1 = 0; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_5); +#line 627 "root_numpy/src/converters.pyx" + __pyx_v_roottype = __pyx_t_5; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 627 "root_numpy/src/converters.pyx" + __pyx_t_5 = 0; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); + /* "root_numpy/src/converters.pyx":628 + * if dtype in TYPES_NUMPY2ROOT: + * elembytes, roottype = TYPES_NUMPY2ROOT[dtype] + * conv = new FixedNP2ROOTConverter(tree, name, roottype, length, elembytes, ndim, dims) # <<<<<<<<<<<<<< + * elif dtype.kind == 'S': + * conv = new FixedNP2ROOTConverter(tree, name, 'C', dtype.itemsize, 1) + */ -#line 53 "root_numpy/src/tree.pyx" - } +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - } +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_13 = __pyx_convert_string_from_py_std__string(__pyx_v_roottype); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - if (!__pyx_t_5) { +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_elembytes); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_15.__pyx_n = 2; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_15.ndim = __pyx_v_ndim; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_15.dims = __pyx_v_dims; -#line 53 "root_numpy/src/tree.pyx" - } else { +#line 628 "root_numpy/src/converters.pyx" + __pyx_t_14 = new __pyx_t_13_librootnumpy_FixedNP2ROOTConverter(__pyx_v_tree, __pyx_t_12, __pyx_t_13, __pyx_v_length, __pyx_t_8, &__pyx_t_15); -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 628 "root_numpy/src/converters.pyx" + __pyx_v_conv = __pyx_t_14; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 628 "root_numpy/src/converters.pyx" + goto __pyx_L9; -#line 53 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; +#line 628 "root_numpy/src/converters.pyx" + } -#line 53 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + /* "root_numpy/src/converters.pyx":629 + * elembytes, roottype = TYPES_NUMPY2ROOT[dtype] + * conv = new FixedNP2ROOTConverter(tree, name, roottype, length, elembytes, ndim, dims) + * elif dtype.kind == 'S': # <<<<<<<<<<<<<< + * conv = new FixedNP2ROOTConverter(tree, name, 'C', dtype.itemsize, 1) + * else: + */ -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_4); +#line 629 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 629 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 629 "root_numpy/src/converters.pyx" + __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_n_s_S, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 629 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 629 "root_numpy/src/converters.pyx" + if (__pyx_t_2) { -#line 53 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/converters.pyx":630 + * conv = new FixedNP2ROOTConverter(tree, name, roottype, length, elembytes, ndim, dims) + * elif dtype.kind == 'S': + * conv = new FixedNP2ROOTConverter(tree, name, 'C', dtype.itemsize, 1) # <<<<<<<<<<<<<< + * else: + * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) + */ -#line 53 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 630 "root_numpy/src/converters.pyx" + __pyx_t_13 = __pyx_convert_string_from_py_std__string(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 630 "root_numpy/src/converters.pyx" + __pyx_t_12 = __pyx_convert_string_from_py_std__string(__pyx_n_b_C); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 630 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); +#line 630 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 630 "root_numpy/src/converters.pyx" + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 630 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 53 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 630 "root_numpy/src/converters.pyx" + __pyx_v_conv = new __pyx_t_13_librootnumpy_FixedNP2ROOTConverter(__pyx_v_tree, __pyx_t_13, __pyx_t_12, __pyx_t_8, 1, NULL); -#line 53 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 630 "root_numpy/src/converters.pyx" + goto __pyx_L9; -#line 53 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 53 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - -#line 53 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 53 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 53 "root_numpy/src/tree.pyx" +#line 630 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/tree.pyx":54 - * if leaves == NULL: - * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) - * leaflist = [] # <<<<<<<<<<<<<< - * for ileaf in range(leaves.GetEntries()): - * leaf = leaves.At(ileaf) - */ - -#line 54 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 54 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 54 "root_numpy/src/tree.pyx" - __pyx_v_leaflist = ((PyObject*)__pyx_t_2); - -#line 54 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 630 "root_numpy/src/converters.pyx" + /*else*/ { - /* "root_numpy/src/tree.pyx":55 - * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) - * leaflist = [] - * for ileaf in range(leaves.GetEntries()): # <<<<<<<<<<<<<< - * leaf = leaves.At(ileaf) - * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) + /* "root_numpy/src/converters.pyx":632 + * conv = new FixedNP2ROOTConverter(tree, name, 'C', dtype.itemsize, 1) + * else: + * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) # <<<<<<<<<<<<<< + * free(dims) + * return conv */ -#line 55 "root_numpy/src/tree.pyx" - __pyx_t_7 = __pyx_v_leaves->GetEntries(); +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 55 "root_numpy/src/tree.pyx" - for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 55 "root_numpy/src/tree.pyx" - __pyx_v_ileaf = __pyx_t_8; +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":56 - * leaflist = [] - * for ileaf in range(leaves.GetEntries()): - * leaf = leaves.At(ileaf) # <<<<<<<<<<<<<< - * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) - * if not leaflist: - */ +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 56 "root_numpy/src/tree.pyx" - __pyx_v_leaf = ((TLeaf *)__pyx_v_leaves->At(__pyx_v_ileaf)); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "root_numpy/src/tree.pyx":57 - * for ileaf in range(leaves.GetEntries()): - * leaf = leaves.At(ileaf) - * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) # <<<<<<<<<<<<<< - * if not leaflist: - * raise RuntimeError( - */ +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_converter_for_r_is_not_implement, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 57 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_leaf->GetTitle()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_11); -#line 57 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_16 = NULL; -#line 57 "root_numpy/src/tree.pyx" - __pyx_t_3 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_leaf->GetTypeName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) { -#line 57 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_11); -#line 57 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_16)) { -#line 57 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 632 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); -#line 57 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_16); -#line 57 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_INCREF(function); -#line 57 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_11, function); -#line 57 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 632 "root_numpy/src/converters.pyx" + } -#line 57 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 632 "root_numpy/src/converters.pyx" + } -#line 57 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 632 "root_numpy/src/converters.pyx" + if (!__pyx_t_16) { -#line 57 "root_numpy/src/tree.pyx" - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_leaflist, __pyx_t_6); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 57 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 57 "root_numpy/src/tree.pyx" - } +#line 632 "root_numpy/src/converters.pyx" + } else { - /* "root_numpy/src/tree.pyx":58 - * leaf = leaves.At(ileaf) - * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) - * if not leaflist: # <<<<<<<<<<<<<< - * raise RuntimeError( - * "leaf list for branch '{0}' is empty".format( - */ +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 58 "root_numpy/src/tree.pyx" - __pyx_t_1 = (__pyx_v_leaflist != Py_None) && (PyList_GET_SIZE(__pyx_v_leaflist) != 0); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_17); -#line 58 "root_numpy/src/tree.pyx" - __pyx_t_10 = ((!__pyx_t_1) != 0); +#line 632 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL; -#line 58 "root_numpy/src/tree.pyx" - if (__pyx_t_10) { +#line 632 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_v_dtype); - /* "root_numpy/src/tree.pyx":60 - * if not leaflist: - * raise RuntimeError( - * "leaf list for branch '{0}' is empty".format( # <<<<<<<<<<<<<< - * branch.GetName())) - * return leaflist - */ +#line 632 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_v_dtype); -#line 60 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_leaf_list_for_branch_0_is_empty, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_v_dtype); -#line 60 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":61 - * raise RuntimeError( - * "leaf list for branch '{0}' is empty".format( - * branch.GetName())) # <<<<<<<<<<<<<< - * return leaflist - * - */ +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; -#line 61 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 632 "root_numpy/src/converters.pyx" + } -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_4 = NULL; +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; -#line 61 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_11 = NULL; -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); +#line 632 "root_numpy/src/converters.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { -#line 61 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_4)) { +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1); -#line 61 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +#line 632 "root_numpy/src/converters.pyx" + if (likely(__pyx_t_11)) { -#line 61 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_4); +#line 632 "root_numpy/src/converters.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); -#line 61 "root_numpy/src/tree.pyx" +#line 632 "root_numpy/src/converters.pyx" + __Pyx_INCREF(__pyx_t_11); + +#line 632 "root_numpy/src/converters.pyx" __Pyx_INCREF(function); -#line 61 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_3, function); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF_SET(__pyx_t_1, function); -#line 61 "root_numpy/src/tree.pyx" +#line 632 "root_numpy/src/converters.pyx" } -#line 61 "root_numpy/src/tree.pyx" +#line 632 "root_numpy/src/converters.pyx" } -#line 61 "root_numpy/src/tree.pyx" - if (!__pyx_t_4) { +#line 632 "root_numpy/src/converters.pyx" + if (!__pyx_t_11) { -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 61 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 61 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 61 "root_numpy/src/tree.pyx" +#line 632 "root_numpy/src/converters.pyx" } else { -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 61 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_17); -#line 61 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; +#line 632 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL; -#line 61 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); +#line 632 "root_numpy/src/converters.pyx" + PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_5); -#line 61 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_t_5); -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_5 = 0; -#line 61 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 61 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 632 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 61 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0; -#line 61 "root_numpy/src/tree.pyx" +#line 632 "root_numpy/src/converters.pyx" } -#line 61 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "root_numpy/src/tree.pyx":59 - * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) - * if not leaflist: - * raise RuntimeError( # <<<<<<<<<<<<<< - * "leaf list for branch '{0}' is empty".format( - * branch.GetName())) - */ - -#line 59 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 59 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); - -#line 59 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - -#line 59 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_6); - -#line 59 "root_numpy/src/tree.pyx" - __pyx_t_6 = 0; - -#line 59 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 59 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); - -#line 59 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - -#line 59 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - -#line 59 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 59 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 632 "root_numpy/src/converters.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 59 "root_numpy/src/tree.pyx" +#line 632 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/tree.pyx":62 - * "leaf list for branch '{0}' is empty".format( - * branch.GetName())) - * return leaflist # <<<<<<<<<<<<<< - * - * +#line 632 "root_numpy/src/converters.pyx" + __pyx_L9:; + + /* "root_numpy/src/converters.pyx":633 + * else: + * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) + * free(dims) # <<<<<<<<<<<<<< + * return conv */ -#line 62 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 633 "root_numpy/src/converters.pyx" + free(__pyx_v_dims); -#line 62 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_leaflist); + /* "root_numpy/src/converters.pyx":634 + * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) + * free(dims) + * return conv # <<<<<<<<<<<<<< + */ -#line 62 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_v_leaflist; +#line 634 "root_numpy/src/converters.pyx" + __pyx_r = __pyx_v_conv; -#line 62 "root_numpy/src/tree.pyx" +#line 634 "root_numpy/src/converters.pyx" goto __pyx_L0; - /* "root_numpy/src/tree.pyx":47 + /* "root_numpy/src/converters.pyx":607 * * - * cdef get_branch_structure(TBranch* branch): # <<<<<<<<<<<<<< - * cdef TObjArray* leaves - * cdef TLeaf* leaf + * cdef NP2ROOTConverter* find_np2root_converter(TTree* tree, name, dtype): # <<<<<<<<<<<<<< + * # TODO: + * # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. */ -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" /* function exit code */ -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" __pyx_L1_error:; -#line 47 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); - -#line 47 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_1); -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_4); -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" __Pyx_XDECREF(__pyx_t_5); -#line 47 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_6); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_11); -#line 47 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.get_branch_structure", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_16); -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_t_17); + +#line 607 "root_numpy/src/converters.pyx" + __Pyx_WriteUnraisable("_librootnumpy.find_np2root_converter", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); + +#line 607 "root_numpy/src/converters.pyx" __pyx_r = 0; -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" __pyx_L0:; -#line 47 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_leaflist); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_subdtype); -#line 47 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_shape); -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_elembytes); + +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_roottype); + +#line 607 "root_numpy/src/converters.pyx" + __Pyx_XDECREF(__pyx_v_dtype); + +#line 607 "root_numpy/src/converters.pyx" __Pyx_RefNannyFinishContext(); -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" return __pyx_r; -#line 47 "root_numpy/src/tree.pyx" +#line 607 "root_numpy/src/converters.pyx" } -/* "root_numpy/src/tree.pyx":65 +/* "root_numpy/src/tree.pyx":4 * * - * cdef get_tree_structure(TTree* tree, branches=None): # <<<<<<<<<<<<<< - * cdef int ibranch - * cdef TBranch* branch + * def list_trees(fname): # <<<<<<<<<<<<<< + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: */ -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" -#line 65 "root_numpy/src/tree.pyx" -static PyObject *__pyx_f_13_librootnumpy_get_tree_structure(TTree *__pyx_v_tree, struct __pyx_opt_args_13_librootnumpy_get_tree_structure *__pyx_optional_args) { +#line 4 "root_numpy/src/tree.pyx" +/* Python wrapper */ -#line 65 "root_numpy/src/tree.pyx" - PyObject *__pyx_v_branches = ((PyObject *)Py_None); - int __pyx_v_ibranch -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_3list_trees(PyObject *__pyx_self, PyObject *__pyx_v_fname); /*proto*/ +static PyMethodDef __pyx_mdef_13_librootnumpy_3list_trees = +#line 4 "root_numpy/src/tree.pyx" +{"list_trees", (PyCFunction)__pyx_pw_13_librootnumpy_3list_trees, METH_O, 0}; + +#line 4 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_3list_trees(PyObject *__pyx_self, PyObject *__pyx_v_fname) { + +#line 4 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = 0; + +#line 4 "root_numpy/src/tree.pyx" + __Pyx_RefNannyDeclarations + +#line 4 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("list_trees (wrapper)", 0); + __pyx_r = +#line 4 "root_numpy/src/tree.pyx" +__pyx_pf_13_librootnumpy_2list_trees(__pyx_self, ((PyObject *)__pyx_v_fname)); + +#line 4 "root_numpy/src/tree.pyx" + + +#line 4 "root_numpy/src/tree.pyx" + /* function exit code */ + +#line 4 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); + +#line 4 "root_numpy/src/tree.pyx" + return __pyx_r; + +#line 4 "root_numpy/src/tree.pyx" +} + +#line 4 "root_numpy/src/tree.pyx" + + +#line 4 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pf_13_librootnumpy_2list_trees(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname) { + TFile *__pyx_v_rfile +#line 4 "root_numpy/src/tree.pyx" ; - TBranch *__pyx_v_branch -#line 65 "root_numpy/src/tree.pyx" + TList *__pyx_v_keys +#line 4 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_ret = NULL -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" ; - PyObject *__pyx_v_branch_name = NULL -#line 65 "root_numpy/src/tree.pyx" + int __pyx_v_nkeys +#line 4 "root_numpy/src/tree.pyx" ; - TObjArray *__pyx_v_all_branches -#line 65 "root_numpy/src/tree.pyx" + TKey *__pyx_v_key +#line 4 "root_numpy/src/tree.pyx" +; + int __pyx_v_i +#line 4 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_clsname = NULL +#line 4 "root_numpy/src/tree.pyx" ; -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + const char *__pyx_t_1; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - Py_ssize_t __pyx_t_6; - PyObject *(*__pyx_t_7)(PyObject *); - const char *__pyx_t_8; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; int __pyx_t_9; - int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 65 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("get_tree_structure", 0); +#line 4 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("list_trees", 0); -#line 65 "root_numpy/src/tree.pyx" - if (__pyx_optional_args) { + /* "root_numpy/src/tree.pyx":5 + * + * def list_trees(fname): + * cdef TFile* rfile = Open(fname, 'read') # <<<<<<<<<<<<<< + * if rfile == NULL: + * raise IOError("cannot read {0}".format(fname)) + */ -#line 65 "root_numpy/src/tree.pyx" - if (__pyx_optional_args->__pyx_n > 0) { +#line 5 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 65 "root_numpy/src/tree.pyx" - __pyx_v_branches = __pyx_optional_args->branches; +#line 5 "root_numpy/src/tree.pyx" + __pyx_v_rfile = TFile::Open(__pyx_t_1, __pyx_k_read); -#line 65 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":6 + * def list_trees(fname): + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: # <<<<<<<<<<<<<< + * raise IOError("cannot read {0}".format(fname)) + * cdef TList* keys = rfile.GetListOfKeys() + */ -#line 65 "root_numpy/src/tree.pyx" - } +#line 6 "root_numpy/src/tree.pyx" + __pyx_t_2 = ((__pyx_v_rfile == NULL) != 0); - /* "root_numpy/src/tree.pyx":68 - * cdef int ibranch - * cdef TBranch* branch - * ret = OrderedDict() # <<<<<<<<<<<<<< - * if branches is not None: - * for branch_name in branches: +#line 6 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/tree.pyx":7 + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: + * raise IOError("cannot read {0}".format(fname)) # <<<<<<<<<<<<<< + * cdef TList* keys = rfile.GetListOfKeys() + * if keys == NULL: */ -#line 68 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_read_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 68 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 68 "root_numpy/src/tree.pyx" - __pyx_t_3 = NULL; +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_5 = NULL; -#line 68 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { +#line 7 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { -#line 68 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); -#line 68 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_3)) { +#line 7 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_5)) { -#line 68 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); +#line 7 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); -#line 68 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_3); +#line 7 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_5); -#line 68 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 7 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 68 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_2, function); +#line 7 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_4, function); -#line 68 "root_numpy/src/tree.pyx" +#line 7 "root_numpy/src/tree.pyx" + } + +#line 7 "root_numpy/src/tree.pyx" } -#line 68 "root_numpy/src/tree.pyx" - } +#line 7 "root_numpy/src/tree.pyx" + if (!__pyx_t_5) { -#line 68 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 68 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 68 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 7 "root_numpy/src/tree.pyx" + } else { -#line 68 "root_numpy/src/tree.pyx" - } else { +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 68 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); -#line 68 "root_numpy/src/tree.pyx" - } +#line 7 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; -#line 68 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 7 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fname); -#line 68 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 7 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_fname); -#line 68 "root_numpy/src/tree.pyx" - __pyx_v_ret = __pyx_t_1; +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fname); -#line 68 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":69 - * cdef TBranch* branch - * ret = OrderedDict() - * if branches is not None: # <<<<<<<<<<<<<< - * for branch_name in branches: - * branch = tree.GetBranch(branch_name) - */ +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 69 "root_numpy/src/tree.pyx" - __pyx_t_4 = (__pyx_v_branches != Py_None); +#line 7 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 69 "root_numpy/src/tree.pyx" - __pyx_t_5 = (__pyx_t_4 != 0); +#line 7 "root_numpy/src/tree.pyx" + } -#line 69 "root_numpy/src/tree.pyx" - if (__pyx_t_5) { +#line 7 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "root_numpy/src/tree.pyx":70 - * ret = OrderedDict() - * if branches is not None: - * for branch_name in branches: # <<<<<<<<<<<<<< - * branch = tree.GetBranch(branch_name) - * if branch == NULL: - */ +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_v_branches)) || PyTuple_CheckExact(__pyx_v_branches)) { +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_1 = __pyx_v_branches; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; +#line 7 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_7 = NULL; +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_3); -#line 70 "root_numpy/src/tree.pyx" - } else { - __pyx_t_6 = -1; -#line 70 "root_numpy/src/tree.pyx" -__pyx_t_1 = PyObject_GetIter(__pyx_v_branches); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; -#line 70 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 7 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 7 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 70 "root_numpy/src/tree.pyx" - } +#line 7 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 70 "root_numpy/src/tree.pyx" - for (;;) { +#line 7 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_3, 0, 0, 0); -#line 70 "root_numpy/src/tree.pyx" - if (likely(!__pyx_t_7)) { +#line 7 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 70 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_1))) { +#line 7 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; +#line 7 "root_numpy/src/tree.pyx" + } -#line 70 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON + /* "root_numpy/src/tree.pyx":8 + * if rfile == NULL: + * raise IOError("cannot read {0}".format(fname)) + * cdef TList* keys = rfile.GetListOfKeys() # <<<<<<<<<<<<<< + * if keys == NULL: + * raise IOError("unable to get keys in {0}".format(fname)) + */ -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 8 "root_numpy/src/tree.pyx" + __pyx_v_keys = __pyx_v_rfile->GetListOfKeys(); -#line 70 "root_numpy/src/tree.pyx" - #else + /* "root_numpy/src/tree.pyx":9 + * raise IOError("cannot read {0}".format(fname)) + * cdef TList* keys = rfile.GetListOfKeys() + * if keys == NULL: # <<<<<<<<<<<<<< + * raise IOError("unable to get keys in {0}".format(fname)) + * ret = dict() + */ -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 9 "root_numpy/src/tree.pyx" + __pyx_t_2 = ((__pyx_v_keys == NULL) != 0); -#line 70 "root_numpy/src/tree.pyx" - #endif +#line 9 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { -#line 70 "root_numpy/src/tree.pyx" - } else { + /* "root_numpy/src/tree.pyx":10 + * cdef TList* keys = rfile.GetListOfKeys() + * if keys == NULL: + * raise IOError("unable to get keys in {0}".format(fname)) # <<<<<<<<<<<<<< + * ret = dict() + * cdef int nkeys = keys.GetEntries() + */ -#line 70 "root_numpy/src/tree.pyx" - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unable_to_get_keys_in_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_6 = NULL; -#line 70 "root_numpy/src/tree.pyx" - #else +#line 10 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) { -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); -#line 70 "root_numpy/src/tree.pyx" - #endif +#line 10 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_6)) { -#line 70 "root_numpy/src/tree.pyx" - } - } else -#line 70 "root_numpy/src/tree.pyx" -{ +#line 10 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_t_7(__pyx_t_1); +#line 10 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_6); -#line 70 "root_numpy/src/tree.pyx" - if (unlikely(!__pyx_t_2)) { +#line 10 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 70 "root_numpy/src/tree.pyx" - PyObject* exc_type = PyErr_Occurred(); +#line 10 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_4, function); -#line 70 "root_numpy/src/tree.pyx" - if (exc_type) { +#line 10 "root_numpy/src/tree.pyx" + } -#line 70 "root_numpy/src/tree.pyx" - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); +#line 10 "root_numpy/src/tree.pyx" + } -#line 70 "root_numpy/src/tree.pyx" - else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + if (!__pyx_t_6) { -#line 70 "root_numpy/src/tree.pyx" - } +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_fname); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - break; +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 70 "root_numpy/src/tree.pyx" - } +#line 10 "root_numpy/src/tree.pyx" + } else { -#line 70 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - } +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_5); -#line 70 "root_numpy/src/tree.pyx" - __Pyx_XDECREF_SET(__pyx_v_branch_name, __pyx_t_2); +#line 10 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL; -#line 70 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 10 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fname); - /* "root_numpy/src/tree.pyx":71 - * if branches is not None: - * for branch_name in branches: - * branch = tree.GetBranch(branch_name) # <<<<<<<<<<<<<< - * if branch == NULL: - * continue - */ +#line 10 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname); -#line 71 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_branch_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fname); -#line 71 "root_numpy/src/tree.pyx" - __pyx_v_branch = __pyx_v_tree->GetBranch(__pyx_t_8); +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":72 - * for branch_name in branches: - * branch = tree.GetBranch(branch_name) - * if branch == NULL: # <<<<<<<<<<<<<< - * continue - * ret[branch.GetName()] = get_branch_structure(branch) - */ +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 72 "root_numpy/src/tree.pyx" - __pyx_t_5 = ((__pyx_v_branch == NULL) != 0); +#line 10 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 72 "root_numpy/src/tree.pyx" - if (__pyx_t_5) { +#line 10 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":73 - * branch = tree.GetBranch(branch_name) - * if branch == NULL: - * continue # <<<<<<<<<<<<<< - * ret[branch.GetName()] = get_branch_structure(branch) - * return ret - */ +#line 10 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 73 "root_numpy/src/tree.pyx" - goto __pyx_L4_continue; +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 73 "root_numpy/src/tree.pyx" - } +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); - /* "root_numpy/src/tree.pyx":74 - * if branch == NULL: - * continue - * ret[branch.GetName()] = get_branch_structure(branch) # <<<<<<<<<<<<<< - * return ret - * # all branches - */ +#line 10 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 74 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_f_13_librootnumpy_get_branch_structure(__pyx_v_branch); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_3); -#line 74 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; -#line 74 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 74 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 10 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 74 "root_numpy/src/tree.pyx" - if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_t_3, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 10 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 74 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 10 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_3, 0, 0, 0); -#line 74 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 10 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "root_numpy/src/tree.pyx":70 - * ret = OrderedDict() - * if branches is not None: - * for branch_name in branches: # <<<<<<<<<<<<<< - * branch = tree.GetBranch(branch_name) - * if branch == NULL: +#line 10 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 10 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":11 + * if keys == NULL: + * raise IOError("unable to get keys in {0}".format(fname)) + * ret = dict() # <<<<<<<<<<<<<< + * cdef int nkeys = keys.GetEntries() + * cdef TKey* key */ -#line 70 "root_numpy/src/tree.pyx" - __pyx_L4_continue:; +#line 11 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 70 "root_numpy/src/tree.pyx" - } +#line 11 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 70 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 11 "root_numpy/src/tree.pyx" + __pyx_v_ret = ((PyObject*)__pyx_t_3); - /* "root_numpy/src/tree.pyx":75 - * continue - * ret[branch.GetName()] = get_branch_structure(branch) - * return ret # <<<<<<<<<<<<<< - * # all branches - * cdef TObjArray* all_branches = tree.GetListOfBranches() +#line 11 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; + + /* "root_numpy/src/tree.pyx":12 + * raise IOError("unable to get keys in {0}".format(fname)) + * ret = dict() + * cdef int nkeys = keys.GetEntries() # <<<<<<<<<<<<<< + * cdef TKey* key + * for i in range(nkeys): */ -#line 75 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 12 "root_numpy/src/tree.pyx" + __pyx_v_nkeys = __pyx_v_keys->GetEntries(); -#line 75 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_ret); + /* "root_numpy/src/tree.pyx":14 + * cdef int nkeys = keys.GetEntries() + * cdef TKey* key + * for i in range(nkeys): # <<<<<<<<<<<<<< + * key = keys.At(i) + * clsname = str(key.GetClassName()) + */ -#line 75 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_v_ret; +#line 14 "root_numpy/src/tree.pyx" + __pyx_t_7 = __pyx_v_nkeys; -#line 75 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 14 "root_numpy/src/tree.pyx" + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { -#line 75 "root_numpy/src/tree.pyx" - } +#line 14 "root_numpy/src/tree.pyx" + __pyx_v_i = __pyx_t_8; - /* "root_numpy/src/tree.pyx":77 - * return ret - * # all branches - * cdef TObjArray* all_branches = tree.GetListOfBranches() # <<<<<<<<<<<<<< - * if all_branches == NULL: - * return ret + /* "root_numpy/src/tree.pyx":15 + * cdef TKey* key + * for i in range(nkeys): + * key = keys.At(i) # <<<<<<<<<<<<<< + * clsname = str(key.GetClassName()) + * if clsname == 'TTree' or clsname == 'TNtuple': */ -#line 77 "root_numpy/src/tree.pyx" - __pyx_v_all_branches = __pyx_v_tree->GetListOfBranches(); +#line 15 "root_numpy/src/tree.pyx" + __pyx_v_key = ((TKey *)__pyx_v_keys->At(__pyx_v_i)); - /* "root_numpy/src/tree.pyx":78 - * # all branches - * cdef TObjArray* all_branches = tree.GetListOfBranches() - * if all_branches == NULL: # <<<<<<<<<<<<<< - * return ret - * for ibranch in range(all_branches.GetEntries()): + /* "root_numpy/src/tree.pyx":16 + * for i in range(nkeys): + * key = keys.At(i) + * clsname = str(key.GetClassName()) # <<<<<<<<<<<<<< + * if clsname == 'TTree' or clsname == 'TNtuple': + * ret[str(key.GetName())] = None */ -#line 78 "root_numpy/src/tree.pyx" - __pyx_t_5 = ((__pyx_v_all_branches == NULL) != 0); +#line 16 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_key->GetClassName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 78 "root_numpy/src/tree.pyx" - if (__pyx_t_5) { +#line 16 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); - /* "root_numpy/src/tree.pyx":79 - * cdef TObjArray* all_branches = tree.GetListOfBranches() - * if all_branches == NULL: - * return ret # <<<<<<<<<<<<<< - * for ibranch in range(all_branches.GetEntries()): - * branch = (all_branches.At(ibranch)) - */ +#line 16 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 79 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 16 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 79 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_ret); +#line 16 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); -#line 79 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_v_ret; +#line 16 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_3); -#line 79 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 16 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; -#line 79 "root_numpy/src/tree.pyx" - } +#line 16 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":80 - * if all_branches == NULL: - * return ret - * for ibranch in range(all_branches.GetEntries()): # <<<<<<<<<<<<<< - * branch = (all_branches.At(ibranch)) - * ret[branch.GetName()] = get_branch_structure(branch) - */ +#line 16 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 80 "root_numpy/src/tree.pyx" - __pyx_t_9 = __pyx_v_all_branches->GetEntries(); +#line 16 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 80 "root_numpy/src/tree.pyx" - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { +#line 16 "root_numpy/src/tree.pyx" + __Pyx_XDECREF_SET(__pyx_v_clsname, __pyx_t_3); -#line 80 "root_numpy/src/tree.pyx" - __pyx_v_ibranch = __pyx_t_10; +#line 16 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; - /* "root_numpy/src/tree.pyx":81 - * return ret - * for ibranch in range(all_branches.GetEntries()): - * branch = (all_branches.At(ibranch)) # <<<<<<<<<<<<<< - * ret[branch.GetName()] = get_branch_structure(branch) - * return ret + /* "root_numpy/src/tree.pyx":17 + * key = keys.At(i) + * clsname = str(key.GetClassName()) + * if clsname == 'TTree' or clsname == 'TNtuple': # <<<<<<<<<<<<<< + * ret[str(key.GetName())] = None + * rfile.Close() */ -#line 81 "root_numpy/src/tree.pyx" - __pyx_v_branch = ((TBranch *)__pyx_v_all_branches->At(__pyx_v_ibranch)); +#line 17 "root_numpy/src/tree.pyx" + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_clsname, __pyx_n_s_TTree, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":82 - * for ibranch in range(all_branches.GetEntries()): - * branch = (all_branches.At(ibranch)) - * ret[branch.GetName()] = get_branch_structure(branch) # <<<<<<<<<<<<<< - * return ret - * - */ +#line 17 "root_numpy/src/tree.pyx" + if (!__pyx_t_9) { -#line 82 "root_numpy/src/tree.pyx" - __pyx_t_1 = __pyx_f_13_librootnumpy_get_branch_structure(__pyx_v_branch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 17 "root_numpy/src/tree.pyx" + } else { -#line 82 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 17 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_t_9; -#line 82 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 17 "root_numpy/src/tree.pyx" + goto __pyx_L8_bool_binop_done; -#line 82 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 17 "root_numpy/src/tree.pyx" + } -#line 82 "root_numpy/src/tree.pyx" - if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_t_2, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 17 "root_numpy/src/tree.pyx" + __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_clsname, __pyx_n_s_TNtuple, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 82 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 17 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_t_9; -#line 82 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 17 "root_numpy/src/tree.pyx" + __pyx_L8_bool_binop_done:; -#line 82 "root_numpy/src/tree.pyx" +#line 17 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/tree.pyx":18 + * clsname = str(key.GetClassName()) + * if clsname == 'TTree' or clsname == 'TNtuple': + * ret[str(key.GetName())] = None # <<<<<<<<<<<<<< + * rfile.Close() + * del rfile + */ + +#line 18 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_key->GetName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 18 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 18 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 18 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); + +#line 18 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + +#line 18 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_3); + +#line 18 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; + +#line 18 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 18 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 18 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + +#line 18 "root_numpy/src/tree.pyx" + if (unlikely(PyDict_SetItem(__pyx_v_ret, __pyx_t_3, Py_None) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 18 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 18 "root_numpy/src/tree.pyx" + goto __pyx_L7; + +#line 18 "root_numpy/src/tree.pyx" + } + +#line 18 "root_numpy/src/tree.pyx" + __pyx_L7:; + +#line 18 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":83 - * branch = (all_branches.At(ibranch)) - * ret[branch.GetName()] = get_branch_structure(branch) - * return ret # <<<<<<<<<<<<<< + /* "root_numpy/src/tree.pyx":19 + * if clsname == 'TTree' or clsname == 'TNtuple': + * ret[str(key.GetName())] = None + * rfile.Close() # <<<<<<<<<<<<<< + * del rfile + * return list(ret.keys()) + */ + +#line 19 "root_numpy/src/tree.pyx" + __pyx_v_rfile->Close(); + + /* "root_numpy/src/tree.pyx":20 + * ret[str(key.GetName())] = None + * rfile.Close() + * del rfile # <<<<<<<<<<<<<< + * return list(ret.keys()) + * + */ + +#line 20 "root_numpy/src/tree.pyx" + delete __pyx_v_rfile; + + /* "root_numpy/src/tree.pyx":21 + * rfile.Close() + * del rfile + * return list(ret.keys()) # <<<<<<<<<<<<<< * * */ -#line 83 "root_numpy/src/tree.pyx" +#line 21 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_r); -#line 83 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_ret); +#line 21 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyDict_Keys(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 83 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_v_ret; +#line 21 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 83 "root_numpy/src/tree.pyx" +#line 21 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 21 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); + +#line 21 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); + +#line 21 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_3); + +#line 21 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; + +#line 21 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 21 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 21 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + +#line 21 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_t_3; + +#line 21 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; + +#line 21 "root_numpy/src/tree.pyx" goto __pyx_L0; - /* "root_numpy/src/tree.pyx":65 + /* "root_numpy/src/tree.pyx":4 * * - * cdef get_tree_structure(TTree* tree, branches=None): # <<<<<<<<<<<<<< - * cdef int ibranch - * cdef TBranch* branch + * def list_trees(fname): # <<<<<<<<<<<<<< + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: */ -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" /* function exit code */ -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" __pyx_L1_error:; -#line 65 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_1); +#line 4 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_3); -#line 65 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); +#line 4 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_4); -#line 65 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 4 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_5); -#line 65 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.get_tree_structure", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 4 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_6); -#line 65 "root_numpy/src/tree.pyx" - __pyx_r = 0; +#line 4 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.list_trees", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" + __pyx_r = NULL; + +#line 4 "root_numpy/src/tree.pyx" __pyx_L0:; -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_v_ret); -#line 65 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_branch_name); +#line 4 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_clsname); -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_r); -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" return __pyx_r; -#line 65 "root_numpy/src/tree.pyx" +#line 4 "root_numpy/src/tree.pyx" } -/* "root_numpy/src/tree.pyx":86 +/* "root_numpy/src/tree.pyx":24 * * - * cdef handle_load(int load, bool ignore_index=False): # <<<<<<<<<<<<<< - * if load >= 0: - * return + * def list_structures(fname, tree=None): # <<<<<<<<<<<<<< + * if tree == None: + * # automatically select single tree */ -#line 86 "root_numpy/src/tree.pyx" +#line 24 "root_numpy/src/tree.pyx" -#line 86 "root_numpy/src/tree.pyx" -static PyObject *__pyx_f_13_librootnumpy_handle_load(int __pyx_v_load, struct __pyx_opt_args_13_librootnumpy_handle_load *__pyx_optional_args) { +#line 24 "root_numpy/src/tree.pyx" +/* Python wrapper */ -#line 86 "root_numpy/src/tree.pyx" - bool __pyx_v_ignore_index = ((bool)0); +#line 24 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_5list_structures(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_13_librootnumpy_5list_structures = +#line 24 "root_numpy/src/tree.pyx" +{"list_structures", (PyCFunction)__pyx_pw_13_librootnumpy_5list_structures, METH_VARARGS|METH_KEYWORDS, 0}; -#line 86 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; +#line 24 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_5list_structures(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fname = 0 +#line 24 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_tree = 0 +#line 24 "root_numpy/src/tree.pyx" +; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 86 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("handle_load", 0); - -#line 86 "root_numpy/src/tree.pyx" - if (__pyx_optional_args) { - -#line 86 "root_numpy/src/tree.pyx" - if (__pyx_optional_args->__pyx_n > 0) { - -#line 86 "root_numpy/src/tree.pyx" - __pyx_v_ignore_index = __pyx_optional_args->ignore_index; - -#line 86 "root_numpy/src/tree.pyx" - } +#line 24 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = 0; -#line 86 "root_numpy/src/tree.pyx" - } +#line 24 "root_numpy/src/tree.pyx" + __Pyx_RefNannyDeclarations - /* "root_numpy/src/tree.pyx":87 - * - * cdef handle_load(int load, bool ignore_index=False): - * if load >= 0: # <<<<<<<<<<<<<< - * return - * if load == -1: - */ +#line 24 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("list_structures (wrapper)", 0); -#line 87 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_load >= 0) != 0); +#line 24 "root_numpy/src/tree.pyx" + { -#line 87 "root_numpy/src/tree.pyx" - if (__pyx_t_1) { +#line 24 "root_numpy/src/tree.pyx" + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fname,&__pyx_n_s_tree,0}; - /* "root_numpy/src/tree.pyx":88 - * cdef handle_load(int load, bool ignore_index=False): - * if load >= 0: - * return # <<<<<<<<<<<<<< - * if load == -1: - * raise ValueError("chain is empty") - */ +#line 24 "root_numpy/src/tree.pyx" + PyObject* values[2] = {0,0}; -#line 88 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 24 "root_numpy/src/tree.pyx" + values[1] = ((PyObject *)Py_None); -#line 88 "root_numpy/src/tree.pyx" - __pyx_r = Py_None; __Pyx_INCREF(Py_None); +#line 24 "root_numpy/src/tree.pyx" + if (unlikely(__pyx_kwds)) { -#line 88 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 24 "root_numpy/src/tree.pyx" + Py_ssize_t kw_args; -#line 88 "root_numpy/src/tree.pyx" - } +#line 24 "root_numpy/src/tree.pyx" + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - /* "root_numpy/src/tree.pyx":97 - * elif load == -3: - * raise IOError("cannot open current file") - * elif load == -4: # <<<<<<<<<<<<<< - * raise IOError("cannot access tree in current file") - * raise RuntimeError("the chain is not initialized") - */ +#line 24 "root_numpy/src/tree.pyx" + switch (pos_args) { + case 2: +#line 24 "root_numpy/src/tree.pyx" +values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: +#line 24 "root_numpy/src/tree.pyx" +values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 97 "root_numpy/src/tree.pyx" - switch (__pyx_v_load) { +#line 24 "root_numpy/src/tree.pyx" + case 0: break; + default: +#line 24 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; - /* "root_numpy/src/tree.pyx":89 - * if load >= 0: - * return - * if load == -1: # <<<<<<<<<<<<<< - * raise ValueError("chain is empty") - * elif load == -2: - */ +#line 24 "root_numpy/src/tree.pyx" + } -#line 89 "root_numpy/src/tree.pyx" - case -1: +#line 24 "root_numpy/src/tree.pyx" + kw_args = PyDict_Size(__pyx_kwds); - /* "root_numpy/src/tree.pyx":90 - * return - * if load == -1: - * raise ValueError("chain is empty") # <<<<<<<<<<<<<< - * elif load == -2: - * if ignore_index: - */ +#line 24 "root_numpy/src/tree.pyx" + switch (pos_args) { -#line 90 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 24 "root_numpy/src/tree.pyx" + case 0: -#line 90 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 24 "root_numpy/src/tree.pyx" + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--; + else +#line 24 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; -#line 90 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 24 "root_numpy/src/tree.pyx" + case 1: -#line 90 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 24 "root_numpy/src/tree.pyx" + if (kw_args > 0) { -#line 90 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 24 "root_numpy/src/tree.pyx" + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree); -#line 90 "root_numpy/src/tree.pyx" - break; +#line 24 "root_numpy/src/tree.pyx" + if (value) { values[1] = value; kw_args--; } - /* "root_numpy/src/tree.pyx":91 - * if load == -1: - * raise ValueError("chain is empty") - * elif load == -2: # <<<<<<<<<<<<<< - * if ignore_index: - * return - */ +#line 24 "root_numpy/src/tree.pyx" + } -#line 91 "root_numpy/src/tree.pyx" - case -2: +#line 24 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":92 - * raise ValueError("chain is empty") - * elif load == -2: - * if ignore_index: # <<<<<<<<<<<<<< - * return - * raise IndexError("tree index in chain is out of bounds") - */ +#line 24 "root_numpy/src/tree.pyx" + if (unlikely(kw_args > 0)) { -#line 92 "root_numpy/src/tree.pyx" - __pyx_t_1 = (__pyx_v_ignore_index != 0); +#line 24 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_structures") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 92 "root_numpy/src/tree.pyx" - if (__pyx_t_1) { +#line 24 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":93 - * elif load == -2: - * if ignore_index: - * return # <<<<<<<<<<<<<< - * raise IndexError("tree index in chain is out of bounds") - * elif load == -3: - */ +#line 24 "root_numpy/src/tree.pyx" + } else { -#line 93 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 24 "root_numpy/src/tree.pyx" + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: +#line 24 "root_numpy/src/tree.pyx" +values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: +#line 24 "root_numpy/src/tree.pyx" +values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 93 "root_numpy/src/tree.pyx" - __pyx_r = Py_None; __Pyx_INCREF(Py_None); +#line 24 "root_numpy/src/tree.pyx" + break; + default: +#line 24 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; -#line 93 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 24 "root_numpy/src/tree.pyx" + } -#line 93 "root_numpy/src/tree.pyx" +#line 24 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":94 - * if ignore_index: - * return - * raise IndexError("tree index in chain is out of bounds") # <<<<<<<<<<<<<< - * elif load == -3: - * raise IOError("cannot open current file") - */ +#line 24 "root_numpy/src/tree.pyx" + __pyx_v_fname = values[0]; -#line 94 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 24 "root_numpy/src/tree.pyx" + __pyx_v_tree = values[1]; -#line 94 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 24 "root_numpy/src/tree.pyx" + } -#line 94 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 24 "root_numpy/src/tree.pyx" + goto __pyx_L4_argument_unpacking_done; -#line 94 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 24 "root_numpy/src/tree.pyx" + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_structures", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); +#line 24 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 94 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 24 "root_numpy/src/tree.pyx" + __pyx_L3_error:; -#line 94 "root_numpy/src/tree.pyx" - break; +#line 24 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.list_structures", __pyx_clineno, __pyx_lineno, __pyx_filename); - /* "root_numpy/src/tree.pyx":95 - * return - * raise IndexError("tree index in chain is out of bounds") - * elif load == -3: # <<<<<<<<<<<<<< - * raise IOError("cannot open current file") - * elif load == -4: - */ +#line 24 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 95 "root_numpy/src/tree.pyx" - case -3: +#line 24 "root_numpy/src/tree.pyx" + return NULL; - /* "root_numpy/src/tree.pyx":96 - * raise IndexError("tree index in chain is out of bounds") - * elif load == -3: - * raise IOError("cannot open current file") # <<<<<<<<<<<<<< - * elif load == -4: - * raise IOError("cannot access tree in current file") - */ +#line 24 "root_numpy/src/tree.pyx" + __pyx_L4_argument_unpacking_done:; + __pyx_r = +#line 24 "root_numpy/src/tree.pyx" +__pyx_pf_13_librootnumpy_4list_structures(__pyx_self, __pyx_v_fname, __pyx_v_tree); -#line 96 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 24 "root_numpy/src/tree.pyx" -#line 96 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); -#line 96 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 24 "root_numpy/src/tree.pyx" + /* function exit code */ -#line 96 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 24 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 96 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 24 "root_numpy/src/tree.pyx" + return __pyx_r; -#line 96 "root_numpy/src/tree.pyx" - break; +#line 24 "root_numpy/src/tree.pyx" +} - /* "root_numpy/src/tree.pyx":97 - * elif load == -3: - * raise IOError("cannot open current file") - * elif load == -4: # <<<<<<<<<<<<<< - * raise IOError("cannot access tree in current file") - * raise RuntimeError("the chain is not initialized") - */ +#line 24 "root_numpy/src/tree.pyx" -#line 97 "root_numpy/src/tree.pyx" - case -4: - /* "root_numpy/src/tree.pyx":98 - * raise IOError("cannot open current file") - * elif load == -4: - * raise IOError("cannot access tree in current file") # <<<<<<<<<<<<<< - * raise RuntimeError("the chain is not initialized") +#line 24 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pf_13_librootnumpy_4list_structures(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname, PyObject *__pyx_v_tree) { + TFile *__pyx_v_rfile +#line 24 "root_numpy/src/tree.pyx" +; + TTree *__pyx_v_rtree +#line 24 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_structure = NULL +#line 24 "root_numpy/src/tree.pyx" +; + +#line 24 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + Py_ssize_t __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + const char *__pyx_t_8; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("list_structures", 0); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_tree); + + /* "root_numpy/src/tree.pyx":25 + * + * def list_structures(fname, tree=None): + * if tree == None: # <<<<<<<<<<<<<< + * # automatically select single tree + * tree = list_trees(fname) + */ + +#line 25 "root_numpy/src/tree.pyx" + __pyx_t_1 = PyObject_RichCompare(__pyx_v_tree, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 25 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 25 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 25 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/tree.pyx":27 + * if tree == None: + * # automatically select single tree + * tree = list_trees(fname) # <<<<<<<<<<<<<< + * if len(tree) != 1: + * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) + */ + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_trees); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_4 = NULL; + +#line 27 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + +#line 27 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_4)) { + +#line 27 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_4); + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 27 "root_numpy/src/tree.pyx" + } + +#line 27 "root_numpy/src/tree.pyx" + } + +#line 27 "root_numpy/src/tree.pyx" + if (!__pyx_t_4) { + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_fname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 27 "root_numpy/src/tree.pyx" + } else { + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_5); + +#line 27 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fname); + +#line 27 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname); + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fname); + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 27 "root_numpy/src/tree.pyx" + } + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 27 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_v_tree, __pyx_t_1); + +#line 27 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + + /* "root_numpy/src/tree.pyx":28 + * # automatically select single tree + * tree = list_trees(fname) + * if len(tree) != 1: # <<<<<<<<<<<<<< + * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) + * tree = tree[0] + */ + +#line 28 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyObject_Length(__pyx_v_tree); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 28 "root_numpy/src/tree.pyx" + __pyx_t_2 = ((__pyx_t_6 != 1) != 0); + +#line 28 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/tree.pyx":29 + * tree = list_trees(fname) + * if len(tree) != 1: + * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) # <<<<<<<<<<<<<< + * tree = tree[0] + * cdef TFile* rfile = Open(fname, 'read') + */ + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_multiple_trees_found_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__12, __pyx_v_tree); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_5); + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_4 = NULL; + +#line 29 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + +#line 29 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_4)) { + +#line 29 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_4); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 29 "root_numpy/src/tree.pyx" + } + +#line 29 "root_numpy/src/tree.pyx" + } + +#line 29 "root_numpy/src/tree.pyx" + if (!__pyx_t_4) { + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 29 "root_numpy/src/tree.pyx" + } else { + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_7); + +#line 29 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + +#line 29 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_5); + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_5 = 0; + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + +#line 29 "root_numpy/src/tree.pyx" + } + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 29 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_1); + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + +#line 29 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + +#line 29 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 29 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 29 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":30 + * if len(tree) != 1: + * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) + * tree = tree[0] # <<<<<<<<<<<<<< + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: + */ + +#line 30 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_tree, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; + +#line 30 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 30 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_v_tree, __pyx_t_1); + +#line 30 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + +#line 30 "root_numpy/src/tree.pyx" + goto __pyx_L3; + +#line 30 "root_numpy/src/tree.pyx" + } + +#line 30 "root_numpy/src/tree.pyx" + __pyx_L3:; + + /* "root_numpy/src/tree.pyx":31 + * raise ValueError("multiple trees found: {0}".format(', '.join(tree))) + * tree = tree[0] + * cdef TFile* rfile = Open(fname, 'read') # <<<<<<<<<<<<<< + * if rfile == NULL: + * raise IOError("cannot read {0}".format(fname)) + */ + +#line 31 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_fname); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 31 "root_numpy/src/tree.pyx" + __pyx_v_rfile = TFile::Open(__pyx_t_8, __pyx_k_read); + + /* "root_numpy/src/tree.pyx":32 + * tree = tree[0] + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: # <<<<<<<<<<<<<< + * raise IOError("cannot read {0}".format(fname)) + * cdef TTree* rtree = rfile.Get(tree) + */ + +#line 32 "root_numpy/src/tree.pyx" + __pyx_t_2 = ((__pyx_v_rfile == NULL) != 0); + +#line 32 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/tree.pyx":33 + * cdef TFile* rfile = Open(fname, 'read') + * if rfile == NULL: + * raise IOError("cannot read {0}".format(fname)) # <<<<<<<<<<<<<< + * cdef TTree* rtree = rfile.Get(tree) + * if rtree == NULL: + */ + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_read_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_7 = NULL; + +#line 33 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + +#line 33 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_7)) { + +#line 33 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_7); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 33 "root_numpy/src/tree.pyx" + } + +#line 33 "root_numpy/src/tree.pyx" + } + +#line 33 "root_numpy/src/tree.pyx" + if (!__pyx_t_7) { + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_fname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 33 "root_numpy/src/tree.pyx" + } else { + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_5); + +#line 33 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL; + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fname); + +#line 33 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_fname); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fname); + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 33 "root_numpy/src/tree.pyx" + } + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 33 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_1); + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + +#line 33 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + +#line 33 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 33 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 33 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":34 + * if rfile == NULL: + * raise IOError("cannot read {0}".format(fname)) + * cdef TTree* rtree = rfile.Get(tree) # <<<<<<<<<<<<<< + * if rtree == NULL: + * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) + */ + +#line 34 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_tree); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 34 "root_numpy/src/tree.pyx" + __pyx_v_rtree = ((TTree *)__pyx_v_rfile->Get(__pyx_t_8)); + + /* "root_numpy/src/tree.pyx":35 + * raise IOError("cannot read {0}".format(fname)) + * cdef TTree* rtree = rfile.Get(tree) + * if rtree == NULL: # <<<<<<<<<<<<<< + * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) + * structure = get_tree_structure(rtree) + */ + +#line 35 "root_numpy/src/tree.pyx" + __pyx_t_2 = ((__pyx_v_rtree == NULL) != 0); + +#line 35 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + + /* "root_numpy/src/tree.pyx":36 + * cdef TTree* rtree = rfile.Get(tree) + * if rtree == NULL: + * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) # <<<<<<<<<<<<<< + * structure = get_tree_structure(rtree) + * rfile.Close() + */ + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_tree_0_not_found_in_1, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_5 = NULL; + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_6 = 0; + +#line 36 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + +#line 36 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_5)) { + +#line 36 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_5); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_6 = 1; + +#line 36 "root_numpy/src/tree.pyx" + } + +#line 36 "root_numpy/src/tree.pyx" + } + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_7); + +#line 36 "root_numpy/src/tree.pyx" + if (__pyx_t_5) { + +#line 36 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; + +#line 36 "root_numpy/src/tree.pyx" + } + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_tree); + +#line 36 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_tree); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_tree); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fname); + +#line 36 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_fname); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fname); + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 36 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_1); + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + +#line 36 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + +#line 36 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + +#line 36 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 36 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":37 + * if rtree == NULL: + * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) + * structure = get_tree_structure(rtree) # <<<<<<<<<<<<<< + * rfile.Close() + * del rfile + */ + +#line 37 "root_numpy/src/tree.pyx" + __pyx_t_1 = __pyx_f_13_librootnumpy_get_tree_structure(__pyx_v_rtree, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 37 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 37 "root_numpy/src/tree.pyx" + __pyx_v_structure = __pyx_t_1; + +#line 37 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + + /* "root_numpy/src/tree.pyx":38 + * raise IOError("tree '{0}' not found in {1}".format(tree, fname)) + * structure = get_tree_structure(rtree) + * rfile.Close() # <<<<<<<<<<<<<< + * del rfile + * return structure + */ + +#line 38 "root_numpy/src/tree.pyx" + __pyx_v_rfile->Close(); + + /* "root_numpy/src/tree.pyx":39 + * structure = get_tree_structure(rtree) + * rfile.Close() + * del rfile # <<<<<<<<<<<<<< + * return structure + * + */ + +#line 39 "root_numpy/src/tree.pyx" + delete __pyx_v_rfile; + + /* "root_numpy/src/tree.pyx":40 + * rfile.Close() + * del rfile + * return structure # <<<<<<<<<<<<<< + * + * + */ + +#line 40 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); + +#line 40 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_structure); + +#line 40 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_v_structure; + +#line 40 "root_numpy/src/tree.pyx" + goto __pyx_L0; + + /* "root_numpy/src/tree.pyx":24 + * + * + * def list_structures(fname, tree=None): # <<<<<<<<<<<<<< + * if tree == None: + * # automatically select single tree + */ + +#line 24 "root_numpy/src/tree.pyx" + + +#line 24 "root_numpy/src/tree.pyx" + /* function exit code */ + +#line 24 "root_numpy/src/tree.pyx" + __pyx_L1_error:; + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_1); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_3); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_4); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_5); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_7); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.list_structures", __pyx_clineno, __pyx_lineno, __pyx_filename); + +#line 24 "root_numpy/src/tree.pyx" + __pyx_r = NULL; + +#line 24 "root_numpy/src/tree.pyx" + __pyx_L0:; + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_structure); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_tree); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); + +#line 24 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); + +#line 24 "root_numpy/src/tree.pyx" + return __pyx_r; + +#line 24 "root_numpy/src/tree.pyx" +} + +/* "root_numpy/src/tree.pyx":43 + * + * + * def list_branches(fname, tree=None): # <<<<<<<<<<<<<< + * return list(list_structures(fname, tree).keys()) + * + */ + +#line 43 "root_numpy/src/tree.pyx" + + +#line 43 "root_numpy/src/tree.pyx" +/* Python wrapper */ + +#line 43 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_7list_branches(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_13_librootnumpy_7list_branches = +#line 43 "root_numpy/src/tree.pyx" +{"list_branches", (PyCFunction)__pyx_pw_13_librootnumpy_7list_branches, METH_VARARGS|METH_KEYWORDS, 0}; + +#line 43 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_7list_branches(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fname = 0 +#line 43 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_tree = 0 +#line 43 "root_numpy/src/tree.pyx" +; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + +#line 43 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = 0; + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_RefNannyDeclarations + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("list_branches (wrapper)", 0); + +#line 43 "root_numpy/src/tree.pyx" + { + +#line 43 "root_numpy/src/tree.pyx" + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fname,&__pyx_n_s_tree,0}; + +#line 43 "root_numpy/src/tree.pyx" + PyObject* values[2] = {0,0}; + +#line 43 "root_numpy/src/tree.pyx" + values[1] = ((PyObject *)Py_None); + +#line 43 "root_numpy/src/tree.pyx" + if (unlikely(__pyx_kwds)) { + +#line 43 "root_numpy/src/tree.pyx" + Py_ssize_t kw_args; + +#line 43 "root_numpy/src/tree.pyx" + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + +#line 43 "root_numpy/src/tree.pyx" + switch (pos_args) { + case 2: +#line 43 "root_numpy/src/tree.pyx" +values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: +#line 43 "root_numpy/src/tree.pyx" +values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + +#line 43 "root_numpy/src/tree.pyx" + case 0: break; + default: +#line 43 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + kw_args = PyDict_Size(__pyx_kwds); + +#line 43 "root_numpy/src/tree.pyx" + switch (pos_args) { + +#line 43 "root_numpy/src/tree.pyx" + case 0: + +#line 43 "root_numpy/src/tree.pyx" + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--; + else +#line 43 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; + +#line 43 "root_numpy/src/tree.pyx" + case 1: + +#line 43 "root_numpy/src/tree.pyx" + if (kw_args > 0) { + +#line 43 "root_numpy/src/tree.pyx" + PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree); + +#line 43 "root_numpy/src/tree.pyx" + if (value) { values[1] = value; kw_args--; } + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + if (unlikely(kw_args > 0)) { + +#line 43 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_branches") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + } else { + +#line 43 "root_numpy/src/tree.pyx" + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: +#line 43 "root_numpy/src/tree.pyx" +values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: +#line 43 "root_numpy/src/tree.pyx" +values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + +#line 43 "root_numpy/src/tree.pyx" + break; + default: +#line 43 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + __pyx_v_fname = values[0]; + +#line 43 "root_numpy/src/tree.pyx" + __pyx_v_tree = values[1]; + +#line 43 "root_numpy/src/tree.pyx" + } + +#line 43 "root_numpy/src/tree.pyx" + goto __pyx_L4_argument_unpacking_done; + +#line 43 "root_numpy/src/tree.pyx" + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("list_branches", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); +#line 43 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + +#line 43 "root_numpy/src/tree.pyx" + __pyx_L3_error:; + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.list_branches", __pyx_clineno, __pyx_lineno, __pyx_filename); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); + +#line 43 "root_numpy/src/tree.pyx" + return NULL; + +#line 43 "root_numpy/src/tree.pyx" + __pyx_L4_argument_unpacking_done:; + __pyx_r = +#line 43 "root_numpy/src/tree.pyx" +__pyx_pf_13_librootnumpy_6list_branches(__pyx_self, __pyx_v_fname, __pyx_v_tree); + +#line 43 "root_numpy/src/tree.pyx" + + +#line 43 "root_numpy/src/tree.pyx" + /* function exit code */ + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); + +#line 43 "root_numpy/src/tree.pyx" + return __pyx_r; + +#line 43 "root_numpy/src/tree.pyx" +} + +#line 43 "root_numpy/src/tree.pyx" + + +#line 43 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pf_13_librootnumpy_6list_branches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fname, PyObject *__pyx_v_tree) { + +#line 43 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + Py_ssize_t __pyx_t_5; + PyObject *__pyx_t_6 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("list_branches", 0); + + /* "root_numpy/src/tree.pyx":44 + * + * def list_branches(fname, tree=None): + * return list(list_structures(fname, tree).keys()) # <<<<<<<<<<<<<< + * + * + */ + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_structures); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_4 = NULL; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_5 = 0; + +#line 44 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) { + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_4)) { + +#line 44 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_4); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_5 = 1; + +#line 44 "root_numpy/src/tree.pyx" + } + +#line 44 "root_numpy/src/tree.pyx" + } + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); + +#line 44 "root_numpy/src/tree.pyx" + if (__pyx_t_4) { + +#line 44 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + +#line 44 "root_numpy/src/tree.pyx" + } + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fname); + +#line 44 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_fname); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fname); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_tree); + +#line 44 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_tree); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_tree); + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_keys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_2 = NULL; + +#line 44 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_2)) { + +#line 44 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_2); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 44 "root_numpy/src/tree.pyx" + } + +#line 44 "root_numpy/src/tree.pyx" + } + +#line 44 "root_numpy/src/tree.pyx" + if (__pyx_t_2) { + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 44 "root_numpy/src/tree.pyx" + } else { + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + } + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 44 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_1); + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); + +#line 44 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_t_1; + +#line 44 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; + +#line 44 "root_numpy/src/tree.pyx" + goto __pyx_L0; + + /* "root_numpy/src/tree.pyx":43 + * + * + * def list_branches(fname, tree=None): # <<<<<<<<<<<<<< + * return list(list_structures(fname, tree).keys()) + * + */ + +#line 43 "root_numpy/src/tree.pyx" + + +#line 43 "root_numpy/src/tree.pyx" + /* function exit code */ + +#line 43 "root_numpy/src/tree.pyx" + __pyx_L1_error:; + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_1); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_2); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_3); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_4); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_6); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.list_branches", __pyx_clineno, __pyx_lineno, __pyx_filename); + +#line 43 "root_numpy/src/tree.pyx" + __pyx_r = NULL; + +#line 43 "root_numpy/src/tree.pyx" + __pyx_L0:; + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); + +#line 43 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); + +#line 43 "root_numpy/src/tree.pyx" + return __pyx_r; + +#line 43 "root_numpy/src/tree.pyx" +} + +/* "root_numpy/src/tree.pyx":47 * + * + * cdef get_branch_structure(TBranch* branch): # <<<<<<<<<<<<<< + * cdef TObjArray* leaves + * cdef TLeaf* leaf + */ + +#line 47 "root_numpy/src/tree.pyx" + + +#line 47 "root_numpy/src/tree.pyx" +static PyObject *__pyx_f_13_librootnumpy_get_branch_structure(TBranch *__pyx_v_branch) { + TObjArray *__pyx_v_leaves +#line 47 "root_numpy/src/tree.pyx" +; + TLeaf *__pyx_v_leaf +#line 47 "root_numpy/src/tree.pyx" +; + int __pyx_v_ileaf +#line 47 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_leaflist = NULL +#line 47 "root_numpy/src/tree.pyx" +; + +#line 47 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; + int __pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + +#line 47 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("get_branch_structure", 0); + + /* "root_numpy/src/tree.pyx":51 + * cdef TLeaf* leaf + * cdef int ileaf + * leaves = branch.GetListOfLeaves() # <<<<<<<<<<<<<< + * if leaves == NULL: + * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) + */ + +#line 51 "root_numpy/src/tree.pyx" + __pyx_v_leaves = __pyx_v_branch->GetListOfLeaves(); + + /* "root_numpy/src/tree.pyx":52 + * cdef int ileaf + * leaves = branch.GetListOfLeaves() + * if leaves == NULL: # <<<<<<<<<<<<<< + * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) + * leaflist = [] + */ + +#line 52 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_leaves == NULL) != 0); + +#line 52 "root_numpy/src/tree.pyx" + if (__pyx_t_1) { + + /* "root_numpy/src/tree.pyx":53 + * leaves = branch.GetListOfLeaves() + * if leaves == NULL: + * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) # <<<<<<<<<<<<<< + * leaflist = [] + * for ileaf in range(leaves.GetEntries()): + */ + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_branch_0_has_no_leaves, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_5 = NULL; + +#line 53 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); + +#line 53 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_5)) { + +#line 53 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_5); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); + +#line 53 "root_numpy/src/tree.pyx" + } + +#line 53 "root_numpy/src/tree.pyx" + } + +#line 53 "root_numpy/src/tree.pyx" + if (!__pyx_t_5) { + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 53 "root_numpy/src/tree.pyx" + } else { + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); + +#line 53 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL; + +#line 53 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_4); + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + +#line 53 "root_numpy/src/tree.pyx" + } + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + +#line 53 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; + +#line 53 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); + +#line 53 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 53 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 53 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":54 + * if leaves == NULL: + * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) + * leaflist = [] # <<<<<<<<<<<<<< + * for ileaf in range(leaves.GetEntries()): + * leaf = leaves.At(ileaf) */ -#line 98 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 54 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 98 "root_numpy/src/tree.pyx" +#line 54 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 54 "root_numpy/src/tree.pyx" + __pyx_v_leaflist = ((PyObject*)__pyx_t_2); + +#line 54 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; + + /* "root_numpy/src/tree.pyx":55 + * raise RuntimeError("branch '{0}' has no leaves".format(branch.GetName())) + * leaflist = [] + * for ileaf in range(leaves.GetEntries()): # <<<<<<<<<<<<<< + * leaf = leaves.At(ileaf) + * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) + */ + +#line 55 "root_numpy/src/tree.pyx" + __pyx_t_7 = __pyx_v_leaves->GetEntries(); + +#line 55 "root_numpy/src/tree.pyx" + for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { + +#line 55 "root_numpy/src/tree.pyx" + __pyx_v_ileaf = __pyx_t_8; + + /* "root_numpy/src/tree.pyx":56 + * leaflist = [] + * for ileaf in range(leaves.GetEntries()): + * leaf = leaves.At(ileaf) # <<<<<<<<<<<<<< + * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) + * if not leaflist: + */ + +#line 56 "root_numpy/src/tree.pyx" + __pyx_v_leaf = ((TLeaf *)__pyx_v_leaves->At(__pyx_v_ileaf)); + + /* "root_numpy/src/tree.pyx":57 + * for ileaf in range(leaves.GetEntries()): + * leaf = leaves.At(ileaf) + * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) # <<<<<<<<<<<<<< + * if not leaflist: + * raise RuntimeError( + */ + +#line 57 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_leaf->GetTitle()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 57 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_2); -#line 98 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 57 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_leaf->GetTypeName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 98 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 57 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 98 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 57 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 98 "root_numpy/src/tree.pyx" - break; +#line 57 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); -#line 98 "root_numpy/src/tree.pyx" - default: break; +#line 57 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); -#line 98 "root_numpy/src/tree.pyx" +#line 57 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); + +#line 57 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + +#line 57 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_3); + +#line 57 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; + +#line 57 "root_numpy/src/tree.pyx" + __pyx_t_3 = 0; + +#line 57 "root_numpy/src/tree.pyx" + __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_leaflist, __pyx_t_6); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 57 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + +#line 57 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":99 - * elif load == -4: - * raise IOError("cannot access tree in current file") - * raise RuntimeError("the chain is not initialized") # <<<<<<<<<<<<<< - * - * + /* "root_numpy/src/tree.pyx":58 + * leaf = leaves.At(ileaf) + * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) + * if not leaflist: # <<<<<<<<<<<<<< + * raise RuntimeError( + * "leaf list for branch '{0}' is empty".format( */ -#line 99 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 58 "root_numpy/src/tree.pyx" + __pyx_t_1 = (__pyx_v_leaflist != Py_None) && (PyList_GET_SIZE(__pyx_v_leaflist) != 0); -#line 99 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 58 "root_numpy/src/tree.pyx" + __pyx_t_10 = ((!__pyx_t_1) != 0); -#line 99 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 58 "root_numpy/src/tree.pyx" + if (__pyx_t_10) { -#line 99 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "root_numpy/src/tree.pyx":60 + * if not leaflist: + * raise RuntimeError( + * "leaf list for branch '{0}' is empty".format( # <<<<<<<<<<<<<< + * branch.GetName())) + * return leaflist + */ -#line 99 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 60 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_leaf_list_for_branch_0_is_empty, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":86 - * +#line 60 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); + + /* "root_numpy/src/tree.pyx":61 + * raise RuntimeError( + * "leaf list for branch '{0}' is empty".format( + * branch.GetName())) # <<<<<<<<<<<<<< + * return leaflist * - * cdef handle_load(int load, bool ignore_index=False): # <<<<<<<<<<<<<< - * if load >= 0: - * return */ -#line 86 "root_numpy/src/tree.pyx" +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 61 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 86 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_4 = NULL; -#line 86 "root_numpy/src/tree.pyx" - __pyx_L1_error:; +#line 61 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { -#line 86 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); -#line 86 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.handle_load", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 61 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_4)) { -#line 86 "root_numpy/src/tree.pyx" - __pyx_r = 0; +#line 61 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); -#line 86 "root_numpy/src/tree.pyx" - __pyx_L0:; +#line 61 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_4); -#line 86 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 61 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 86 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 61 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_3, function); -#line 86 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 61 "root_numpy/src/tree.pyx" + } -#line 86 "root_numpy/src/tree.pyx" -} +#line 61 "root_numpy/src/tree.pyx" + } -/* "root_numpy/src/tree.pyx":102 - * - * - * cdef object tree2array(TTree* tree, branches, string selection, # <<<<<<<<<<<<<< - * start, stop, step, - * bool include_weight, string weight_name): +#line 61 "root_numpy/src/tree.pyx" + if (!__pyx_t_4) { + +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); + +#line 61 "root_numpy/src/tree.pyx" + } else { + +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_5); + +#line 61 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL; + +#line 61 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2); + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); + +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; + +#line 61 "root_numpy/src/tree.pyx" + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + +#line 61 "root_numpy/src/tree.pyx" + } + +#line 61 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "root_numpy/src/tree.pyx":59 + * leaflist.append((leaf.GetTitle(), resolve_type(leaf.GetTypeName()))) + * if not leaflist: + * raise RuntimeError( # <<<<<<<<<<<<<< + * "leaf list for branch '{0}' is empty".format( + * branch.GetName())) */ -#line 102 "root_numpy/src/tree.pyx" +#line 59 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 59 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 102 "root_numpy/src/tree.pyx" -static PyObject *__pyx_f_13_librootnumpy_tree2array(TTree *__pyx_v_tree, PyObject *__pyx_v_branches, std::string __pyx_v_selection, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, bool __pyx_v_include_weight, std::string __pyx_v_weight_name) { - int __pyx_v_num_requested_branches -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_num_entries -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_num_entries_selected -#line 102 "root_numpy/src/tree.pyx" -; - TreeChain *__pyx_v_chain -#line 102 "root_numpy/src/tree.pyx" -; - TObjArray *__pyx_v_branch_array -#line 102 "root_numpy/src/tree.pyx" -; - TObjArray *__pyx_v_leaf_array -#line 102 "root_numpy/src/tree.pyx" -; - TBranch *__pyx_v_tbranch -#line 102 "root_numpy/src/tree.pyx" -; - TLeaf *__pyx_v_tleaf -#line 102 "root_numpy/src/tree.pyx" -; - Column *__pyx_v_col -#line 102 "root_numpy/src/tree.pyx" -; - __pyx_t_13_librootnumpy_Converter *__pyx_v_conv -#line 102 "root_numpy/src/tree.pyx" -; - std::vector __pyx_v_columns -#line 102 "root_numpy/src/tree.pyx" -; - std::vector<__pyx_t_13_librootnumpy_Converter *> __pyx_v_converters -#line 102 "root_numpy/src/tree.pyx" -; - std::vector > __pyx_v_column_buckets -#line 102 "root_numpy/src/tree.pyx" -; - std::vector > __pyx_v_converter_buckets -#line 102 "root_numpy/src/tree.pyx" -; - TTreeFormula *__pyx_v_selection_formula -#line 102 "root_numpy/src/tree.pyx" -; - TTreeFormula *__pyx_v_formula -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_ibranch -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_ileaf -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_ientry -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_branch_idx -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_num_branches -#line 102 "root_numpy/src/tree.pyx" -; - unsigned int __pyx_v_icol -#line 102 "root_numpy/src/tree.pyx" -; - unsigned int __pyx_v_num_columns -#line 102 "root_numpy/src/tree.pyx" -; - PyArrayObject *__pyx_v_arr = 0 -#line 102 "root_numpy/src/tree.pyx" -; - void *__pyx_v_data_ptr -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_num_bytes -#line 102 "root_numpy/src/tree.pyx" -; - int __pyx_v_entry_size -#line 102 "root_numpy/src/tree.pyx" -; - char *__pyx_v_c_string -#line 102 "root_numpy/src/tree.pyx" -; - bool __pyx_v_shortname -#line 102 "root_numpy/src/tree.pyx" -; - std::string __pyx_v_column_name -#line 102 "root_numpy/src/tree.pyx" -; - const char *__pyx_v_branch_name -#line 102 "root_numpy/src/tree.pyx" -; - const char *__pyx_v_leaf_name -#line 102 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_branch_dict = NULL -#line 102 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_expression = NULL -#line 102 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_dtype = NULL -#line 102 "root_numpy/src/tree.pyx" -; - Column *__pyx_v_this_col -#line 102 "root_numpy/src/tree.pyx" -; - __pyx_t_13_librootnumpy_Converter *__pyx_v_this_conv -#line 102 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_indices = NULL -#line 102 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_idx = NULL -#line 102 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_b = NULL -#line 102 "root_numpy/src/tree.pyx" -; +#line 59 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); -#line 102 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - struct __pyx_opt_args_13_librootnumpy_handle_load __pyx_t_5; - std::vector __pyx_t_6; - std::vector<__pyx_t_13_librootnumpy_Converter *> __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *(*__pyx_t_12)(PyObject *); - int __pyx_t_13; - int __pyx_t_14; - int __pyx_t_15; - int __pyx_t_16; - std::string __pyx_t_17; - std::string __pyx_t_18; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyObject *__pyx_t_22 = NULL; - char *__pyx_t_23; - size_t __pyx_t_24; - unsigned int __pyx_t_25; - int __pyx_t_26; - unsigned int __pyx_t_27; - char const *__pyx_t_28; - PyObject *__pyx_t_29 = NULL; - PyObject *__pyx_t_30 = NULL; - PyObject *__pyx_t_31 = NULL; - PyObject *__pyx_t_32 = NULL; - PyObject *__pyx_t_33 = NULL; - PyObject *__pyx_t_34 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 59 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_6); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("tree2array", 0); +#line 59 "root_numpy/src/tree.pyx" + __pyx_t_6 = 0; - /* "root_numpy/src/tree.pyx":106 - * bool include_weight, string weight_name): +#line 59 "root_numpy/src/tree.pyx" + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 59 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_6); + +#line 59 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + +#line 59 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_6, 0, 0, 0); + +#line 59 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + +#line 59 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 59 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":62 + * "leaf list for branch '{0}' is empty".format( + * branch.GetName())) + * return leaflist # <<<<<<<<<<<<<< * - * if tree.GetNbranches() == 0: # <<<<<<<<<<<<<< - * raise ValueError("tree has no branches") * */ -#line 106 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_tree->GetNbranches() == 0) != 0); +#line 62 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 106 "root_numpy/src/tree.pyx" - if (__pyx_t_1) { +#line 62 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_leaflist); - /* "root_numpy/src/tree.pyx":107 +#line 62 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_v_leaflist; + +#line 62 "root_numpy/src/tree.pyx" + goto __pyx_L0; + + /* "root_numpy/src/tree.pyx":47 * - * if tree.GetNbranches() == 0: - * raise ValueError("tree has no branches") # <<<<<<<<<<<<<< * - * cdef int num_requested_branches = 0 + * cdef get_branch_structure(TBranch* branch): # <<<<<<<<<<<<<< + * cdef TObjArray* leaves + * cdef TLeaf* leaf */ -#line 107 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 107 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 47 "root_numpy/src/tree.pyx" -#line 107 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 107 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 47 "root_numpy/src/tree.pyx" + /* function exit code */ -#line 107 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 47 "root_numpy/src/tree.pyx" + __pyx_L1_error:; -#line 107 "root_numpy/src/tree.pyx" - } +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_2); - /* "root_numpy/src/tree.pyx":109 - * raise ValueError("tree has no branches") - * - * cdef int num_requested_branches = 0 # <<<<<<<<<<<<<< - * if branches is not None: - * num_requested_branches = len(branches) - */ +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_3); -#line 109 "root_numpy/src/tree.pyx" - __pyx_v_num_requested_branches = 0; +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_4); - /* "root_numpy/src/tree.pyx":110 - * - * cdef int num_requested_branches = 0 - * if branches is not None: # <<<<<<<<<<<<<< - * num_requested_branches = len(branches) - * if num_requested_branches == 0: - */ +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_5); -#line 110 "root_numpy/src/tree.pyx" - __pyx_t_1 = (__pyx_v_branches != Py_None); +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_6); -#line 110 "root_numpy/src/tree.pyx" - __pyx_t_3 = (__pyx_t_1 != 0); +#line 47 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.get_branch_structure", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 110 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 47 "root_numpy/src/tree.pyx" + __pyx_r = 0; - /* "root_numpy/src/tree.pyx":111 - * cdef int num_requested_branches = 0 - * if branches is not None: - * num_requested_branches = len(branches) # <<<<<<<<<<<<<< - * if num_requested_branches == 0: - * raise ValueError("branches is an empty list") - */ +#line 47 "root_numpy/src/tree.pyx" + __pyx_L0:; -#line 111 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyObject_Length(__pyx_v_branches); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_leaflist); -#line 111 "root_numpy/src/tree.pyx" - __pyx_v_num_requested_branches = __pyx_t_4; +#line 47 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); - /* "root_numpy/src/tree.pyx":112 - * if branches is not None: - * num_requested_branches = len(branches) - * if num_requested_branches == 0: # <<<<<<<<<<<<<< - * raise ValueError("branches is an empty list") - * - */ +#line 47 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 112 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches == 0) != 0); +#line 47 "root_numpy/src/tree.pyx" + return __pyx_r; -#line 112 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 47 "root_numpy/src/tree.pyx" +} - /* "root_numpy/src/tree.pyx":113 - * num_requested_branches = len(branches) - * if num_requested_branches == 0: - * raise ValueError("branches is an empty list") # <<<<<<<<<<<<<< +/* "root_numpy/src/tree.pyx":65 * - * cdef int num_entries = tree.GetEntries() + * + * cdef get_tree_structure(TTree* tree, branches=None): # <<<<<<<<<<<<<< + * cdef int ibranch + * cdef TBranch* branch */ -#line 113 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 65 "root_numpy/src/tree.pyx" -#line 113 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); -#line 113 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 65 "root_numpy/src/tree.pyx" +static PyObject *__pyx_f_13_librootnumpy_get_tree_structure(TTree *__pyx_v_tree, struct __pyx_opt_args_13_librootnumpy_get_tree_structure *__pyx_optional_args) { -#line 113 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 65 "root_numpy/src/tree.pyx" + PyObject *__pyx_v_branches = ((PyObject *)Py_None); + int __pyx_v_ibranch +#line 65 "root_numpy/src/tree.pyx" +; + TBranch *__pyx_v_branch +#line 65 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_ret = NULL +#line 65 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_branch_name = NULL +#line 65 "root_numpy/src/tree.pyx" +; + TObjArray *__pyx_v_all_branches +#line 65 "root_numpy/src/tree.pyx" +; -#line 113 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 65 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + int __pyx_t_5; + Py_ssize_t __pyx_t_6; + PyObject *(*__pyx_t_7)(PyObject *); + const char *__pyx_t_8; + int __pyx_t_9; + int __pyx_t_10; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 113 "root_numpy/src/tree.pyx" - } +#line 65 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("get_tree_structure", 0); -#line 113 "root_numpy/src/tree.pyx" - goto __pyx_L4; +#line 65 "root_numpy/src/tree.pyx" + if (__pyx_optional_args) { -#line 113 "root_numpy/src/tree.pyx" - } +#line 65 "root_numpy/src/tree.pyx" + if (__pyx_optional_args->__pyx_n > 0) { -#line 113 "root_numpy/src/tree.pyx" - __pyx_L4:; +#line 65 "root_numpy/src/tree.pyx" + __pyx_v_branches = __pyx_optional_args->branches; - /* "root_numpy/src/tree.pyx":115 - * raise ValueError("branches is an empty list") - * - * cdef int num_entries = tree.GetEntries() # <<<<<<<<<<<<<< - * cdef int num_entries_selected = 0 - * - */ +#line 65 "root_numpy/src/tree.pyx" + } -#line 115 "root_numpy/src/tree.pyx" - __pyx_v_num_entries = __pyx_v_tree->GetEntries(); +#line 65 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":116 - * - * cdef int num_entries = tree.GetEntries() - * cdef int num_entries_selected = 0 # <<<<<<<<<<<<<< - * - * cdef TreeChain* chain = new TreeChain(tree) + /* "root_numpy/src/tree.pyx":68 + * cdef int ibranch + * cdef TBranch* branch + * ret = OrderedDict() # <<<<<<<<<<<<<< + * if branches is not None: + * for branch_name in branches: */ -#line 116 "root_numpy/src/tree.pyx" - __pyx_v_num_entries_selected = 0; +#line 68 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":118 - * cdef int num_entries_selected = 0 - * - * cdef TreeChain* chain = new TreeChain(tree) # <<<<<<<<<<<<<< - * handle_load(chain.Prepare(), True) - * - */ +#line 68 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 118 "root_numpy/src/tree.pyx" - __pyx_v_chain = new TreeChain(__pyx_v_tree); +#line 68 "root_numpy/src/tree.pyx" + __pyx_t_3 = NULL; - /* "root_numpy/src/tree.pyx":119 - * - * cdef TreeChain* chain = new TreeChain(tree) - * handle_load(chain.Prepare(), True) # <<<<<<<<<<<<<< - * - * cdef TObjArray* branch_array = tree.GetListOfBranches() - */ +#line 68 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) { -#line 119 "root_numpy/src/tree.pyx" - __pyx_t_5.__pyx_n = 1; +#line 68 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); -#line 119 "root_numpy/src/tree.pyx" - __pyx_t_5.ignore_index = 1; +#line 68 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_3)) { -#line 119 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_f_13_librootnumpy_handle_load(__pyx_v_chain->Prepare(), &__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 68 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); -#line 119 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 68 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_3); -#line 119 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 68 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); - /* "root_numpy/src/tree.pyx":121 - * handle_load(chain.Prepare(), True) - * - * cdef TObjArray* branch_array = tree.GetListOfBranches() # <<<<<<<<<<<<<< - * cdef TObjArray* leaf_array - * cdef TBranch* tbranch - */ +#line 68 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_2, function); -#line 121 "root_numpy/src/tree.pyx" - __pyx_v_branch_array = __pyx_v_tree->GetListOfBranches(); +#line 68 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":136 - * # Avoid calling FindBranch for each branch since that results in O(n^2) - * - * cdef TTreeFormula* selection_formula = NULL # <<<<<<<<<<<<<< - * cdef TTreeFormula* formula = NULL - * - */ +#line 68 "root_numpy/src/tree.pyx" + } -#line 136 "root_numpy/src/tree.pyx" - __pyx_v_selection_formula = NULL; +#line 68 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":137 - * - * cdef TTreeFormula* selection_formula = NULL - * cdef TTreeFormula* formula = NULL # <<<<<<<<<<<<<< - * - * cdef int ibranch, ileaf, ientry, branch_idx = 0 - */ +#line 68 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 137 "root_numpy/src/tree.pyx" - __pyx_v_formula = NULL; +#line 68 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "root_numpy/src/tree.pyx":139 - * cdef TTreeFormula* formula = NULL - * - * cdef int ibranch, ileaf, ientry, branch_idx = 0 # <<<<<<<<<<<<<< - * cdef int num_branches = branch_array.GetEntries() - * cdef unsigned int icol, num_columns - */ +#line 68 "root_numpy/src/tree.pyx" + } else { -#line 139 "root_numpy/src/tree.pyx" - __pyx_v_branch_idx = 0; +#line 68 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":140 - * - * cdef int ibranch, ileaf, ientry, branch_idx = 0 - * cdef int num_branches = branch_array.GetEntries() # <<<<<<<<<<<<<< - * cdef unsigned int icol, num_columns - * - */ +#line 68 "root_numpy/src/tree.pyx" + } -#line 140 "root_numpy/src/tree.pyx" - __pyx_v_num_branches = __pyx_v_branch_array->GetEntries(); +#line 68 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); - /* "root_numpy/src/tree.pyx":154 - * cdef const_char* leaf_name - * - * if num_requested_branches > 0: # <<<<<<<<<<<<<< - * columns.reserve(num_requested_branches) - * converters.reserve(num_requested_branches) - */ +#line 68 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 154 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); +#line 68 "root_numpy/src/tree.pyx" + __pyx_v_ret = __pyx_t_1; -#line 154 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 68 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; - /* "root_numpy/src/tree.pyx":155 - * - * if num_requested_branches > 0: - * columns.reserve(num_requested_branches) # <<<<<<<<<<<<<< - * converters.reserve(num_requested_branches) - * column_buckets.assign(num_requested_branches, vector['Column*']()) + /* "root_numpy/src/tree.pyx":69 + * cdef TBranch* branch + * ret = OrderedDict() + * if branches is not None: # <<<<<<<<<<<<<< + * for branch_name in branches: + * branch = tree.GetBranch(branch_name) */ -#line 155 "root_numpy/src/tree.pyx" - __pyx_v_columns.reserve(__pyx_v_num_requested_branches); +#line 69 "root_numpy/src/tree.pyx" + __pyx_t_4 = (__pyx_v_branches != Py_None); - /* "root_numpy/src/tree.pyx":156 - * if num_requested_branches > 0: - * columns.reserve(num_requested_branches) - * converters.reserve(num_requested_branches) # <<<<<<<<<<<<<< - * column_buckets.assign(num_requested_branches, vector['Column*']()) - * converter_buckets.assign(num_requested_branches, vector['Converter*']()) - */ +#line 69 "root_numpy/src/tree.pyx" + __pyx_t_5 = (__pyx_t_4 != 0); -#line 156 "root_numpy/src/tree.pyx" - __pyx_v_converters.reserve(__pyx_v_num_requested_branches); +#line 69 "root_numpy/src/tree.pyx" + if (__pyx_t_5) { - /* "root_numpy/src/tree.pyx":157 - * columns.reserve(num_requested_branches) - * converters.reserve(num_requested_branches) - * column_buckets.assign(num_requested_branches, vector['Column*']()) # <<<<<<<<<<<<<< - * converter_buckets.assign(num_requested_branches, vector['Converter*']()) - * else: + /* "root_numpy/src/tree.pyx":70 + * ret = OrderedDict() + * if branches is not None: + * for branch_name in branches: # <<<<<<<<<<<<<< + * branch = tree.GetBranch(branch_name) + * if branch == NULL: */ -#line 157 "root_numpy/src/tree.pyx" - try { +#line 70 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_v_branches)) || PyTuple_CheckExact(__pyx_v_branches)) { -#line 157 "root_numpy/src/tree.pyx" - __pyx_t_6 = std::vector (); +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_1 = __pyx_v_branches; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; -#line 157 "root_numpy/src/tree.pyx" - } catch(...) { +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_7 = NULL; -#line 157 "root_numpy/src/tree.pyx" - __Pyx_CppExn2PyErr(); +#line 70 "root_numpy/src/tree.pyx" + } else { + __pyx_t_6 = -1; +#line 70 "root_numpy/src/tree.pyx" +__pyx_t_1 = PyObject_GetIter(__pyx_v_branches); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 157 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 70 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 157 "root_numpy/src/tree.pyx" +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 70 "root_numpy/src/tree.pyx" } -#line 157 "root_numpy/src/tree.pyx" - __pyx_v_column_buckets.assign(__pyx_v_num_requested_branches, __pyx_t_6); +#line 70 "root_numpy/src/tree.pyx" + for (;;) { - /* "root_numpy/src/tree.pyx":158 - * converters.reserve(num_requested_branches) - * column_buckets.assign(num_requested_branches, vector['Column*']()) - * converter_buckets.assign(num_requested_branches, vector['Converter*']()) # <<<<<<<<<<<<<< - * else: - * columns.reserve(num_branches) - */ +#line 70 "root_numpy/src/tree.pyx" + if (likely(!__pyx_t_7)) { -#line 158 "root_numpy/src/tree.pyx" - try { +#line 70 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_1))) { -#line 158 "root_numpy/src/tree.pyx" - __pyx_t_7 = std::vector<__pyx_t_13_librootnumpy_Converter *> (); +#line 70 "root_numpy/src/tree.pyx" + if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break; -#line 158 "root_numpy/src/tree.pyx" - } catch(...) { +#line 70 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 158 "root_numpy/src/tree.pyx" - __Pyx_CppExn2PyErr(); +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 158 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 70 "root_numpy/src/tree.pyx" + #else -#line 158 "root_numpy/src/tree.pyx" - } +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 158 "root_numpy/src/tree.pyx" - __pyx_v_converter_buckets.assign(__pyx_v_num_requested_branches, __pyx_t_7); +#line 70 "root_numpy/src/tree.pyx" + #endif -#line 158 "root_numpy/src/tree.pyx" - goto __pyx_L6; +#line 70 "root_numpy/src/tree.pyx" + } else { -#line 158 "root_numpy/src/tree.pyx" - } +#line 70 "root_numpy/src/tree.pyx" + if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break; -#line 158 "root_numpy/src/tree.pyx" - /*else*/ { +#line 70 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON - /* "root_numpy/src/tree.pyx":160 - * converter_buckets.assign(num_requested_branches, vector['Converter*']()) - * else: - * columns.reserve(num_branches) # <<<<<<<<<<<<<< - * converters.reserve(num_branches) - * - */ +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 160 "root_numpy/src/tree.pyx" - __pyx_v_columns.reserve(__pyx_v_num_branches); +#line 70 "root_numpy/src/tree.pyx" + #else - /* "root_numpy/src/tree.pyx":161 - * else: - * columns.reserve(num_branches) - * converters.reserve(num_branches) # <<<<<<<<<<<<<< - * - * try: - */ +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 161 "root_numpy/src/tree.pyx" - __pyx_v_converters.reserve(__pyx_v_num_branches); +#line 70 "root_numpy/src/tree.pyx" + #endif -#line 161 "root_numpy/src/tree.pyx" - } +#line 70 "root_numpy/src/tree.pyx" + } + } else +#line 70 "root_numpy/src/tree.pyx" +{ -#line 161 "root_numpy/src/tree.pyx" - __pyx_L6:; +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_t_7(__pyx_t_1); - /* "root_numpy/src/tree.pyx":163 - * converters.reserve(num_branches) - * - * try: # <<<<<<<<<<<<<< - * # Set up the selection if we have one - * if selection.size(): - */ +#line 70 "root_numpy/src/tree.pyx" + if (unlikely(!__pyx_t_2)) { -#line 163 "root_numpy/src/tree.pyx" - /*try:*/ { +#line 70 "root_numpy/src/tree.pyx" + PyObject* exc_type = PyErr_Occurred(); - /* "root_numpy/src/tree.pyx":165 - * try: - * # Set up the selection if we have one - * if selection.size(): # <<<<<<<<<<<<<< - * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) - * if selection_formula == NULL or selection_formula.GetNdim() == 0: - */ +#line 70 "root_numpy/src/tree.pyx" + if (exc_type) { -#line 165 "root_numpy/src/tree.pyx" - __pyx_t_3 = (__pyx_v_selection.size() != 0); +#line 70 "root_numpy/src/tree.pyx" + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 165 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 70 "root_numpy/src/tree.pyx" + else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":166 - * # Set up the selection if we have one - * if selection.size(): - * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) # <<<<<<<<<<<<<< - * if selection_formula == NULL or selection_formula.GetNdim() == 0: - * del selection_formula - */ +#line 70 "root_numpy/src/tree.pyx" + } -#line 166 "root_numpy/src/tree.pyx" - __pyx_v_selection_formula = new TTreeFormula(__pyx_k_selection, __pyx_v_selection.c_str(), __pyx_v_tree); +#line 70 "root_numpy/src/tree.pyx" + break; - /* "root_numpy/src/tree.pyx":167 - * if selection.size(): - * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) - * if selection_formula == NULL or selection_formula.GetNdim() == 0: # <<<<<<<<<<<<<< - * del selection_formula - * raise ValueError( - */ +#line 70 "root_numpy/src/tree.pyx" + } -#line 167 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_selection_formula == NULL) != 0); +#line 70 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 167 "root_numpy/src/tree.pyx" - if (!__pyx_t_1) { +#line 70 "root_numpy/src/tree.pyx" + } -#line 167 "root_numpy/src/tree.pyx" - } else { +#line 70 "root_numpy/src/tree.pyx" + __Pyx_XDECREF_SET(__pyx_v_branch_name, __pyx_t_2); -#line 167 "root_numpy/src/tree.pyx" - __pyx_t_3 = __pyx_t_1; +#line 70 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 167 "root_numpy/src/tree.pyx" - goto __pyx_L12_bool_binop_done; + /* "root_numpy/src/tree.pyx":71 + * if branches is not None: + * for branch_name in branches: + * branch = tree.GetBranch(branch_name) # <<<<<<<<<<<<<< + * if branch == NULL: + * continue + */ -#line 167 "root_numpy/src/tree.pyx" - } +#line 71 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_branch_name); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 167 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_selection_formula->GetNdim() == 0) != 0); +#line 71 "root_numpy/src/tree.pyx" + __pyx_v_branch = __pyx_v_tree->GetBranch(__pyx_t_8); -#line 167 "root_numpy/src/tree.pyx" - __pyx_t_3 = __pyx_t_1; + /* "root_numpy/src/tree.pyx":72 + * for branch_name in branches: + * branch = tree.GetBranch(branch_name) + * if branch == NULL: # <<<<<<<<<<<<<< + * continue + * ret[branch.GetName()] = get_branch_structure(branch) + */ -#line 167 "root_numpy/src/tree.pyx" - __pyx_L12_bool_binop_done:; +#line 72 "root_numpy/src/tree.pyx" + __pyx_t_5 = ((__pyx_v_branch == NULL) != 0); -#line 167 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 72 "root_numpy/src/tree.pyx" + if (__pyx_t_5) { - /* "root_numpy/src/tree.pyx":168 - * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) - * if selection_formula == NULL or selection_formula.GetNdim() == 0: - * del selection_formula # <<<<<<<<<<<<<< - * raise ValueError( - * "could not compile selection expression '{0}'".format(selection)) + /* "root_numpy/src/tree.pyx":73 + * branch = tree.GetBranch(branch_name) + * if branch == NULL: + * continue # <<<<<<<<<<<<<< + * ret[branch.GetName()] = get_branch_structure(branch) + * return ret */ -#line 168 "root_numpy/src/tree.pyx" - delete __pyx_v_selection_formula; +#line 73 "root_numpy/src/tree.pyx" + goto __pyx_L4_continue; - /* "root_numpy/src/tree.pyx":170 - * del selection_formula - * raise ValueError( - * "could not compile selection expression '{0}'".format(selection)) # <<<<<<<<<<<<<< - * # The chain will take care of updating the formula leaves when - * # rolling over to the next tree. +#line 73 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":74 + * if branch == NULL: + * continue + * ret[branch.GetName()] = get_branch_structure(branch) # <<<<<<<<<<<<<< + * return ret + * # all branches */ -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_could_not_compile_selection_expr, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 74 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_f_13_librootnumpy_get_branch_structure(__pyx_v_branch); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 170 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 74 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_9 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_selection); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 74 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 170 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 74 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_3); -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_10 = NULL; +#line 74 "root_numpy/src/tree.pyx" + if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_t_3, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 170 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { +#line 74 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); +#line 74 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 170 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_10)) { + /* "root_numpy/src/tree.pyx":70 + * ret = OrderedDict() + * if branches is not None: + * for branch_name in branches: # <<<<<<<<<<<<<< + * branch = tree.GetBranch(branch_name) + * if branch == NULL: + */ -#line 170 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); +#line 70 "root_numpy/src/tree.pyx" + __pyx_L4_continue:; -#line 170 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_10); +#line 70 "root_numpy/src/tree.pyx" + } -#line 170 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 70 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 170 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_8, function); + /* "root_numpy/src/tree.pyx":75 + * continue + * ret[branch.GetName()] = get_branch_structure(branch) + * return ret # <<<<<<<<<<<<<< + * # all branches + * cdef TObjArray* all_branches = tree.GetListOfBranches() + */ -#line 170 "root_numpy/src/tree.pyx" - } +#line 75 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 170 "root_numpy/src/tree.pyx" - } +#line 75 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_ret); -#line 170 "root_numpy/src/tree.pyx" - if (!__pyx_t_10) { +#line 75 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_v_ret; -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 75 "root_numpy/src/tree.pyx" + goto __pyx_L0; -#line 170 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 75 "root_numpy/src/tree.pyx" + } -#line 170 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); + /* "root_numpy/src/tree.pyx":77 + * return ret + * # all branches + * cdef TObjArray* all_branches = tree.GetListOfBranches() # <<<<<<<<<<<<<< + * if all_branches == NULL: + * return ret + */ -#line 170 "root_numpy/src/tree.pyx" - } else { +#line 77 "root_numpy/src/tree.pyx" + __pyx_v_all_branches = __pyx_v_tree->GetListOfBranches(); -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":78 + * # all branches + * cdef TObjArray* all_branches = tree.GetListOfBranches() + * if all_branches == NULL: # <<<<<<<<<<<<<< + * return ret + * for ibranch in range(all_branches.GetEntries()): + */ -#line 170 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_11); +#line 78 "root_numpy/src/tree.pyx" + __pyx_t_5 = ((__pyx_v_all_branches == NULL) != 0); -#line 170 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL; +#line 78 "root_numpy/src/tree.pyx" + if (__pyx_t_5) { -#line 170 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9); + /* "root_numpy/src/tree.pyx":79 + * cdef TObjArray* all_branches = tree.GetListOfBranches() + * if all_branches == NULL: + * return ret # <<<<<<<<<<<<<< + * for ibranch in range(all_branches.GetEntries()): + * branch = (all_branches.At(ibranch)) + */ -#line 170 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_9); +#line 79 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_9 = 0; +#line 79 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_ret); -#line 170 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 79 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_v_ret; -#line 170 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 79 "root_numpy/src/tree.pyx" + goto __pyx_L0; -#line 170 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; +#line 79 "root_numpy/src/tree.pyx" + } -#line 170 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":80 + * if all_branches == NULL: + * return ret + * for ibranch in range(all_branches.GetEntries()): # <<<<<<<<<<<<<< + * branch = (all_branches.At(ibranch)) + * ret[branch.GetName()] = get_branch_structure(branch) + */ -#line 170 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 80 "root_numpy/src/tree.pyx" + __pyx_t_9 = __pyx_v_all_branches->GetEntries(); - /* "root_numpy/src/tree.pyx":169 - * if selection_formula == NULL or selection_formula.GetNdim() == 0: - * del selection_formula - * raise ValueError( # <<<<<<<<<<<<<< - * "could not compile selection expression '{0}'".format(selection)) - * # The chain will take care of updating the formula leaves when - */ +#line 80 "root_numpy/src/tree.pyx" + for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { -#line 169 "root_numpy/src/tree.pyx" - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 80 "root_numpy/src/tree.pyx" + __pyx_v_ibranch = __pyx_t_10; -#line 169 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); + /* "root_numpy/src/tree.pyx":81 + * return ret + * for ibranch in range(all_branches.GetEntries()): + * branch = (all_branches.At(ibranch)) # <<<<<<<<<<<<<< + * ret[branch.GetName()] = get_branch_structure(branch) + * return ret + */ -#line 169 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); +#line 81 "root_numpy/src/tree.pyx" + __pyx_v_branch = ((TBranch *)__pyx_v_all_branches->At(__pyx_v_ibranch)); -#line 169 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); + /* "root_numpy/src/tree.pyx":82 + * for ibranch in range(all_branches.GetEntries()): + * branch = (all_branches.At(ibranch)) + * ret[branch.GetName()] = get_branch_structure(branch) # <<<<<<<<<<<<<< + * return ret + * + */ -#line 169 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 82 "root_numpy/src/tree.pyx" + __pyx_t_1 = __pyx_f_13_librootnumpy_get_branch_structure(__pyx_v_branch); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 169 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 82 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 169 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 82 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyStr_FromString(__pyx_v_branch->GetName()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 169 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 82 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 169 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 82 "root_numpy/src/tree.pyx" + if (unlikely(PyObject_SetItem(__pyx_v_ret, __pyx_t_2, __pyx_t_1) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 169 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 82 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 169 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 82 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 169 "root_numpy/src/tree.pyx" - } +#line 82 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":173 - * # The chain will take care of updating the formula leaves when - * # rolling over to the next tree. - * chain.AddFormula(selection_formula) # <<<<<<<<<<<<<< + /* "root_numpy/src/tree.pyx":83 + * branch = (all_branches.At(ibranch)) + * ret[branch.GetName()] = get_branch_structure(branch) + * return ret # <<<<<<<<<<<<<< + * * - * branch_dict = None */ -#line 173 "root_numpy/src/tree.pyx" - __pyx_v_chain->AddFormula(__pyx_v_selection_formula); +#line 83 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 173 "root_numpy/src/tree.pyx" - goto __pyx_L10; +#line 83 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_ret); -#line 173 "root_numpy/src/tree.pyx" - } +#line 83 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_v_ret; -#line 173 "root_numpy/src/tree.pyx" - __pyx_L10:; +#line 83 "root_numpy/src/tree.pyx" + goto __pyx_L0; - /* "root_numpy/src/tree.pyx":175 - * chain.AddFormula(selection_formula) + /* "root_numpy/src/tree.pyx":65 * - * branch_dict = None # <<<<<<<<<<<<<< - * if num_requested_branches > 0: - * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) - */ - -#line 175 "root_numpy/src/tree.pyx" - __Pyx_INCREF(Py_None); - -#line 175 "root_numpy/src/tree.pyx" - __pyx_v_branch_dict = Py_None; - - /* "root_numpy/src/tree.pyx":176 * - * branch_dict = None - * if num_requested_branches > 0: # <<<<<<<<<<<<<< - * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) - * if len(branch_dict) != num_requested_branches: + * cdef get_tree_structure(TTree* tree, branches=None): # <<<<<<<<<<<<<< + * cdef int ibranch + * cdef TBranch* branch */ -#line 176 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); +#line 65 "root_numpy/src/tree.pyx" -#line 176 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":177 - * branch_dict = None - * if num_requested_branches > 0: - * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) # <<<<<<<<<<<<<< - * if len(branch_dict) != num_requested_branches: - * raise ValueError("duplicate branches requested") - */ +#line 65 "root_numpy/src/tree.pyx" + /* function exit code */ -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 65 "root_numpy/src/tree.pyx" + __pyx_L1_error:; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 65 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_1); -#line 177 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_int_0); +#line 65 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_2); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_8 = __pyx_int_0; +#line 65 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_3); -#line 177 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_v_branches)) || PyTuple_CheckExact(__pyx_v_branches)) { +#line 65 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.get_tree_structure", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_11 = __pyx_v_branches; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; +#line 65 "root_numpy/src/tree.pyx" + __pyx_r = 0; -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_12 = NULL; +#line 65 "root_numpy/src/tree.pyx" + __pyx_L0:; -#line 177 "root_numpy/src/tree.pyx" - } else { - __pyx_t_4 = -1; -#line 177 "root_numpy/src/tree.pyx" -__pyx_t_11 = PyObject_GetIter(__pyx_v_branches); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 65 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_ret); -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_11); +#line 65 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_branch_name); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 65 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 177 "root_numpy/src/tree.pyx" - } +#line 65 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 177 "root_numpy/src/tree.pyx" - for (;;) { +#line 65 "root_numpy/src/tree.pyx" + return __pyx_r; -#line 177 "root_numpy/src/tree.pyx" - if (likely(!__pyx_t_12)) { +#line 65 "root_numpy/src/tree.pyx" +} -#line 177 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_11))) { +/* "root_numpy/src/tree.pyx":86 + * + * + * cdef handle_load(int load, bool ignore_index=False): # <<<<<<<<<<<<<< + * if load >= 0: + * return + */ -#line 177 "root_numpy/src/tree.pyx" - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break; +#line 86 "root_numpy/src/tree.pyx" -#line 177 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 86 "root_numpy/src/tree.pyx" +static PyObject *__pyx_f_13_librootnumpy_handle_load(int __pyx_v_load, struct __pyx_opt_args_13_librootnumpy_handle_load *__pyx_optional_args) { -#line 177 "root_numpy/src/tree.pyx" - #else +#line 86 "root_numpy/src/tree.pyx" + bool __pyx_v_ignore_index = ((bool)0); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 86 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 177 "root_numpy/src/tree.pyx" - #endif +#line 86 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("handle_load", 0); -#line 177 "root_numpy/src/tree.pyx" - } else { +#line 86 "root_numpy/src/tree.pyx" + if (__pyx_optional_args) { -#line 177 "root_numpy/src/tree.pyx" - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break; +#line 86 "root_numpy/src/tree.pyx" + if (__pyx_optional_args->__pyx_n > 0) { -#line 177 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 86 "root_numpy/src/tree.pyx" + __pyx_v_ignore_index = __pyx_optional_args->ignore_index; -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 86 "root_numpy/src/tree.pyx" + } -#line 177 "root_numpy/src/tree.pyx" - #else +#line 86 "root_numpy/src/tree.pyx" + } -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":87 + * + * cdef handle_load(int load, bool ignore_index=False): + * if load >= 0: # <<<<<<<<<<<<<< + * return + * if load == -1: + */ -#line 177 "root_numpy/src/tree.pyx" - #endif +#line 87 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_load >= 0) != 0); -#line 177 "root_numpy/src/tree.pyx" - } - } else -#line 177 "root_numpy/src/tree.pyx" -{ +#line 87 "root_numpy/src/tree.pyx" + if (__pyx_t_1) { -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = __pyx_t_12(__pyx_t_11); + /* "root_numpy/src/tree.pyx":88 + * cdef handle_load(int load, bool ignore_index=False): + * if load >= 0: + * return # <<<<<<<<<<<<<< + * if load == -1: + * raise ValueError("chain is empty") + */ -#line 177 "root_numpy/src/tree.pyx" - if (unlikely(!__pyx_t_9)) { +#line 88 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 177 "root_numpy/src/tree.pyx" - PyObject* exc_type = PyErr_Occurred(); +#line 88 "root_numpy/src/tree.pyx" + __pyx_r = Py_None; __Pyx_INCREF(Py_None); -#line 177 "root_numpy/src/tree.pyx" - if (exc_type) { +#line 88 "root_numpy/src/tree.pyx" + goto __pyx_L0; -#line 177 "root_numpy/src/tree.pyx" - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); +#line 88 "root_numpy/src/tree.pyx" + } -#line 177 "root_numpy/src/tree.pyx" - else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":97 + * elif load == -3: + * raise IOError("cannot open current file") + * elif load == -4: # <<<<<<<<<<<<<< + * raise IOError("cannot access tree in current file") + * raise RuntimeError("the chain is not initialized") + */ -#line 177 "root_numpy/src/tree.pyx" - } +#line 97 "root_numpy/src/tree.pyx" + switch (__pyx_v_load) { -#line 177 "root_numpy/src/tree.pyx" - break; + /* "root_numpy/src/tree.pyx":89 + * if load >= 0: + * return + * if load == -1: # <<<<<<<<<<<<<< + * raise ValueError("chain is empty") + * elif load == -2: + */ -#line 177 "root_numpy/src/tree.pyx" - } +#line 89 "root_numpy/src/tree.pyx" + case -1: -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); + /* "root_numpy/src/tree.pyx":90 + * return + * if load == -1: + * raise ValueError("chain is empty") # <<<<<<<<<<<<<< + * elif load == -2: + * if ignore_index: + */ -#line 177 "root_numpy/src/tree.pyx" - } +#line 90 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 177 "root_numpy/src/tree.pyx" - __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_9); +#line 90 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = 0; +#line 90 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 177 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_8); +#line 90 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_8); +#line 90 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 90 "root_numpy/src/tree.pyx" + break; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); + /* "root_numpy/src/tree.pyx":91 + * if load == -1: + * raise ValueError("chain is empty") + * elif load == -2: # <<<<<<<<<<<<<< + * if ignore_index: + * return + */ -#line 177 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); +#line 91 "root_numpy/src/tree.pyx" + case -2: -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_8 = __pyx_t_9; + /* "root_numpy/src/tree.pyx":92 + * raise ValueError("chain is empty") + * elif load == -2: + * if ignore_index: # <<<<<<<<<<<<<< + * return + * raise IndexError("tree index in chain is out of bounds") + */ -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = 0; +#line 92 "root_numpy/src/tree.pyx" + __pyx_t_1 = (__pyx_v_ignore_index != 0); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 92 "root_numpy/src/tree.pyx" + if (__pyx_t_1) { -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); + /* "root_numpy/src/tree.pyx":93 + * elif load == -2: + * if ignore_index: + * return # <<<<<<<<<<<<<< + * raise IndexError("tree index in chain is out of bounds") + * elif load == -3: + */ -#line 177 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_b); +#line 93 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 177 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_b); +#line 93 "root_numpy/src/tree.pyx" + __pyx_r = Py_None; __Pyx_INCREF(Py_None); -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_b); +#line 93 "root_numpy/src/tree.pyx" + goto __pyx_L0; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_idx); +#line 93 "root_numpy/src/tree.pyx" + } -#line 177 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_idx); + /* "root_numpy/src/tree.pyx":94 + * if ignore_index: + * return + * raise IndexError("tree index in chain is out of bounds") # <<<<<<<<<<<<<< + * elif load == -3: + * raise IOError("cannot open current file") + */ -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_idx); +#line 94 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 94 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 177 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 94 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 177 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 94 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 177 "root_numpy/src/tree.pyx" - } +#line 94 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 177 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; +#line 94 "root_numpy/src/tree.pyx" + break; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + /* "root_numpy/src/tree.pyx":95 + * return + * raise IndexError("tree index in chain is out of bounds") + * elif load == -3: # <<<<<<<<<<<<<< + * raise IOError("cannot open current file") + * elif load == -4: + */ -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 95 "root_numpy/src/tree.pyx" + case -3: -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); + /* "root_numpy/src/tree.pyx":96 + * raise IndexError("tree index in chain is out of bounds") + * elif load == -3: + * raise IOError("cannot open current file") # <<<<<<<<<<<<<< + * elif load == -4: + * raise IOError("cannot access tree in current file") + */ -#line 177 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); +#line 96 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 96 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 96 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 96 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 96 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 177 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 96 "root_numpy/src/tree.pyx" + break; -#line 177 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_v_branch_dict, __pyx_t_2); + /* "root_numpy/src/tree.pyx":97 + * elif load == -3: + * raise IOError("cannot open current file") + * elif load == -4: # <<<<<<<<<<<<<< + * raise IOError("cannot access tree in current file") + * raise RuntimeError("the chain is not initialized") + */ -#line 177 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 97 "root_numpy/src/tree.pyx" + case -4: - /* "root_numpy/src/tree.pyx":178 - * if num_requested_branches > 0: - * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) - * if len(branch_dict) != num_requested_branches: # <<<<<<<<<<<<<< - * raise ValueError("duplicate branches requested") + /* "root_numpy/src/tree.pyx":98 + * raise IOError("cannot open current file") + * elif load == -4: + * raise IOError("cannot access tree in current file") # <<<<<<<<<<<<<< + * raise RuntimeError("the chain is not initialized") * */ -#line 178 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyObject_Length(__pyx_v_branch_dict); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 98 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 178 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_t_4 != __pyx_v_num_requested_branches) != 0); +#line 98 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 178 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 98 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); - /* "root_numpy/src/tree.pyx":179 - * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) - * if len(branch_dict) != num_requested_branches: - * raise ValueError("duplicate branches requested") # <<<<<<<<<<<<<< - * - * # Build vector of Converters for branches - */ +#line 98 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 179 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 98 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 179 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 98 "root_numpy/src/tree.pyx" + break; -#line 179 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 98 "root_numpy/src/tree.pyx" + default: break; -#line 179 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 98 "root_numpy/src/tree.pyx" + } -#line 179 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":99 + * elif load == -4: + * raise IOError("cannot access tree in current file") + * raise RuntimeError("the chain is not initialized") # <<<<<<<<<<<<<< + * + * + */ -#line 179 "root_numpy/src/tree.pyx" - } +#line 99 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 179 "root_numpy/src/tree.pyx" - goto __pyx_L14; +#line 99 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 179 "root_numpy/src/tree.pyx" - } +#line 99 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 179 "root_numpy/src/tree.pyx" - __pyx_L14:; +#line 99 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 99 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":182 + /* "root_numpy/src/tree.pyx":86 * - * # Build vector of Converters for branches - * for ibranch in range(num_branches): # <<<<<<<<<<<<<< - * tbranch = branch_array.At(ibranch) - * branch_name = tbranch.GetName() + * + * cdef handle_load(int load, bool ignore_index=False): # <<<<<<<<<<<<<< + * if load >= 0: + * return */ -#line 182 "root_numpy/src/tree.pyx" - __pyx_t_13 = __pyx_v_num_branches; +#line 86 "root_numpy/src/tree.pyx" -#line 182 "root_numpy/src/tree.pyx" - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { -#line 182 "root_numpy/src/tree.pyx" - __pyx_v_ibranch = __pyx_t_14; +#line 86 "root_numpy/src/tree.pyx" + /* function exit code */ - /* "root_numpy/src/tree.pyx":183 - * # Build vector of Converters for branches - * for ibranch in range(num_branches): - * tbranch = branch_array.At(ibranch) # <<<<<<<<<<<<<< - * branch_name = tbranch.GetName() - * if num_requested_branches > 0: - */ +#line 86 "root_numpy/src/tree.pyx" + __pyx_L1_error:; -#line 183 "root_numpy/src/tree.pyx" - __pyx_v_tbranch = ((TBranch *)__pyx_v_branch_array->At(__pyx_v_ibranch)); +#line 86 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_2); - /* "root_numpy/src/tree.pyx":184 - * for ibranch in range(num_branches): - * tbranch = branch_array.At(ibranch) - * branch_name = tbranch.GetName() # <<<<<<<<<<<<<< - * if num_requested_branches > 0: - * if len(branch_dict) == 0: - */ +#line 86 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.handle_load", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 184 "root_numpy/src/tree.pyx" - __pyx_v_branch_name = __pyx_v_tbranch->GetName(); +#line 86 "root_numpy/src/tree.pyx" + __pyx_r = 0; - /* "root_numpy/src/tree.pyx":185 - * tbranch = branch_array.At(ibranch) - * branch_name = tbranch.GetName() - * if num_requested_branches > 0: # <<<<<<<<<<<<<< - * if len(branch_dict) == 0: - * # No more branches to consider - */ +#line 86 "root_numpy/src/tree.pyx" + __pyx_L0:; -#line 185 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); +#line 86 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 185 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 86 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); - /* "root_numpy/src/tree.pyx":186 - * branch_name = tbranch.GetName() - * if num_requested_branches > 0: - * if len(branch_dict) == 0: # <<<<<<<<<<<<<< - * # No more branches to consider - * break - */ +#line 86 "root_numpy/src/tree.pyx" + return __pyx_r; -#line 186 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyObject_Length(__pyx_v_branch_dict); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 86 "root_numpy/src/tree.pyx" +} -#line 186 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_t_4 == 0) != 0); +/* "root_numpy/src/tree.pyx":102 + * + * + * cdef object tree2array(TTree* tree, branches, string selection, # <<<<<<<<<<<<<< + * start, stop, step, + * bool include_weight, string weight_name): + */ -#line 186 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 102 "root_numpy/src/tree.pyx" - /* "root_numpy/src/tree.pyx":188 - * if len(branch_dict) == 0: - * # No more branches to consider - * break # <<<<<<<<<<<<<< - * branch_idx = branch_dict.pop(branch_name, -1) - * if branch_idx == -1: - */ -#line 188 "root_numpy/src/tree.pyx" - goto __pyx_L19_break; +#line 102 "root_numpy/src/tree.pyx" +static PyObject *__pyx_f_13_librootnumpy_tree2array(TTree *__pyx_v_tree, PyObject *__pyx_v_branches, std::string __pyx_v_selection, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, bool __pyx_v_include_weight, std::string __pyx_v_weight_name) { + int __pyx_v_num_requested_branches +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_num_entries +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_num_entries_selected +#line 102 "root_numpy/src/tree.pyx" +; + TreeChain *__pyx_v_chain +#line 102 "root_numpy/src/tree.pyx" +; + TObjArray *__pyx_v_branch_array +#line 102 "root_numpy/src/tree.pyx" +; + TObjArray *__pyx_v_leaf_array +#line 102 "root_numpy/src/tree.pyx" +; + TBranch *__pyx_v_tbranch +#line 102 "root_numpy/src/tree.pyx" +; + TLeaf *__pyx_v_tleaf +#line 102 "root_numpy/src/tree.pyx" +; + Column *__pyx_v_col +#line 102 "root_numpy/src/tree.pyx" +; + __pyx_t_13_librootnumpy_Converter *__pyx_v_conv +#line 102 "root_numpy/src/tree.pyx" +; + std::vector __pyx_v_columns +#line 102 "root_numpy/src/tree.pyx" +; + std::vector<__pyx_t_13_librootnumpy_Converter *> __pyx_v_converters +#line 102 "root_numpy/src/tree.pyx" +; + std::vector > __pyx_v_column_buckets +#line 102 "root_numpy/src/tree.pyx" +; + std::vector > __pyx_v_converter_buckets +#line 102 "root_numpy/src/tree.pyx" +; + TTreeFormula *__pyx_v_selection_formula +#line 102 "root_numpy/src/tree.pyx" +; + TTreeFormula *__pyx_v_formula +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_ibranch +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_ileaf +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_ientry +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_branch_idx +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_num_branches +#line 102 "root_numpy/src/tree.pyx" +; + unsigned int __pyx_v_icol +#line 102 "root_numpy/src/tree.pyx" +; + unsigned int __pyx_v_num_columns +#line 102 "root_numpy/src/tree.pyx" +; + PyArrayObject *__pyx_v_arr = 0 +#line 102 "root_numpy/src/tree.pyx" +; + void *__pyx_v_data_ptr +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_num_bytes +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_entry_size +#line 102 "root_numpy/src/tree.pyx" +; + char *__pyx_v_c_string +#line 102 "root_numpy/src/tree.pyx" +; + bool __pyx_v_shortname +#line 102 "root_numpy/src/tree.pyx" +; + std::string __pyx_v_column_name +#line 102 "root_numpy/src/tree.pyx" +; + const char *__pyx_v_branch_name +#line 102 "root_numpy/src/tree.pyx" +; + const char *__pyx_v_leaf_name +#line 102 "root_numpy/src/tree.pyx" +; + std::string __pyx_v_branch_title +#line 102 "root_numpy/src/tree.pyx" +; + int __pyx_v_branch_title_size +#line 102 "root_numpy/src/tree.pyx" +; + char __pyx_v_type_code +#line 102 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_branch_dict = NULL +#line 102 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_expression = NULL +#line 102 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_dtype = NULL +#line 102 "root_numpy/src/tree.pyx" +; + Column *__pyx_v_this_col +#line 102 "root_numpy/src/tree.pyx" +; + __pyx_t_13_librootnumpy_Converter *__pyx_v_this_conv +#line 102 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_indices = NULL +#line 102 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_idx = NULL +#line 102 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_b = NULL +#line 102 "root_numpy/src/tree.pyx" +; -#line 188 "root_numpy/src/tree.pyx" - } +#line 102 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + Py_ssize_t __pyx_t_4; + struct __pyx_opt_args_13_librootnumpy_handle_load __pyx_t_5; + std::vector __pyx_t_6; + std::vector<__pyx_t_13_librootnumpy_Converter *> __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + std::string __pyx_t_16; + int __pyx_t_17; + std::string __pyx_t_18; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; + char *__pyx_t_23; + size_t __pyx_t_24; + unsigned int __pyx_t_25; + int __pyx_t_26; + unsigned int __pyx_t_27; + char const *__pyx_t_28; + PyObject *__pyx_t_29 = NULL; + PyObject *__pyx_t_30 = NULL; + PyObject *__pyx_t_31 = NULL; + PyObject *__pyx_t_32 = NULL; + PyObject *__pyx_t_33 = NULL; + PyObject *__pyx_t_34 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; - /* "root_numpy/src/tree.pyx":189 - * # No more branches to consider - * break - * branch_idx = branch_dict.pop(branch_name, -1) # <<<<<<<<<<<<<< - * if branch_idx == -1: - * # This branch was not selected by the user - */ +#line 102 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("tree2array", 0); -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_branch_dict, __pyx_n_s_pop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":106 + * bool include_weight, string weight_name): + * + * if tree.GetNbranches() == 0: # <<<<<<<<<<<<<< + * raise ValueError("tree has no branches") + * + */ -#line 189 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 106 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_tree->GetNbranches() == 0) != 0); -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_11 = __Pyx_PyStr_FromString(__pyx_v_branch_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 106 "root_numpy/src/tree.pyx" + if (__pyx_t_1) { -#line 189 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_11); + /* "root_numpy/src/tree.pyx":107 + * + * if tree.GetNbranches() == 0: + * raise ValueError("tree has no branches") # <<<<<<<<<<<<<< + * + * cdef int num_requested_branches = 0 + */ -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_9 = NULL; +#line 107 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 107 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 189 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { +#line 107 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); +#line 107 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 189 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_9)) { +#line 107 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 189 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); +#line 107 "root_numpy/src/tree.pyx" + } -#line 189 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_9); + /* "root_numpy/src/tree.pyx":109 + * raise ValueError("tree has no branches") + * + * cdef int num_requested_branches = 0 # <<<<<<<<<<<<<< + * if branches is not None: + * num_requested_branches = len(branches) + */ -#line 189 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 109 "root_numpy/src/tree.pyx" + __pyx_v_num_requested_branches = 0; -#line 189 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_8, function); + /* "root_numpy/src/tree.pyx":110 + * + * cdef int num_requested_branches = 0 + * if branches is not None: # <<<<<<<<<<<<<< + * num_requested_branches = len(branches) + * if num_requested_branches == 0: + */ -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_4 = 1; +#line 110 "root_numpy/src/tree.pyx" + __pyx_t_1 = (__pyx_v_branches != Py_None); -#line 189 "root_numpy/src/tree.pyx" - } +#line 110 "root_numpy/src/tree.pyx" + __pyx_t_3 = (__pyx_t_1 != 0); -#line 189 "root_numpy/src/tree.pyx" - } +#line 110 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":111 + * cdef int num_requested_branches = 0 + * if branches is not None: + * num_requested_branches = len(branches) # <<<<<<<<<<<<<< + * if num_requested_branches == 0: + * raise ValueError("branches is an empty list") + */ -#line 189 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_10); +#line 111 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyObject_Length(__pyx_v_branches); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 189 "root_numpy/src/tree.pyx" - if (__pyx_t_9) { +#line 111 "root_numpy/src/tree.pyx" + __pyx_v_num_requested_branches = __pyx_t_4; -#line 189 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; + /* "root_numpy/src/tree.pyx":112 + * if branches is not None: + * num_requested_branches = len(branches) + * if num_requested_branches == 0: # <<<<<<<<<<<<<< + * raise ValueError("branches is an empty list") + * + */ -#line 189 "root_numpy/src/tree.pyx" - } +#line 112 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches == 0) != 0); -#line 189 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_11); +#line 112 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 189 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_11); + /* "root_numpy/src/tree.pyx":113 + * num_requested_branches = len(branches) + * if num_requested_branches == 0: + * raise ValueError("branches is an empty list") # <<<<<<<<<<<<<< + * + * cdef int num_entries = tree.GetEntries() + */ -#line 189 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_int_neg_1); +#line 113 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 189 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_int_neg_1); +#line 113 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 189 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_int_neg_1); +#line 113 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_11 = 0; +#line 113 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 113 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 189 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 113 "root_numpy/src/tree.pyx" + } -#line 189 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; +#line 113 "root_numpy/src/tree.pyx" + goto __pyx_L4; -#line 189 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 113 "root_numpy/src/tree.pyx" + } -#line 189 "root_numpy/src/tree.pyx" - __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 113 "root_numpy/src/tree.pyx" + __pyx_L4:; -#line 189 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "root_numpy/src/tree.pyx":115 + * raise ValueError("branches is an empty list") + * + * cdef int num_entries = tree.GetEntries() # <<<<<<<<<<<<<< + * cdef int num_entries_selected = 0 + * + */ -#line 189 "root_numpy/src/tree.pyx" - __pyx_v_branch_idx = __pyx_t_15; +#line 115 "root_numpy/src/tree.pyx" + __pyx_v_num_entries = __pyx_v_tree->GetEntries(); - /* "root_numpy/src/tree.pyx":190 - * break - * branch_idx = branch_dict.pop(branch_name, -1) - * if branch_idx == -1: # <<<<<<<<<<<<<< - * # This branch was not selected by the user - * continue + /* "root_numpy/src/tree.pyx":116 + * + * cdef int num_entries = tree.GetEntries() + * cdef int num_entries_selected = 0 # <<<<<<<<<<<<<< + * + * cdef TreeChain* chain = new TreeChain(tree) */ -#line 190 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_branch_idx == -1) != 0); +#line 116 "root_numpy/src/tree.pyx" + __pyx_v_num_entries_selected = 0; -#line 190 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { + /* "root_numpy/src/tree.pyx":118 + * cdef int num_entries_selected = 0 + * + * cdef TreeChain* chain = new TreeChain(tree) # <<<<<<<<<<<<<< + * handle_load(chain.Prepare(), True) + * + */ - /* "root_numpy/src/tree.pyx":192 - * if branch_idx == -1: - * # This branch was not selected by the user - * continue # <<<<<<<<<<<<<< +#line 118 "root_numpy/src/tree.pyx" + __pyx_v_chain = new TreeChain(__pyx_v_tree); + + /* "root_numpy/src/tree.pyx":119 * - * leaf_array = tbranch.GetListOfLeaves() + * cdef TreeChain* chain = new TreeChain(tree) + * handle_load(chain.Prepare(), True) # <<<<<<<<<<<<<< + * + * cdef TObjArray* branch_array = tree.GetListOfBranches() */ -#line 192 "root_numpy/src/tree.pyx" - goto __pyx_L18_continue; +#line 119 "root_numpy/src/tree.pyx" + __pyx_t_5.__pyx_n = 1; -#line 192 "root_numpy/src/tree.pyx" - } +#line 119 "root_numpy/src/tree.pyx" + __pyx_t_5.ignore_index = 1; -#line 192 "root_numpy/src/tree.pyx" - goto __pyx_L20; +#line 119 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_f_13_librootnumpy_handle_load(__pyx_v_chain->Prepare(), &__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 192 "root_numpy/src/tree.pyx" - } +#line 119 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 192 "root_numpy/src/tree.pyx" - __pyx_L20:; +#line 119 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "root_numpy/src/tree.pyx":194 - * continue - * - * leaf_array = tbranch.GetListOfLeaves() # <<<<<<<<<<<<<< - * shortname = leaf_array.GetEntries() == 1 + /* "root_numpy/src/tree.pyx":121 + * handle_load(chain.Prepare(), True) * + * cdef TObjArray* branch_array = tree.GetListOfBranches() # <<<<<<<<<<<<<< + * cdef TObjArray* leaf_array + * cdef TBranch* tbranch */ -#line 194 "root_numpy/src/tree.pyx" - __pyx_v_leaf_array = __pyx_v_tbranch->GetListOfLeaves(); +#line 121 "root_numpy/src/tree.pyx" + __pyx_v_branch_array = __pyx_v_tree->GetListOfBranches(); - /* "root_numpy/src/tree.pyx":195 + /* "root_numpy/src/tree.pyx":136 + * # Avoid calling FindBranch for each branch since that results in O(n^2) * - * leaf_array = tbranch.GetListOfLeaves() - * shortname = leaf_array.GetEntries() == 1 # <<<<<<<<<<<<<< + * cdef TTreeFormula* selection_formula = NULL # <<<<<<<<<<<<<< + * cdef TTreeFormula* formula = NULL * - * for ileaf in range(leaf_array.GetEntries()): */ -#line 195 "root_numpy/src/tree.pyx" - __pyx_v_shortname = (__pyx_v_leaf_array->GetEntries() == 1); +#line 136 "root_numpy/src/tree.pyx" + __pyx_v_selection_formula = NULL; - /* "root_numpy/src/tree.pyx":197 - * shortname = leaf_array.GetEntries() == 1 + /* "root_numpy/src/tree.pyx":137 * - * for ileaf in range(leaf_array.GetEntries()): # <<<<<<<<<<<<<< - * tleaf = leaf_array.At(ileaf) - * leaf_name = tleaf.GetName() + * cdef TTreeFormula* selection_formula = NULL + * cdef TTreeFormula* formula = NULL # <<<<<<<<<<<<<< + * + * cdef int ibranch, ileaf, ientry, branch_idx = 0 */ -#line 197 "root_numpy/src/tree.pyx" - __pyx_t_15 = __pyx_v_leaf_array->GetEntries(); +#line 137 "root_numpy/src/tree.pyx" + __pyx_v_formula = NULL; -#line 197 "root_numpy/src/tree.pyx" - for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { + /* "root_numpy/src/tree.pyx":139 + * cdef TTreeFormula* formula = NULL + * + * cdef int ibranch, ileaf, ientry, branch_idx = 0 # <<<<<<<<<<<<<< + * cdef int num_branches = branch_array.GetEntries() + * cdef unsigned int icol, num_columns + */ -#line 197 "root_numpy/src/tree.pyx" - __pyx_v_ileaf = __pyx_t_16; +#line 139 "root_numpy/src/tree.pyx" + __pyx_v_branch_idx = 0; - /* "root_numpy/src/tree.pyx":198 + /* "root_numpy/src/tree.pyx":140 + * + * cdef int ibranch, ileaf, ientry, branch_idx = 0 + * cdef int num_branches = branch_array.GetEntries() # <<<<<<<<<<<<<< + * cdef unsigned int icol, num_columns * - * for ileaf in range(leaf_array.GetEntries()): - * tleaf = leaf_array.At(ileaf) # <<<<<<<<<<<<<< - * leaf_name = tleaf.GetName() - * conv = get_converter(tleaf) */ -#line 198 "root_numpy/src/tree.pyx" - __pyx_v_tleaf = ((TLeaf *)__pyx_v_leaf_array->At(__pyx_v_ileaf)); +#line 140 "root_numpy/src/tree.pyx" + __pyx_v_num_branches = __pyx_v_branch_array->GetEntries(); - /* "root_numpy/src/tree.pyx":199 - * for ileaf in range(leaf_array.GetEntries()): - * tleaf = leaf_array.At(ileaf) - * leaf_name = tleaf.GetName() # <<<<<<<<<<<<<< - * conv = get_converter(tleaf) - * if conv != NULL: + /* "root_numpy/src/tree.pyx":157 + * cdef char type_code + * + * if num_requested_branches > 0: # <<<<<<<<<<<<<< + * columns.reserve(num_requested_branches) + * converters.reserve(num_requested_branches) */ -#line 199 "root_numpy/src/tree.pyx" - __pyx_v_leaf_name = __pyx_v_tleaf->GetName(); +#line 157 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); - /* "root_numpy/src/tree.pyx":200 - * tleaf = leaf_array.At(ileaf) - * leaf_name = tleaf.GetName() - * conv = get_converter(tleaf) # <<<<<<<<<<<<<< - * if conv != NULL: - * # A converter exists for this leaf +#line 157 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { + + /* "root_numpy/src/tree.pyx":158 + * + * if num_requested_branches > 0: + * columns.reserve(num_requested_branches) # <<<<<<<<<<<<<< + * converters.reserve(num_requested_branches) + * column_buckets.assign(num_requested_branches, vector['Column*']()) */ -#line 200 "root_numpy/src/tree.pyx" - __pyx_v_conv = __pyx_f_13_librootnumpy_get_converter(__pyx_v_tleaf); +#line 158 "root_numpy/src/tree.pyx" + __pyx_v_columns.reserve(__pyx_v_num_requested_branches); - /* "root_numpy/src/tree.pyx":201 - * leaf_name = tleaf.GetName() - * conv = get_converter(tleaf) - * if conv != NULL: # <<<<<<<<<<<<<< - * # A converter exists for this leaf - * column_name = string(branch_name) + /* "root_numpy/src/tree.pyx":159 + * if num_requested_branches > 0: + * columns.reserve(num_requested_branches) + * converters.reserve(num_requested_branches) # <<<<<<<<<<<<<< + * column_buckets.assign(num_requested_branches, vector['Column*']()) + * converter_buckets.assign(num_requested_branches, vector['Converter*']()) */ -#line 201 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_conv != NULL) != 0); - -#line 201 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 159 "root_numpy/src/tree.pyx" + __pyx_v_converters.reserve(__pyx_v_num_requested_branches); - /* "root_numpy/src/tree.pyx":203 - * if conv != NULL: - * # A converter exists for this leaf - * column_name = string(branch_name) # <<<<<<<<<<<<<< - * if not shortname: - * column_name.append( '_') + /* "root_numpy/src/tree.pyx":160 + * columns.reserve(num_requested_branches) + * converters.reserve(num_requested_branches) + * column_buckets.assign(num_requested_branches, vector['Column*']()) # <<<<<<<<<<<<<< + * converter_buckets.assign(num_requested_branches, vector['Converter*']()) + * else: */ -#line 203 "root_numpy/src/tree.pyx" - try { +#line 160 "root_numpy/src/tree.pyx" + try { -#line 203 "root_numpy/src/tree.pyx" - __pyx_t_17 = std::string(__pyx_v_branch_name); +#line 160 "root_numpy/src/tree.pyx" + __pyx_t_6 = std::vector (); -#line 203 "root_numpy/src/tree.pyx" - } catch(...) { +#line 160 "root_numpy/src/tree.pyx" + } catch(...) { -#line 203 "root_numpy/src/tree.pyx" - __Pyx_CppExn2PyErr(); +#line 160 "root_numpy/src/tree.pyx" + __Pyx_CppExn2PyErr(); -#line 203 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 160 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 203 "root_numpy/src/tree.pyx" - } +#line 160 "root_numpy/src/tree.pyx" + } -#line 203 "root_numpy/src/tree.pyx" - __pyx_v_column_name = __pyx_t_17; +#line 160 "root_numpy/src/tree.pyx" + __pyx_v_column_buckets.assign(__pyx_v_num_requested_branches, __pyx_t_6); - /* "root_numpy/src/tree.pyx":204 - * # A converter exists for this leaf - * column_name = string(branch_name) - * if not shortname: # <<<<<<<<<<<<<< - * column_name.append( '_') - * column_name.append(leaf_name) + /* "root_numpy/src/tree.pyx":161 + * converters.reserve(num_requested_branches) + * column_buckets.assign(num_requested_branches, vector['Column*']()) + * converter_buckets.assign(num_requested_branches, vector['Converter*']()) # <<<<<<<<<<<<<< + * else: + * columns.reserve(num_branches) */ -#line 204 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((!(__pyx_v_shortname != 0)) != 0); +#line 161 "root_numpy/src/tree.pyx" + try { -#line 204 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 161 "root_numpy/src/tree.pyx" + __pyx_t_7 = std::vector<__pyx_t_13_librootnumpy_Converter *> (); - /* "root_numpy/src/tree.pyx":205 - * column_name = string(branch_name) - * if not shortname: - * column_name.append( '_') # <<<<<<<<<<<<<< - * column_name.append(leaf_name) - * # Create a column for this branch/leaf pair - */ +#line 161 "root_numpy/src/tree.pyx" + } catch(...) { -#line 205 "root_numpy/src/tree.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_n_b__19); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 161 "root_numpy/src/tree.pyx" + __Pyx_CppExn2PyErr(); -#line 205 "root_numpy/src/tree.pyx" - __pyx_v_column_name.append(((std::string)__pyx_t_17)); +#line 161 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":206 - * if not shortname: - * column_name.append( '_') - * column_name.append(leaf_name) # <<<<<<<<<<<<<< - * # Create a column for this branch/leaf pair - * col = new BranchColumn(column_name, tleaf) - */ +#line 161 "root_numpy/src/tree.pyx" + } -#line 206 "root_numpy/src/tree.pyx" - __pyx_v_column_name.append(__pyx_v_leaf_name); +#line 161 "root_numpy/src/tree.pyx" + __pyx_v_converter_buckets.assign(__pyx_v_num_requested_branches, __pyx_t_7); -#line 206 "root_numpy/src/tree.pyx" - goto __pyx_L26; +#line 161 "root_numpy/src/tree.pyx" + goto __pyx_L6; -#line 206 "root_numpy/src/tree.pyx" - } +#line 161 "root_numpy/src/tree.pyx" + } -#line 206 "root_numpy/src/tree.pyx" - __pyx_L26:; +#line 161 "root_numpy/src/tree.pyx" + /*else*/ { - /* "root_numpy/src/tree.pyx":208 - * column_name.append(leaf_name) - * # Create a column for this branch/leaf pair - * col = new BranchColumn(column_name, tleaf) # <<<<<<<<<<<<<< + /* "root_numpy/src/tree.pyx":163 + * converter_buckets.assign(num_requested_branches, vector['Converter*']()) + * else: + * columns.reserve(num_branches) # <<<<<<<<<<<<<< + * converters.reserve(num_branches) * - * if num_requested_branches > 0: */ -#line 208 "root_numpy/src/tree.pyx" - __pyx_v_col = new BranchColumn(__pyx_v_column_name, __pyx_v_tleaf); +#line 163 "root_numpy/src/tree.pyx" + __pyx_v_columns.reserve(__pyx_v_num_branches); - /* "root_numpy/src/tree.pyx":210 - * col = new BranchColumn(column_name, tleaf) + /* "root_numpy/src/tree.pyx":164 + * else: + * columns.reserve(num_branches) + * converters.reserve(num_branches) # <<<<<<<<<<<<<< * - * if num_requested_branches > 0: # <<<<<<<<<<<<<< - * column_buckets[branch_idx].push_back(col) - * converter_buckets[branch_idx].push_back(conv) + * try: */ -#line 210 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); +#line 164 "root_numpy/src/tree.pyx" + __pyx_v_converters.reserve(__pyx_v_num_branches); -#line 210 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 164 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":211 +#line 164 "root_numpy/src/tree.pyx" + __pyx_L6:; + + /* "root_numpy/src/tree.pyx":166 + * converters.reserve(num_branches) * - * if num_requested_branches > 0: - * column_buckets[branch_idx].push_back(col) # <<<<<<<<<<<<<< - * converter_buckets[branch_idx].push_back(conv) - * else: + * try: # <<<<<<<<<<<<<< + * # Set up the selection if we have one + * if selection.size(): */ -#line 211 "root_numpy/src/tree.pyx" - (__pyx_v_column_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_col); +#line 166 "root_numpy/src/tree.pyx" + /*try:*/ { - /* "root_numpy/src/tree.pyx":212 - * if num_requested_branches > 0: - * column_buckets[branch_idx].push_back(col) - * converter_buckets[branch_idx].push_back(conv) # <<<<<<<<<<<<<< - * else: - * columns.push_back(col) + /* "root_numpy/src/tree.pyx":168 + * try: + * # Set up the selection if we have one + * if selection.size(): # <<<<<<<<<<<<<< + * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) + * if selection_formula == NULL or selection_formula.GetNdim() == 0: */ -#line 212 "root_numpy/src/tree.pyx" - (__pyx_v_converter_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_conv); +#line 168 "root_numpy/src/tree.pyx" + __pyx_t_3 = (__pyx_v_selection.size() != 0); -#line 212 "root_numpy/src/tree.pyx" - goto __pyx_L27; +#line 168 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 212 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":169 + * # Set up the selection if we have one + * if selection.size(): + * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) # <<<<<<<<<<<<<< + * if selection_formula == NULL or selection_formula.GetNdim() == 0: + * del selection_formula + */ -#line 212 "root_numpy/src/tree.pyx" - /*else*/ { +#line 169 "root_numpy/src/tree.pyx" + __pyx_v_selection_formula = new TTreeFormula(__pyx_k_selection, __pyx_v_selection.c_str(), __pyx_v_tree); - /* "root_numpy/src/tree.pyx":214 - * converter_buckets[branch_idx].push_back(conv) - * else: - * columns.push_back(col) # <<<<<<<<<<<<<< - * converters.push_back(conv) - * + /* "root_numpy/src/tree.pyx":170 + * if selection.size(): + * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) + * if selection_formula == NULL or selection_formula.GetNdim() == 0: # <<<<<<<<<<<<<< + * del selection_formula + * raise ValueError( */ -#line 214 "root_numpy/src/tree.pyx" - __pyx_v_columns.push_back(__pyx_v_col); +#line 170 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_selection_formula == NULL) != 0); - /* "root_numpy/src/tree.pyx":215 - * else: - * columns.push_back(col) - * converters.push_back(conv) # <<<<<<<<<<<<<< - * - * chain.AddColumn(string(branch_name), string(leaf_name), - */ +#line 170 "root_numpy/src/tree.pyx" + if (!__pyx_t_1) { -#line 215 "root_numpy/src/tree.pyx" - __pyx_v_converters.push_back(__pyx_v_conv); +#line 170 "root_numpy/src/tree.pyx" + } else { -#line 215 "root_numpy/src/tree.pyx" - } +#line 170 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_t_1; -#line 215 "root_numpy/src/tree.pyx" - __pyx_L27:; +#line 170 "root_numpy/src/tree.pyx" + goto __pyx_L12_bool_binop_done; - /* "root_numpy/src/tree.pyx":217 - * converters.push_back(conv) - * - * chain.AddColumn(string(branch_name), string(leaf_name), # <<<<<<<<<<<<<< - * col) - * - */ +#line 170 "root_numpy/src/tree.pyx" + } -#line 217 "root_numpy/src/tree.pyx" - try { +#line 170 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_selection_formula->GetNdim() == 0) != 0); -#line 217 "root_numpy/src/tree.pyx" - __pyx_t_17 = std::string(__pyx_v_branch_name); +#line 170 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_t_1; -#line 217 "root_numpy/src/tree.pyx" - } catch(...) { +#line 170 "root_numpy/src/tree.pyx" + __pyx_L12_bool_binop_done:; -#line 217 "root_numpy/src/tree.pyx" - __Pyx_CppExn2PyErr(); +#line 170 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 217 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":171 + * selection_formula = new TTreeFormula("selection", selection.c_str(), tree) + * if selection_formula == NULL or selection_formula.GetNdim() == 0: + * del selection_formula # <<<<<<<<<<<<<< + * raise ValueError( + * "could not compile selection expression '{0}'".format(selection)) + */ -#line 217 "root_numpy/src/tree.pyx" - } +#line 171 "root_numpy/src/tree.pyx" + delete __pyx_v_selection_formula; -#line 217 "root_numpy/src/tree.pyx" - try { + /* "root_numpy/src/tree.pyx":173 + * del selection_formula + * raise ValueError( + * "could not compile selection expression '{0}'".format(selection)) # <<<<<<<<<<<<<< + * # The chain will take care of updating the formula leaves when + * # rolling over to the next tree. + */ -#line 217 "root_numpy/src/tree.pyx" - __pyx_t_18 = std::string(__pyx_v_leaf_name); +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_could_not_compile_selection_expr, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 217 "root_numpy/src/tree.pyx" - } catch(...) { +#line 173 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 217 "root_numpy/src/tree.pyx" - __Pyx_CppExn2PyErr(); +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_9 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_selection); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 217 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 173 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 217 "root_numpy/src/tree.pyx" - } +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_10 = NULL; - /* "root_numpy/src/tree.pyx":218 - * - * chain.AddColumn(string(branch_name), string(leaf_name), - * col) # <<<<<<<<<<<<<< - * - * elif num_requested_branches > 0: - */ +#line 173 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { -#line 218 "root_numpy/src/tree.pyx" - __pyx_v_chain->AddColumn(__pyx_t_17, __pyx_t_18, ((BranchColumn *)__pyx_v_col)); +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8); -#line 218 "root_numpy/src/tree.pyx" - goto __pyx_L25; +#line 173 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_10)) { -#line 218 "root_numpy/src/tree.pyx" - } +#line 173 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - /* "root_numpy/src/tree.pyx":220 - * col) - * - * elif num_requested_branches > 0: # <<<<<<<<<<<<<< - * # User explicitly requested this branch but there is no - * # converter to handle it - */ +#line 173 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_10); -#line 220 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); +#line 173 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 220 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 173 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_8, function); - /* "root_numpy/src/tree.pyx":225 - * raise TypeError( - * "cannot convert leaf '{0}' of branch '{1}' " - * "with type '{2}'".format( # <<<<<<<<<<<<<< - * branch_name, leaf_name, - * resolve_type(tleaf.GetTypeName()))) - */ +#line 173 "root_numpy/src/tree.pyx" + } -#line 225 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_convert_leaf_0_of_branch, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 173 "root_numpy/src/tree.pyx" + } -#line 225 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 173 "root_numpy/src/tree.pyx" + if (!__pyx_t_10) { - /* "root_numpy/src/tree.pyx":226 - * "cannot convert leaf '{0}' of branch '{1}' " - * "with type '{2}'".format( - * branch_name, leaf_name, # <<<<<<<<<<<<<< - * resolve_type(tleaf.GetTypeName()))) - * else: - */ +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 226 "root_numpy/src/tree.pyx" - __pyx_t_10 = __Pyx_PyStr_FromString(__pyx_v_branch_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 173 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 226 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_10); +#line 173 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); + +#line 173 "root_numpy/src/tree.pyx" + } else { -#line 226 "root_numpy/src/tree.pyx" - __pyx_t_11 = __Pyx_PyStr_FromString(__pyx_v_leaf_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 226 "root_numpy/src/tree.pyx" +#line 173 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_11); - /* "root_numpy/src/tree.pyx":227 - * "with type '{2}'".format( - * branch_name, leaf_name, - * resolve_type(tleaf.GetTypeName()))) # <<<<<<<<<<<<<< - * else: - * # Just warn that this branch cannot be converted - */ +#line 173 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL; -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_9 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_tleaf->GetTypeName()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 173 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9); -#line 227 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 173 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_9); -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_19 = NULL; +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_9 = 0; -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 173 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 227 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { +#line 173 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_8); +#line 173 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; -#line 227 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_19)) { +#line 173 "root_numpy/src/tree.pyx" + } -#line 227 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); +#line 173 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 227 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_19); + /* "root_numpy/src/tree.pyx":172 + * if selection_formula == NULL or selection_formula.GetNdim() == 0: + * del selection_formula + * raise ValueError( # <<<<<<<<<<<<<< + * "could not compile selection expression '{0}'".format(selection)) + * # The chain will take care of updating the formula leaves when + */ -#line 227 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 172 "root_numpy/src/tree.pyx" + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 227 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_8, function); +#line 172 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_4 = 1; +#line 172 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); -#line 227 "root_numpy/src/tree.pyx" - } +#line 172 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); -#line 227 "root_numpy/src/tree.pyx" - } +#line 172 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_20 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 172 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 227 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 172 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 227 "root_numpy/src/tree.pyx" - if (__pyx_t_19) { +#line 172 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 227 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __Pyx_GIVEREF(__pyx_t_19); __pyx_t_19 = NULL; +#line 172 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 227 "root_numpy/src/tree.pyx" - } +#line 172 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 227 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_4, __pyx_t_10); +#line 172 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 227 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_10); +#line 172 "root_numpy/src/tree.pyx" + } -#line 227 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_4, __pyx_t_11); + /* "root_numpy/src/tree.pyx":176 + * # The chain will take care of updating the formula leaves when + * # rolling over to the next tree. + * chain.AddFormula(selection_formula) # <<<<<<<<<<<<<< + * + * branch_dict = None + */ -#line 227 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_11); +#line 176 "root_numpy/src/tree.pyx" + __pyx_v_chain->AddFormula(__pyx_v_selection_formula); -#line 227 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_4, __pyx_t_9); +#line 176 "root_numpy/src/tree.pyx" + goto __pyx_L10; -#line 227 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_9); +#line 176 "root_numpy/src/tree.pyx" + } -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_10 = 0; +#line 176 "root_numpy/src/tree.pyx" + __pyx_L10:; -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_11 = 0; + /* "root_numpy/src/tree.pyx":178 + * chain.AddFormula(selection_formula) + * + * branch_dict = None # <<<<<<<<<<<<<< + * if num_requested_branches > 0: + * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) + */ -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_9 = 0; +#line 178 "root_numpy/src/tree.pyx" + __Pyx_INCREF(Py_None); -#line 227 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 178 "root_numpy/src/tree.pyx" + __pyx_v_branch_dict = Py_None; -#line 227 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); + /* "root_numpy/src/tree.pyx":179 + * + * branch_dict = None + * if num_requested_branches > 0: # <<<<<<<<<<<<<< + * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) + * if len(branch_dict) != num_requested_branches: + */ -#line 227 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 179 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); -#line 227 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 179 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":223 - * # User explicitly requested this branch but there is no - * # converter to handle it - * raise TypeError( # <<<<<<<<<<<<<< - * "cannot convert leaf '{0}' of branch '{1}' " - * "with type '{2}'".format( + /* "root_numpy/src/tree.pyx":180 + * branch_dict = None + * if num_requested_branches > 0: + * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) # <<<<<<<<<<<<<< + * if len(branch_dict) != num_requested_branches: + * raise ValueError("duplicate branches requested") */ -#line 223 "root_numpy/src/tree.pyx" - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 223 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 223 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_int_0); -#line 223 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_8 = __pyx_int_0; -#line 223 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 180 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_v_branches)) || PyTuple_CheckExact(__pyx_v_branches)) { -#line 223 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_11 = __pyx_v_branches; __Pyx_INCREF(__pyx_t_11); __pyx_t_4 = 0; -#line 223 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_12 = NULL; -#line 223 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 180 "root_numpy/src/tree.pyx" + } else { + __pyx_t_4 = -1; +#line 180 "root_numpy/src/tree.pyx" +__pyx_t_11 = PyObject_GetIter(__pyx_v_branches); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 223 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_11); -#line 223 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 223 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + } -#line 223 "root_numpy/src/tree.pyx" - } +#line 180 "root_numpy/src/tree.pyx" + for (;;) { -#line 223 "root_numpy/src/tree.pyx" - /*else*/ { +#line 180 "root_numpy/src/tree.pyx" + if (likely(!__pyx_t_12)) { - /* "root_numpy/src/tree.pyx":230 - * else: - * # Just warn that this branch cannot be converted - * warnings.warn( # <<<<<<<<<<<<<< - * "cannot convert leaf '{0}' of branch '{1}' " - * "with type '{2}' (skipping)".format( - */ +#line 180 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_11))) { -#line 230 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_11)) break; -#line 230 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 180 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 230 "root_numpy/src/tree.pyx" - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_warn); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 230 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 180 "root_numpy/src/tree.pyx" + #else -#line 230 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":232 - * warnings.warn( - * "cannot convert leaf '{0}' of branch '{1}' " - * "with type '{2}' (skipping)".format( # <<<<<<<<<<<<<< - * branch_name, leaf_name, - * resolve_type(tleaf.GetTypeName())), - */ +#line 180 "root_numpy/src/tree.pyx" + #endif -#line 232 "root_numpy/src/tree.pyx" - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_convert_leaf_0_of_branch_2, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + } else { -#line 232 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 180 "root_numpy/src/tree.pyx" + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_11)) break; - /* "root_numpy/src/tree.pyx":233 - * "cannot convert leaf '{0}' of branch '{1}' " - * "with type '{2}' (skipping)".format( - * branch_name, leaf_name, # <<<<<<<<<<<<<< - * resolve_type(tleaf.GetTypeName())), - * RootNumpyUnconvertibleWarning) - */ +#line 180 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 233 "root_numpy/src/tree.pyx" - __pyx_t_11 = __Pyx_PyStr_FromString(__pyx_v_branch_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_4); __Pyx_INCREF(__pyx_t_9); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 233 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_11); +#line 180 "root_numpy/src/tree.pyx" + #else -#line 233 "root_numpy/src/tree.pyx" - __pyx_t_10 = __Pyx_PyStr_FromString(__pyx_v_leaf_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = PySequence_ITEM(__pyx_t_11, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 233 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_10); +#line 180 "root_numpy/src/tree.pyx" + #endif - /* "root_numpy/src/tree.pyx":234 - * "with type '{2}' (skipping)".format( - * branch_name, leaf_name, - * resolve_type(tleaf.GetTypeName())), # <<<<<<<<<<<<<< - * RootNumpyUnconvertibleWarning) - * - */ +#line 180 "root_numpy/src/tree.pyx" + } + } else +#line 180 "root_numpy/src/tree.pyx" +{ -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_19 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_tleaf->GetTypeName()); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = __pyx_t_12(__pyx_t_11); -#line 234 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 180 "root_numpy/src/tree.pyx" + if (unlikely(!__pyx_t_9)) { -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_21 = NULL; +#line 180 "root_numpy/src/tree.pyx" + PyObject* exc_type = PyErr_Occurred(); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 180 "root_numpy/src/tree.pyx" + if (exc_type) { -#line 234 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { +#line 180 "root_numpy/src/tree.pyx" + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_9); +#line 180 "root_numpy/src/tree.pyx" + else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 234 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_21)) { +#line 180 "root_numpy/src/tree.pyx" + } -#line 234 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); +#line 180 "root_numpy/src/tree.pyx" + break; -#line 234 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_21); +#line 180 "root_numpy/src/tree.pyx" + } -#line 234 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 234 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_9, function); +#line 180 "root_numpy/src/tree.pyx" + } -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_4 = 1; +#line 180 "root_numpy/src/tree.pyx" + __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_9); -#line 234 "root_numpy/src/tree.pyx" - } +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = 0; -#line 234 "root_numpy/src/tree.pyx" - } +#line 180 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_8); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_22 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_8); -#line 234 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_22); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 234 "root_numpy/src/tree.pyx" - if (__pyx_t_21) { +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 234 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL; +#line 180 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); -#line 234 "root_numpy/src/tree.pyx" - } +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_8 = __pyx_t_9; -#line 234 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_4, __pyx_t_11); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = 0; -#line 234 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_11); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 234 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_4, __pyx_t_10); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 234 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_10); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_b); -#line 234 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_4, __pyx_t_19); +#line 180 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_b); -#line 234 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_19); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_b); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_11 = 0; +#line 180 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_idx); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_10 = 0; +#line 180 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_idx); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_19 = 0; +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_idx); -#line 234 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_22, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 234 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 234 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; +#line 180 "root_numpy/src/tree.pyx" + } -#line 234 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 180 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "root_numpy/src/tree.pyx":235 - * branch_name, leaf_name, - * resolve_type(tleaf.GetTypeName())), - * RootNumpyUnconvertibleWarning) # <<<<<<<<<<<<<< - * - * if num_requested_branches > 0: - */ +#line 180 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_RootNumpyUnconvertibleWarning); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 235 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_22 = NULL; +#line 180 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); -#line 235 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_20))) { +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 235 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_22)) { +#line 180 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 235 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 235 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_22); +#line 180 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_v_branch_dict, __pyx_t_2); -#line 235 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 180 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 235 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_20, function); + /* "root_numpy/src/tree.pyx":181 + * if num_requested_branches > 0: + * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) + * if len(branch_dict) != num_requested_branches: # <<<<<<<<<<<<<< + * raise ValueError("duplicate branches requested") + * + */ -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_4 = 1; +#line 181 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyObject_Length(__pyx_v_branch_dict); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 235 "root_numpy/src/tree.pyx" - } +#line 181 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_t_4 != __pyx_v_num_requested_branches) != 0); -#line 235 "root_numpy/src/tree.pyx" - } +#line 181 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":182 + * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) + * if len(branch_dict) != num_requested_branches: + * raise ValueError("duplicate branches requested") # <<<<<<<<<<<<<< + * + * # Build vector of Converters for branches + */ -#line 235 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 182 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 235 "root_numpy/src/tree.pyx" - if (__pyx_t_22) { +#line 182 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 235 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22); __Pyx_GIVEREF(__pyx_t_22); __pyx_t_22 = NULL; +#line 182 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 235 "root_numpy/src/tree.pyx" - } +#line 182 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 235 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_4, __pyx_t_8); +#line 182 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 235 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_8); +#line 182 "root_numpy/src/tree.pyx" + } -#line 235 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_4, __pyx_t_9); +#line 182 "root_numpy/src/tree.pyx" + goto __pyx_L14; -#line 235 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_9); +#line 182 "root_numpy/src/tree.pyx" + } -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_8 = 0; +#line 182 "root_numpy/src/tree.pyx" + __pyx_L14:; -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_9 = 0; + /* "root_numpy/src/tree.pyx":185 + * + * # Build vector of Converters for branches + * for ibranch in range(num_branches): # <<<<<<<<<<<<<< + * tbranch = branch_array.At(ibranch) + * branch_name = tbranch.GetName() + */ -#line 235 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 185 "root_numpy/src/tree.pyx" + __pyx_t_13 = __pyx_v_num_branches; -#line 235 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 185 "root_numpy/src/tree.pyx" + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { -#line 235 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 185 "root_numpy/src/tree.pyx" + __pyx_v_ibranch = __pyx_t_14; -#line 235 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; + /* "root_numpy/src/tree.pyx":186 + * # Build vector of Converters for branches + * for ibranch in range(num_branches): + * tbranch = branch_array.At(ibranch) # <<<<<<<<<<<<<< + * branch_name = tbranch.GetName() + * if num_requested_branches > 0: + */ -#line 235 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 186 "root_numpy/src/tree.pyx" + __pyx_v_tbranch = ((TBranch *)__pyx_v_branch_array->At(__pyx_v_ibranch)); -#line 235 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":187 + * for ibranch in range(num_branches): + * tbranch = branch_array.At(ibranch) + * branch_name = tbranch.GetName() # <<<<<<<<<<<<<< + * if num_requested_branches > 0: + * if len(branch_dict) == 0: + */ -#line 235 "root_numpy/src/tree.pyx" - __pyx_L25:; +#line 187 "root_numpy/src/tree.pyx" + __pyx_v_branch_name = __pyx_v_tbranch->GetName(); -#line 235 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":188 + * tbranch = branch_array.At(ibranch) + * branch_name = tbranch.GetName() + * if num_requested_branches > 0: # <<<<<<<<<<<<<< + * if len(branch_dict) == 0: + * # No more branches to consider + */ -#line 235 "root_numpy/src/tree.pyx" - __pyx_L18_continue:; +#line 188 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); -#line 235 "root_numpy/src/tree.pyx" - } +#line 188 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 235 "root_numpy/src/tree.pyx" - __pyx_L19_break:; + /* "root_numpy/src/tree.pyx":189 + * branch_name = tbranch.GetName() + * if num_requested_branches > 0: + * if len(branch_dict) == 0: # <<<<<<<<<<<<<< + * # No more branches to consider + * break + */ - /* "root_numpy/src/tree.pyx":237 - * RootNumpyUnconvertibleWarning) - * - * if num_requested_branches > 0: # <<<<<<<<<<<<<< - * # Attempt to interpret remaining "branches" as expressions - * for expression in branch_dict.keys(): +#line 189 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyObject_Length(__pyx_v_branch_dict); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + +#line 189 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_t_4 == 0) != 0); + +#line 189 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { + + /* "root_numpy/src/tree.pyx":191 + * if len(branch_dict) == 0: + * # No more branches to consider + * break # <<<<<<<<<<<<<< + * branch_idx = branch_dict.pop(branch_name, -1) + * if branch_idx == -1: */ -#line 237 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); +#line 191 "root_numpy/src/tree.pyx" + goto __pyx_L19_break; -#line 237 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 191 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":239 - * if num_requested_branches > 0: - * # Attempt to interpret remaining "branches" as expressions - * for expression in branch_dict.keys(): # <<<<<<<<<<<<<< - * branch_idx = branch_dict[expression] - * c_string = expression + /* "root_numpy/src/tree.pyx":192 + * # No more branches to consider + * break + * branch_idx = branch_dict.pop(branch_name, -1) # <<<<<<<<<<<<<< + * if branch_idx == -1: + * # This branch was not selected by the user */ -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_branch_dict, __pyx_n_s_keys); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_branch_dict, __pyx_n_s_pop); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 192 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_19 = NULL; +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_11 = __Pyx_PyStr_FromString(__pyx_v_branch_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_20))) { +#line 192 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_11); -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_9 = NULL; -#line 239 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_19)) { +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; -#line 239 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); +#line 192 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { -#line 239 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_19); +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); -#line 239 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 192 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_9)) { -#line 239 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_20, function); +#line 192 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); -#line 239 "root_numpy/src/tree.pyx" - } +#line 192 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_9); -#line 239 "root_numpy/src/tree.pyx" - } +#line 192 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 239 "root_numpy/src/tree.pyx" - if (__pyx_t_19) { +#line 192 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_8, function); -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_4 = 1; -#line 239 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 192 "root_numpy/src/tree.pyx" + } -#line 239 "root_numpy/src/tree.pyx" - } else { +#line 192 "root_numpy/src/tree.pyx" + } -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - } +#line 192 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_10); -#line 239 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 192 "root_numpy/src/tree.pyx" + if (__pyx_t_9) { -#line 239 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 192 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; -#line 239 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { +#line 192 "root_numpy/src/tree.pyx" + } -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_20 = __pyx_t_2; __Pyx_INCREF(__pyx_t_20); __pyx_t_4 = 0; +#line 192 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_t_11); -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_12 = NULL; +#line 192 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_11); -#line 239 "root_numpy/src/tree.pyx" - } else { - __pyx_t_4 = -1; -#line 239 "root_numpy/src/tree.pyx" -__pyx_t_20 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 192 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_int_neg_1); -#line 239 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 192 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_int_neg_1); -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_12 = Py_TYPE(__pyx_t_20)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 192 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_int_neg_1); -#line 239 "root_numpy/src/tree.pyx" - } +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_11 = 0; -#line 239 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - for (;;) { +#line 192 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 239 "root_numpy/src/tree.pyx" - if (likely(!__pyx_t_12)) { +#line 192 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 239 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_20))) { +#line 192 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 239 "root_numpy/src/tree.pyx" - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_20)) break; +#line 192 "root_numpy/src/tree.pyx" + __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 192 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 192 "root_numpy/src/tree.pyx" + __pyx_v_branch_idx = __pyx_t_15; -#line 239 "root_numpy/src/tree.pyx" - #else + /* "root_numpy/src/tree.pyx":193 + * break + * branch_idx = branch_dict.pop(branch_name, -1) + * if branch_idx == -1: # <<<<<<<<<<<<<< + * # This branch was not selected by the user + * continue + */ -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = PySequence_ITEM(__pyx_t_20, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 193 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_branch_idx == -1) != 0); -#line 239 "root_numpy/src/tree.pyx" - #endif +#line 193 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 239 "root_numpy/src/tree.pyx" - } else { + /* "root_numpy/src/tree.pyx":195 + * if branch_idx == -1: + * # This branch was not selected by the user + * continue # <<<<<<<<<<<<<< + * + * branch_title = string(tbranch.GetTitle()) + */ -#line 239 "root_numpy/src/tree.pyx" - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_20)) break; +#line 195 "root_numpy/src/tree.pyx" + goto __pyx_L18_continue; -#line 239 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 195 "root_numpy/src/tree.pyx" + } -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_20, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 195 "root_numpy/src/tree.pyx" + goto __pyx_L20; -#line 239 "root_numpy/src/tree.pyx" - #else +#line 195 "root_numpy/src/tree.pyx" + } -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = PySequence_ITEM(__pyx_t_20, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 195 "root_numpy/src/tree.pyx" + __pyx_L20:; -#line 239 "root_numpy/src/tree.pyx" - #endif + /* "root_numpy/src/tree.pyx":197 + * continue + * + * branch_title = string(tbranch.GetTitle()) # <<<<<<<<<<<<<< + * branch_title_size = branch_title.size() + * if branch_title_size > 2 and branch_title[branch_title_size - 2] == '/': + */ -#line 239 "root_numpy/src/tree.pyx" - } - } else -#line 239 "root_numpy/src/tree.pyx" -{ +#line 197 "root_numpy/src/tree.pyx" + try { -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_t_12(__pyx_t_20); +#line 197 "root_numpy/src/tree.pyx" + __pyx_t_16 = std::string(__pyx_v_tbranch->GetTitle()); -#line 239 "root_numpy/src/tree.pyx" - if (unlikely(!__pyx_t_2)) { +#line 197 "root_numpy/src/tree.pyx" + } catch(...) { -#line 239 "root_numpy/src/tree.pyx" - PyObject* exc_type = PyErr_Occurred(); +#line 197 "root_numpy/src/tree.pyx" + __Pyx_CppExn2PyErr(); -#line 239 "root_numpy/src/tree.pyx" - if (exc_type) { +#line 197 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); +#line 197 "root_numpy/src/tree.pyx" + } -#line 239 "root_numpy/src/tree.pyx" - else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 197 "root_numpy/src/tree.pyx" + __pyx_v_branch_title = __pyx_t_16; -#line 239 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":198 + * + * branch_title = string(tbranch.GetTitle()) + * branch_title_size = branch_title.size() # <<<<<<<<<<<<<< + * if branch_title_size > 2 and branch_title[branch_title_size - 2] == '/': + * type_code = branch_title[branch_title_size - 1] + */ -#line 239 "root_numpy/src/tree.pyx" - break; +#line 198 "root_numpy/src/tree.pyx" + __pyx_v_branch_title_size = __pyx_v_branch_title.size(); -#line 239 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":199 + * branch_title = string(tbranch.GetTitle()) + * branch_title_size = branch_title.size() + * if branch_title_size > 2 and branch_title[branch_title_size - 2] == '/': # <<<<<<<<<<<<<< + * type_code = branch_title[branch_title_size - 1] + * else: + */ -#line 239 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 199 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_branch_title_size > 2) != 0); -#line 239 "root_numpy/src/tree.pyx" - } +#line 199 "root_numpy/src/tree.pyx" + if (__pyx_t_1) { -#line 239 "root_numpy/src/tree.pyx" - __Pyx_XDECREF_SET(__pyx_v_expression, __pyx_t_2); +#line 199 "root_numpy/src/tree.pyx" + } else { -#line 239 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 199 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_t_1; - /* "root_numpy/src/tree.pyx":240 - * # Attempt to interpret remaining "branches" as expressions - * for expression in branch_dict.keys(): - * branch_idx = branch_dict[expression] # <<<<<<<<<<<<<< - * c_string = expression - * formula = new TTreeFormula(c_string, c_string, tree) - */ +#line 199 "root_numpy/src/tree.pyx" + goto __pyx_L24_bool_binop_done; -#line 240 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyObject_GetItem(__pyx_v_branch_dict, __pyx_v_expression); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L8_error;}; +#line 199 "root_numpy/src/tree.pyx" + } -#line 240 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 199 "root_numpy/src/tree.pyx" + __pyx_t_1 = (((__pyx_v_branch_title[(__pyx_v_branch_title_size - 2)]) == '/') != 0); -#line 240 "root_numpy/src/tree.pyx" - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 199 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_t_1; -#line 240 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 199 "root_numpy/src/tree.pyx" + __pyx_L24_bool_binop_done:; -#line 240 "root_numpy/src/tree.pyx" - __pyx_v_branch_idx = __pyx_t_13; +#line 199 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":241 - * for expression in branch_dict.keys(): - * branch_idx = branch_dict[expression] - * c_string = expression # <<<<<<<<<<<<<< - * formula = new TTreeFormula(c_string, c_string, tree) - * if formula == NULL or formula.GetNdim() == 0: + /* "root_numpy/src/tree.pyx":200 + * branch_title_size = branch_title.size() + * if branch_title_size > 2 and branch_title[branch_title_size - 2] == '/': + * type_code = branch_title[branch_title_size - 1] # <<<<<<<<<<<<<< + * else: + * type_code = '\0' */ -#line 241 "root_numpy/src/tree.pyx" - __pyx_t_23 = __Pyx_PyObject_AsString(__pyx_v_expression); if (unlikely((!__pyx_t_23) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 200 "root_numpy/src/tree.pyx" + __pyx_v_type_code = (__pyx_v_branch_title[(__pyx_v_branch_title_size - 1)]); -#line 241 "root_numpy/src/tree.pyx" - __pyx_v_c_string = __pyx_t_23; +#line 200 "root_numpy/src/tree.pyx" + goto __pyx_L23; - /* "root_numpy/src/tree.pyx":242 - * branch_idx = branch_dict[expression] - * c_string = expression - * formula = new TTreeFormula(c_string, c_string, tree) # <<<<<<<<<<<<<< - * if formula == NULL or formula.GetNdim() == 0: - * del formula - */ +#line 200 "root_numpy/src/tree.pyx" + } -#line 242 "root_numpy/src/tree.pyx" - __pyx_v_formula = new TTreeFormula(__pyx_v_c_string, __pyx_v_c_string, __pyx_v_tree); +#line 200 "root_numpy/src/tree.pyx" + /*else*/ { - /* "root_numpy/src/tree.pyx":243 - * c_string = expression - * formula = new TTreeFormula(c_string, c_string, tree) - * if formula == NULL or formula.GetNdim() == 0: # <<<<<<<<<<<<<< - * del formula - * raise ValueError( + /* "root_numpy/src/tree.pyx":202 + * type_code = branch_title[branch_title_size - 1] + * else: + * type_code = '\0' # <<<<<<<<<<<<<< + * leaf_array = tbranch.GetListOfLeaves() + * shortname = leaf_array.GetEntries() == 1 */ -#line 243 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_formula == NULL) != 0); - -#line 243 "root_numpy/src/tree.pyx" - if (!__pyx_t_1) { +#line 202 "root_numpy/src/tree.pyx" + __pyx_v_type_code = '\x00'; -#line 243 "root_numpy/src/tree.pyx" - } else { +#line 202 "root_numpy/src/tree.pyx" + } -#line 243 "root_numpy/src/tree.pyx" - __pyx_t_3 = __pyx_t_1; +#line 202 "root_numpy/src/tree.pyx" + __pyx_L23:; -#line 243 "root_numpy/src/tree.pyx" - goto __pyx_L32_bool_binop_done; + /* "root_numpy/src/tree.pyx":203 + * else: + * type_code = '\0' + * leaf_array = tbranch.GetListOfLeaves() # <<<<<<<<<<<<<< + * shortname = leaf_array.GetEntries() == 1 + * + */ -#line 243 "root_numpy/src/tree.pyx" - } +#line 203 "root_numpy/src/tree.pyx" + __pyx_v_leaf_array = __pyx_v_tbranch->GetListOfLeaves(); -#line 243 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((__pyx_v_formula->GetNdim() == 0) != 0); + /* "root_numpy/src/tree.pyx":204 + * type_code = '\0' + * leaf_array = tbranch.GetListOfLeaves() + * shortname = leaf_array.GetEntries() == 1 # <<<<<<<<<<<<<< + * + * for ileaf in range(leaf_array.GetEntries()): + */ -#line 243 "root_numpy/src/tree.pyx" - __pyx_t_3 = __pyx_t_1; +#line 204 "root_numpy/src/tree.pyx" + __pyx_v_shortname = (__pyx_v_leaf_array->GetEntries() == 1); -#line 243 "root_numpy/src/tree.pyx" - __pyx_L32_bool_binop_done:; + /* "root_numpy/src/tree.pyx":206 + * shortname = leaf_array.GetEntries() == 1 + * + * for ileaf in range(leaf_array.GetEntries()): # <<<<<<<<<<<<<< + * tleaf = leaf_array.At(ileaf) + * leaf_name = tleaf.GetName() + */ -#line 243 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 206 "root_numpy/src/tree.pyx" + __pyx_t_15 = __pyx_v_leaf_array->GetEntries(); - /* "root_numpy/src/tree.pyx":244 - * formula = new TTreeFormula(c_string, c_string, tree) - * if formula == NULL or formula.GetNdim() == 0: - * del formula # <<<<<<<<<<<<<< - * raise ValueError( - * "the branch or expression '{0}' " - */ +#line 206 "root_numpy/src/tree.pyx" + for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_15; __pyx_t_17+=1) { -#line 244 "root_numpy/src/tree.pyx" - delete __pyx_v_formula; +#line 206 "root_numpy/src/tree.pyx" + __pyx_v_ileaf = __pyx_t_17; - /* "root_numpy/src/tree.pyx":247 - * raise ValueError( - * "the branch or expression '{0}' " - * "is not present or valid".format(expression)) # <<<<<<<<<<<<<< - * # The chain will take care of updating the formula leaves when - * # rolling over to the next tree. + /* "root_numpy/src/tree.pyx":207 + * + * for ileaf in range(leaf_array.GetEntries()): + * tleaf = leaf_array.At(ileaf) # <<<<<<<<<<<<<< + * leaf_name = tleaf.GetName() + * conv = get_converter(tleaf, type_code) */ -#line 247 "root_numpy/src/tree.pyx" - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_the_branch_or_expression_0_is_no, __pyx_n_s_format); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 207 "root_numpy/src/tree.pyx" + __pyx_v_tleaf = ((TLeaf *)__pyx_v_leaf_array->At(__pyx_v_ileaf)); -#line 247 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); + /* "root_numpy/src/tree.pyx":208 + * for ileaf in range(leaf_array.GetEntries()): + * tleaf = leaf_array.At(ileaf) + * leaf_name = tleaf.GetName() # <<<<<<<<<<<<<< + * conv = get_converter(tleaf, type_code) + * if conv != NULL: + */ -#line 247 "root_numpy/src/tree.pyx" - __pyx_t_9 = NULL; +#line 208 "root_numpy/src/tree.pyx" + __pyx_v_leaf_name = __pyx_v_tleaf->GetName(); -#line 247 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) { + /* "root_numpy/src/tree.pyx":209 + * tleaf = leaf_array.At(ileaf) + * leaf_name = tleaf.GetName() + * conv = get_converter(tleaf, type_code) # <<<<<<<<<<<<<< + * if conv != NULL: + * # A converter exists for this leaf + */ -#line 247 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_19); +#line 209 "root_numpy/src/tree.pyx" + __pyx_v_conv = __pyx_f_13_librootnumpy_get_converter(__pyx_v_tleaf, __pyx_v_type_code); -#line 247 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_9)) { + /* "root_numpy/src/tree.pyx":210 + * leaf_name = tleaf.GetName() + * conv = get_converter(tleaf, type_code) + * if conv != NULL: # <<<<<<<<<<<<<< + * # A converter exists for this leaf + * column_name = string(branch_name) + */ -#line 247 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); +#line 210 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_conv != NULL) != 0); -#line 247 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_9); +#line 210 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 247 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); + /* "root_numpy/src/tree.pyx":212 + * if conv != NULL: + * # A converter exists for this leaf + * column_name = string(branch_name) # <<<<<<<<<<<<<< + * if not shortname: + * column_name.append( '_') + */ -#line 247 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_19, function); +#line 212 "root_numpy/src/tree.pyx" + try { -#line 247 "root_numpy/src/tree.pyx" - } +#line 212 "root_numpy/src/tree.pyx" + __pyx_t_16 = std::string(__pyx_v_branch_name); -#line 247 "root_numpy/src/tree.pyx" - } +#line 212 "root_numpy/src/tree.pyx" + } catch(...) { -#line 247 "root_numpy/src/tree.pyx" - if (!__pyx_t_9) { +#line 212 "root_numpy/src/tree.pyx" + __Pyx_CppExn2PyErr(); -#line 247 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_expression); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 212 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 247 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 212 "root_numpy/src/tree.pyx" + } -#line 247 "root_numpy/src/tree.pyx" - } else { +#line 212 "root_numpy/src/tree.pyx" + __pyx_v_column_name = __pyx_t_16; -#line 247 "root_numpy/src/tree.pyx" - __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":213 + * # A converter exists for this leaf + * column_name = string(branch_name) + * if not shortname: # <<<<<<<<<<<<<< + * column_name.append( '_') + * column_name.append(leaf_name) + */ -#line 247 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 213 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((!(__pyx_v_shortname != 0)) != 0); -#line 247 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; +#line 213 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 247 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_expression); + /* "root_numpy/src/tree.pyx":214 + * column_name = string(branch_name) + * if not shortname: + * column_name.append( '_') # <<<<<<<<<<<<<< + * column_name.append(leaf_name) + * # Create a column for this branch/leaf pair + */ -#line 247 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_expression); +#line 214 "root_numpy/src/tree.pyx" + __pyx_t_16 = __pyx_convert_string_from_py_std__string(__pyx_n_b__21); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 247 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_expression); +#line 214 "root_numpy/src/tree.pyx" + __pyx_v_column_name.append(((std::string)__pyx_t_16)); -#line 247 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":215 + * if not shortname: + * column_name.append( '_') + * column_name.append(leaf_name) # <<<<<<<<<<<<<< + * # Create a column for this branch/leaf pair + * col = new BranchColumn(column_name, tleaf) + */ -#line 247 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 215 "root_numpy/src/tree.pyx" + __pyx_v_column_name.append(__pyx_v_leaf_name); -#line 247 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 215 "root_numpy/src/tree.pyx" + goto __pyx_L29; -#line 247 "root_numpy/src/tree.pyx" +#line 215 "root_numpy/src/tree.pyx" } -#line 247 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 215 "root_numpy/src/tree.pyx" + __pyx_L29:; - /* "root_numpy/src/tree.pyx":245 - * if formula == NULL or formula.GetNdim() == 0: - * del formula - * raise ValueError( # <<<<<<<<<<<<<< - * "the branch or expression '{0}' " - * "is not present or valid".format(expression)) + /* "root_numpy/src/tree.pyx":217 + * column_name.append(leaf_name) + * # Create a column for this branch/leaf pair + * col = new BranchColumn(column_name, tleaf) # <<<<<<<<<<<<<< + * + * if num_requested_branches > 0: */ -#line 245 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - -#line 245 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 217 "root_numpy/src/tree.pyx" + __pyx_v_col = new BranchColumn(__pyx_v_column_name, __pyx_v_tleaf); -#line 245 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); + /* "root_numpy/src/tree.pyx":219 + * col = new BranchColumn(column_name, tleaf) + * + * if num_requested_branches > 0: # <<<<<<<<<<<<<< + * column_buckets[branch_idx].push_back(col) + * converter_buckets[branch_idx].push_back(conv) + */ -#line 245 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 219 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); -#line 245 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 219 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 245 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":220 + * + * if num_requested_branches > 0: + * column_buckets[branch_idx].push_back(col) # <<<<<<<<<<<<<< + * converter_buckets[branch_idx].push_back(conv) + * else: + */ -#line 245 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 220 "root_numpy/src/tree.pyx" + (__pyx_v_column_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_col); -#line 245 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; + /* "root_numpy/src/tree.pyx":221 + * if num_requested_branches > 0: + * column_buckets[branch_idx].push_back(col) + * converter_buckets[branch_idx].push_back(conv) # <<<<<<<<<<<<<< + * else: + * columns.push_back(col) + */ -#line 245 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 221 "root_numpy/src/tree.pyx" + (__pyx_v_converter_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_conv); -#line 245 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 221 "root_numpy/src/tree.pyx" + goto __pyx_L30; -#line 245 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 221 "root_numpy/src/tree.pyx" + } -#line 245 "root_numpy/src/tree.pyx" - } +#line 221 "root_numpy/src/tree.pyx" + /*else*/ { - /* "root_numpy/src/tree.pyx":250 - * # The chain will take care of updating the formula leaves when - * # rolling over to the next tree. - * chain.AddFormula(formula) # <<<<<<<<<<<<<< - * col = new FormulaColumn(expression, formula) - * conv = find_converter_by_typename('double') + /* "root_numpy/src/tree.pyx":223 + * converter_buckets[branch_idx].push_back(conv) + * else: + * columns.push_back(col) # <<<<<<<<<<<<<< + * converters.push_back(conv) + * */ -#line 250 "root_numpy/src/tree.pyx" - __pyx_v_chain->AddFormula(__pyx_v_formula); +#line 223 "root_numpy/src/tree.pyx" + __pyx_v_columns.push_back(__pyx_v_col); - /* "root_numpy/src/tree.pyx":251 - * # rolling over to the next tree. - * chain.AddFormula(formula) - * col = new FormulaColumn(expression, formula) # <<<<<<<<<<<<<< - * conv = find_converter_by_typename('double') - * if conv == NULL: + /* "root_numpy/src/tree.pyx":224 + * else: + * columns.push_back(col) + * converters.push_back(conv) # <<<<<<<<<<<<<< + * + * chain.AddColumn(string(branch_name), string(leaf_name), */ -#line 251 "root_numpy/src/tree.pyx" - __pyx_t_18 = __pyx_convert_string_from_py_std__string(__pyx_v_expression); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 224 "root_numpy/src/tree.pyx" + __pyx_v_converters.push_back(__pyx_v_conv); -#line 251 "root_numpy/src/tree.pyx" - __pyx_v_col = new FormulaColumn(__pyx_t_18, __pyx_v_formula); +#line 224 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":252 - * chain.AddFormula(formula) - * col = new FormulaColumn(expression, formula) - * conv = find_converter_by_typename('double') # <<<<<<<<<<<<<< - * if conv == NULL: - * # Oops, this should never happen +#line 224 "root_numpy/src/tree.pyx" + __pyx_L30:; + + /* "root_numpy/src/tree.pyx":226 + * converters.push_back(conv) + * + * chain.AddColumn(string(branch_name), string(leaf_name), # <<<<<<<<<<<<<< + * col) + * */ -#line 252 "root_numpy/src/tree.pyx" - __pyx_t_18 = __pyx_convert_string_from_py_std__string(__pyx_n_b_double); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 226 "root_numpy/src/tree.pyx" + try { -#line 252 "root_numpy/src/tree.pyx" - __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_18); +#line 226 "root_numpy/src/tree.pyx" + __pyx_t_16 = std::string(__pyx_v_branch_name); - /* "root_numpy/src/tree.pyx":253 - * col = new FormulaColumn(expression, formula) - * conv = find_converter_by_typename('double') - * if conv == NULL: # <<<<<<<<<<<<<< - * # Oops, this should never happen - * raise AssertionError( - */ +#line 226 "root_numpy/src/tree.pyx" + } catch(...) { -#line 253 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_conv == NULL) != 0); +#line 226 "root_numpy/src/tree.pyx" + __Pyx_CppExn2PyErr(); -#line 253 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 226 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":255 - * if conv == NULL: - * # Oops, this should never happen - * raise AssertionError( # <<<<<<<<<<<<<< - * "could not find double converter for formula") - * - */ +#line 226 "root_numpy/src/tree.pyx" + } -#line 255 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 226 "root_numpy/src/tree.pyx" + try { -#line 255 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 226 "root_numpy/src/tree.pyx" + __pyx_t_18 = std::string(__pyx_v_leaf_name); -#line 255 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_2, 0, 0, 0); +#line 226 "root_numpy/src/tree.pyx" + } catch(...) { -#line 255 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 226 "root_numpy/src/tree.pyx" + __Pyx_CppExn2PyErr(); -#line 255 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 226 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 255 "root_numpy/src/tree.pyx" - } +#line 226 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":258 - * "could not find double converter for formula") + /* "root_numpy/src/tree.pyx":227 * - * column_buckets[branch_idx].push_back(col) # <<<<<<<<<<<<<< - * converter_buckets[branch_idx].push_back(conv) + * chain.AddColumn(string(branch_name), string(leaf_name), + * col) # <<<<<<<<<<<<<< * + * elif num_requested_branches > 0: */ -#line 258 "root_numpy/src/tree.pyx" - (__pyx_v_column_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_col); +#line 227 "root_numpy/src/tree.pyx" + __pyx_v_chain->AddColumn(__pyx_t_16, __pyx_t_18, ((BranchColumn *)__pyx_v_col)); - /* "root_numpy/src/tree.pyx":259 - * - * column_buckets[branch_idx].push_back(col) - * converter_buckets[branch_idx].push_back(conv) # <<<<<<<<<<<<<< +#line 227 "root_numpy/src/tree.pyx" + goto __pyx_L28; + +#line 227 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":229 + * col) * - * # Flatten buckets into 1D vectors, thus preserving branch order + * elif num_requested_branches > 0: # <<<<<<<<<<<<<< + * # User explicitly requested this branch but there is no + * # converter to handle it */ -#line 259 "root_numpy/src/tree.pyx" - (__pyx_v_converter_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_conv); +#line 229 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); - /* "root_numpy/src/tree.pyx":239 - * if num_requested_branches > 0: - * # Attempt to interpret remaining "branches" as expressions - * for expression in branch_dict.keys(): # <<<<<<<<<<<<<< - * branch_idx = branch_dict[expression] - * c_string = expression +#line 229 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { + + /* "root_numpy/src/tree.pyx":234 + * raise TypeError( + * "cannot convert leaf '{0}' of branch '{1}' " + * "with type '{2}'".format( # <<<<<<<<<<<<<< + * branch_name, leaf_name, + * resolve_type(tleaf.GetTypeName()))) */ -#line 239 "root_numpy/src/tree.pyx" - } +#line 234 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_convert_leaf_0_of_branch, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 239 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 234 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); - /* "root_numpy/src/tree.pyx":262 - * - * # Flatten buckets into 1D vectors, thus preserving branch order - * for branch_idx in range(num_requested_branches): # <<<<<<<<<<<<<< - * columns.insert(columns.end(), - * column_buckets[branch_idx].begin(), + /* "root_numpy/src/tree.pyx":235 + * "cannot convert leaf '{0}' of branch '{1}' " + * "with type '{2}'".format( + * branch_name, leaf_name, # <<<<<<<<<<<<<< + * resolve_type(tleaf.GetTypeName()))) + * else: */ -#line 262 "root_numpy/src/tree.pyx" - __pyx_t_13 = __pyx_v_num_requested_branches; - -#line 262 "root_numpy/src/tree.pyx" - for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { +#line 235 "root_numpy/src/tree.pyx" + __pyx_t_10 = __Pyx_PyStr_FromString(__pyx_v_branch_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 262 "root_numpy/src/tree.pyx" - __pyx_v_branch_idx = __pyx_t_14; +#line 235 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_10); - /* "root_numpy/src/tree.pyx":263 - * # Flatten buckets into 1D vectors, thus preserving branch order - * for branch_idx in range(num_requested_branches): - * columns.insert(columns.end(), # <<<<<<<<<<<<<< - * column_buckets[branch_idx].begin(), - * column_buckets[branch_idx].end()) - */ +#line 235 "root_numpy/src/tree.pyx" + __pyx_t_11 = __Pyx_PyStr_FromString(__pyx_v_leaf_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 263 "root_numpy/src/tree.pyx" - __pyx_v_columns.insert(__pyx_v_columns.end(), (__pyx_v_column_buckets[__pyx_v_branch_idx]).begin(), (__pyx_v_column_buckets[__pyx_v_branch_idx]).end()); +#line 235 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_11); - /* "root_numpy/src/tree.pyx":266 - * column_buckets[branch_idx].begin(), - * column_buckets[branch_idx].end()) - * converters.insert(converters.end(), # <<<<<<<<<<<<<< - * converter_buckets[branch_idx].begin(), - * converter_buckets[branch_idx].end()) + /* "root_numpy/src/tree.pyx":236 + * "with type '{2}'".format( + * branch_name, leaf_name, + * resolve_type(tleaf.GetTypeName()))) # <<<<<<<<<<<<<< + * else: + * # Just warn that this branch cannot be converted */ -#line 266 "root_numpy/src/tree.pyx" - __pyx_v_converters.insert(__pyx_v_converters.end(), (__pyx_v_converter_buckets[__pyx_v_branch_idx]).begin(), (__pyx_v_converter_buckets[__pyx_v_branch_idx]).end()); +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_9 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_tleaf->GetTypeName()); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 266 "root_numpy/src/tree.pyx" - } +#line 236 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 266 "root_numpy/src/tree.pyx" - goto __pyx_L28; +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_19 = NULL; -#line 266 "root_numpy/src/tree.pyx" - } +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; - /* "root_numpy/src/tree.pyx":270 - * converter_buckets[branch_idx].end()) - * - * elif columns.size() == 0: # <<<<<<<<<<<<<< - * raise RuntimeError("unable to convert any branches in this tree") - * - */ +#line 236 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) { -#line 270 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_columns.size() == 0) != 0); +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_8); -#line 270 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 236 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_19)) { - /* "root_numpy/src/tree.pyx":271 - * - * elif columns.size() == 0: - * raise RuntimeError("unable to convert any branches in this tree") # <<<<<<<<<<<<<< - * - * # Activate branches used by formulae and columns - */ +#line 236 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); -#line 271 "root_numpy/src/tree.pyx" - __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 236 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_19); -#line 271 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 236 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 271 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_20, 0, 0, 0); +#line 236 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_8, function); -#line 271 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_4 = 1; -#line 271 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 236 "root_numpy/src/tree.pyx" + } -#line 271 "root_numpy/src/tree.pyx" - } +#line 236 "root_numpy/src/tree.pyx" + } -#line 271 "root_numpy/src/tree.pyx" - __pyx_L28:; +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_20 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":275 - * # Activate branches used by formulae and columns - * # and deactivate all others - * chain.InitBranches() # <<<<<<<<<<<<<< - * - * # Now that we have all the columns we can - */ +#line 236 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 275 "root_numpy/src/tree.pyx" - __pyx_v_chain->InitBranches(); +#line 236 "root_numpy/src/tree.pyx" + if (__pyx_t_19) { - /* "root_numpy/src/tree.pyx":279 - * # Now that we have all the columns we can - * # make an appropriate array structure - * dtype = [] # <<<<<<<<<<<<<< - * for icol in range(columns.size()): - * this_col = columns[icol] - */ +#line 236 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); __Pyx_GIVEREF(__pyx_t_19); __pyx_t_19 = NULL; -#line 279 "root_numpy/src/tree.pyx" - __pyx_t_20 = PyList_New(0); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 236 "root_numpy/src/tree.pyx" + } -#line 279 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 236 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_4, __pyx_t_10); -#line 279 "root_numpy/src/tree.pyx" - __pyx_v_dtype = ((PyObject*)__pyx_t_20); +#line 236 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_10); -#line 279 "root_numpy/src/tree.pyx" - __pyx_t_20 = 0; +#line 236 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_4, __pyx_t_11); - /* "root_numpy/src/tree.pyx":280 - * # make an appropriate array structure - * dtype = [] - * for icol in range(columns.size()): # <<<<<<<<<<<<<< - * this_col = columns[icol] - * this_conv = converters[icol] - */ +#line 236 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_11); -#line 280 "root_numpy/src/tree.pyx" - __pyx_t_24 = __pyx_v_columns.size(); +#line 236 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_4, __pyx_t_9); -#line 280 "root_numpy/src/tree.pyx" - for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { +#line 236 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_9); -#line 280 "root_numpy/src/tree.pyx" - __pyx_v_icol = __pyx_t_25; +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_10 = 0; - /* "root_numpy/src/tree.pyx":281 - * dtype = [] - * for icol in range(columns.size()): - * this_col = columns[icol] # <<<<<<<<<<<<<< - * this_conv = converters[icol] - * dtype.append((this_col.name, this_conv.get_nptype())) - */ +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_11 = 0; -#line 281 "root_numpy/src/tree.pyx" - __pyx_v_this_col = (__pyx_v_columns[__pyx_v_icol]); +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_9 = 0; - /* "root_numpy/src/tree.pyx":282 - * for icol in range(columns.size()): - * this_col = columns[icol] - * this_conv = converters[icol] # <<<<<<<<<<<<<< - * dtype.append((this_col.name, this_conv.get_nptype())) - * if include_weight: - */ +#line 236 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 282 "root_numpy/src/tree.pyx" - __pyx_v_this_conv = (__pyx_v_converters[__pyx_v_icol]); +#line 236 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); - /* "root_numpy/src/tree.pyx":283 - * this_col = columns[icol] - * this_conv = converters[icol] - * dtype.append((this_col.name, this_conv.get_nptype())) # <<<<<<<<<<<<<< - * if include_weight: - * dtype.append((weight_name, np.dtype('d'))) - */ +#line 236 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 283 "root_numpy/src/tree.pyx" - __pyx_t_20 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_this_col->name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 236 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 283 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); + /* "root_numpy/src/tree.pyx":232 + * # User explicitly requested this branch but there is no + * # converter to handle it + * raise TypeError( # <<<<<<<<<<<<<< + * "cannot convert leaf '{0}' of branch '{1}' " + * "with type '{2}'".format( + */ -#line 283 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_v_this_conv->get_nptype(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 232 "root_numpy/src/tree.pyx" + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 283 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 232 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 283 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 232 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); -#line 283 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 232 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); -#line 283 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); +#line 232 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 283 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_20); +#line 232 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 283 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_2); +#line 232 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 283 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 232 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 283 "root_numpy/src/tree.pyx" - __pyx_t_20 = 0; +#line 232 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 283 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 232 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 283 "root_numpy/src/tree.pyx" - __pyx_t_26 = __Pyx_PyList_Append(__pyx_v_dtype, __pyx_t_19); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 232 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 283 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 232 "root_numpy/src/tree.pyx" + } -#line 283 "root_numpy/src/tree.pyx" - } +#line 232 "root_numpy/src/tree.pyx" + /*else*/ { - /* "root_numpy/src/tree.pyx":284 - * this_conv = converters[icol] - * dtype.append((this_col.name, this_conv.get_nptype())) - * if include_weight: # <<<<<<<<<<<<<< - * dtype.append((weight_name, np.dtype('d'))) - * + /* "root_numpy/src/tree.pyx":239 + * else: + * # Just warn that this branch cannot be converted + * warnings.warn( # <<<<<<<<<<<<<< + * "cannot convert leaf '{0}' of branch '{1}' " + * "with type '{2}' (skipping)".format( */ -#line 284 "root_numpy/src/tree.pyx" - __pyx_t_3 = (__pyx_v_include_weight != 0); +#line 239 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 284 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 239 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); - /* "root_numpy/src/tree.pyx":285 - * dtype.append((this_col.name, this_conv.get_nptype())) - * if include_weight: - * dtype.append((weight_name, np.dtype('d'))) # <<<<<<<<<<<<<< - * - * # Initialize the array - */ +#line 239 "root_numpy/src/tree.pyx" + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_warn); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 285 "root_numpy/src/tree.pyx" - __pyx_t_19 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_weight_name); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 239 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 239 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 285 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + /* "root_numpy/src/tree.pyx":241 + * warnings.warn( + * "cannot convert leaf '{0}' of branch '{1}' " + * "with type '{2}' (skipping)".format( # <<<<<<<<<<<<<< + * branch_name, leaf_name, + * resolve_type(tleaf.GetTypeName())), + */ -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 241 "root_numpy/src/tree.pyx" + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_convert_leaf_0_of_branch_2, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 285 "root_numpy/src/tree.pyx" - __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 241 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); + /* "root_numpy/src/tree.pyx":242 + * "cannot convert leaf '{0}' of branch '{1}' " + * "with type '{2}' (skipping)".format( + * branch_name, leaf_name, # <<<<<<<<<<<<<< + * resolve_type(tleaf.GetTypeName())), + * RootNumpyUnconvertibleWarning) + */ -#line 285 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); +#line 242 "root_numpy/src/tree.pyx" + __pyx_t_11 = __Pyx_PyStr_FromString(__pyx_v_branch_name); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_19); +#line 242 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_11); -#line 285 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_2); +#line 242 "root_numpy/src/tree.pyx" + __pyx_t_10 = __Pyx_PyStr_FromString(__pyx_v_leaf_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); +#line 242 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_10); -#line 285 "root_numpy/src/tree.pyx" - __pyx_t_19 = 0; + /* "root_numpy/src/tree.pyx":243 + * "with type '{2}' (skipping)".format( + * branch_name, leaf_name, + * resolve_type(tleaf.GetTypeName())), # <<<<<<<<<<<<<< + * RootNumpyUnconvertibleWarning) + * + */ -#line 285 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_19 = __pyx_f_13_librootnumpy_resolve_type(__pyx_v_tleaf->GetTypeName()); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 285 "root_numpy/src/tree.pyx" - __pyx_t_26 = __Pyx_PyList_Append(__pyx_v_dtype, __pyx_t_20); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 285 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_21 = NULL; -#line 285 "root_numpy/src/tree.pyx" - goto __pyx_L39; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; -#line 285 "root_numpy/src/tree.pyx" - } +#line 243 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) { -#line 285 "root_numpy/src/tree.pyx" - __pyx_L39:; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_9); - /* "root_numpy/src/tree.pyx":288 - * - * # Initialize the array - * arr = np.empty(num_entries, dtype=dtype) # <<<<<<<<<<<<<< - * - * # Exclude weight column in num_columns - */ +#line 243 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_21)) { -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 243 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_21); -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 243 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_9, function); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_4 = 1; -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_num_entries); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + } -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 243 "root_numpy/src/tree.pyx" + } -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_22 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 243 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_22); -#line 288 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); +#line 243 "root_numpy/src/tree.pyx" + if (__pyx_t_21) { -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_20); +#line 243 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL; -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_20 = 0; +#line 243 "root_numpy/src/tree.pyx" + } -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_4, __pyx_t_11); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 243 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_11); -#line 288 "root_numpy/src/tree.pyx" - if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_4, __pyx_t_10); -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_10); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 243 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_4, __pyx_t_19); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 243 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_19); -#line 288 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_11 = 0; -#line 288 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_10 = 0; -#line 288 "root_numpy/src/tree.pyx" - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_19 = 0; -#line 288 "root_numpy/src/tree.pyx" - __pyx_v_arr = ((PyArrayObject *)__pyx_t_8); +#line 243 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_22, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 288 "root_numpy/src/tree.pyx" - __pyx_t_8 = 0; +#line 243 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); - /* "root_numpy/src/tree.pyx":291 - * - * # Exclude weight column in num_columns - * num_columns = columns.size() # <<<<<<<<<<<<<< - * - * # Loop on entries in the tree and write the data in the array - */ +#line 243 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0; -#line 291 "root_numpy/src/tree.pyx" - __pyx_v_num_columns = __pyx_v_columns.size(); +#line 243 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "root_numpy/src/tree.pyx":294 + /* "root_numpy/src/tree.pyx":244 + * branch_name, leaf_name, + * resolve_type(tleaf.GetTypeName())), + * RootNumpyUnconvertibleWarning) # <<<<<<<<<<<<<< * - * # Loop on entries in the tree and write the data in the array - * indices = slice(start, stop, step).indices(num_entries) # <<<<<<<<<<<<<< - * for ientry in xrange(*indices): - * entry_size = chain.GetEntry(ientry) + * if num_requested_branches > 0: */ -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_20 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); - -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_indices); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_RootNumpyUnconvertibleWarning); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 294 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 244 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_num_entries); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_22 = NULL; -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_20); +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_2 = NULL; +#line 244 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_20))) { -#line 294 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) { +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_20); -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_19); +#line 244 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_22)) { -#line 294 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_2)) { +#line 244 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); -#line 294 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); +#line 244 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_22); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_2); +#line 244 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 244 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_20, function); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_19, function); +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_4 = 1; -#line 294 "root_numpy/src/tree.pyx" - } +#line 244 "root_numpy/src/tree.pyx" + } -#line 294 "root_numpy/src/tree.pyx" - } +#line 244 "root_numpy/src/tree.pyx" + } -#line 294 "root_numpy/src/tree.pyx" - if (!__pyx_t_2) { +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 244 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 244 "root_numpy/src/tree.pyx" + if (__pyx_t_22) { -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 244 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_22); __Pyx_GIVEREF(__pyx_t_22); __pyx_t_22 = NULL; -#line 294 "root_numpy/src/tree.pyx" - } else { +#line 244 "root_numpy/src/tree.pyx" + } -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 244 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_4, __pyx_t_8); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 244 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_8); -#line 294 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL; +#line 244 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_4, __pyx_t_9); -#line 294 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_20); +#line 244 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_9); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_20); +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_8 = 0; -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_20 = 0; +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_9 = 0; -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 244 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 294 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 244 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 294 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 244 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 294 "root_numpy/src/tree.pyx" - } +#line 244 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 294 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 244 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 294 "root_numpy/src/tree.pyx" - __pyx_v_indices = __pyx_t_8; +#line 244 "root_numpy/src/tree.pyx" + } -#line 294 "root_numpy/src/tree.pyx" - __pyx_t_8 = 0; +#line 244 "root_numpy/src/tree.pyx" + __pyx_L28:; - /* "root_numpy/src/tree.pyx":295 - * # Loop on entries in the tree and write the data in the array - * indices = slice(start, stop, step).indices(num_entries) - * for ientry in xrange(*indices): # <<<<<<<<<<<<<< - * entry_size = chain.GetEntry(ientry) - * handle_load(entry_size) - */ +#line 244 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_8 = PySequence_Tuple(__pyx_v_indices); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 244 "root_numpy/src/tree.pyx" + __pyx_L18_continue:; -#line 295 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 244 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_8, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 244 "root_numpy/src/tree.pyx" + __pyx_L19_break:; -#line 295 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); + /* "root_numpy/src/tree.pyx":246 + * RootNumpyUnconvertibleWarning) + * + * if num_requested_branches > 0: # <<<<<<<<<<<<<< + * # Attempt to interpret remaining "branches" as expressions + * for expression in branch_dict.keys(): + */ -#line 295 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 246 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_requested_branches > 0) != 0); -#line 295 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_19)) || PyTuple_CheckExact(__pyx_t_19)) { +#line 246 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_8 = __pyx_t_19; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; + /* "root_numpy/src/tree.pyx":248 + * if num_requested_branches > 0: + * # Attempt to interpret remaining "branches" as expressions + * for expression in branch_dict.keys(): # <<<<<<<<<<<<<< + * branch_idx = branch_dict[expression] + * c_string = expression + */ -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_12 = NULL; +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_branch_dict, __pyx_n_s_keys); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - } else { - __pyx_t_4 = -1; -#line 295 "root_numpy/src/tree.pyx" -__pyx_t_8 = PyObject_GetIter(__pyx_t_19); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 295 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_19 = NULL; -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_20))) { -#line 295 "root_numpy/src/tree.pyx" - } +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20); -#line 295 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 248 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_19)) { -#line 295 "root_numpy/src/tree.pyx" - for (;;) { +#line 248 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); -#line 295 "root_numpy/src/tree.pyx" - if (likely(!__pyx_t_12)) { +#line 248 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_19); -#line 295 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_8))) { +#line 248 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 295 "root_numpy/src/tree.pyx" - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_8)) break; +#line 248 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_20, function); -#line 295 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 248 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_19); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - #else +#line 248 "root_numpy/src/tree.pyx" + if (__pyx_t_19) { -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_19 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_19); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - #endif +#line 248 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 295 "root_numpy/src/tree.pyx" - } else { +#line 248 "root_numpy/src/tree.pyx" + } else { -#line 295 "root_numpy/src/tree.pyx" - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_8)) break; +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 248 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_19 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_19); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 295 "root_numpy/src/tree.pyx" - #else +#line 248 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_19 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { -#line 295 "root_numpy/src/tree.pyx" - #endif +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_20 = __pyx_t_2; __Pyx_INCREF(__pyx_t_20); __pyx_t_4 = 0; -#line 295 "root_numpy/src/tree.pyx" - } - } else -#line 295 "root_numpy/src/tree.pyx" -{ +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_12 = NULL; -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_19 = __pyx_t_12(__pyx_t_8); +#line 248 "root_numpy/src/tree.pyx" + } else { + __pyx_t_4 = -1; +#line 248 "root_numpy/src/tree.pyx" +__pyx_t_20 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - if (unlikely(!__pyx_t_19)) { +#line 248 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 295 "root_numpy/src/tree.pyx" - PyObject* exc_type = PyErr_Occurred(); +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_12 = Py_TYPE(__pyx_t_20)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - if (exc_type) { +#line 248 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); +#line 248 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 295 "root_numpy/src/tree.pyx" - else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + for (;;) { -#line 295 "root_numpy/src/tree.pyx" - } +#line 248 "root_numpy/src/tree.pyx" + if (likely(!__pyx_t_12)) { -#line 295 "root_numpy/src/tree.pyx" - break; +#line 248 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_20))) { -#line 295 "root_numpy/src/tree.pyx" - } +#line 248 "root_numpy/src/tree.pyx" + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_20)) break; -#line 295 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 248 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 295 "root_numpy/src/tree.pyx" - } +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_19); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + #else -#line 295 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = PySequence_ITEM(__pyx_t_20, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 295 "root_numpy/src/tree.pyx" - __pyx_v_ientry = __pyx_t_13; +#line 248 "root_numpy/src/tree.pyx" + #endif - /* "root_numpy/src/tree.pyx":296 - * indices = slice(start, stop, step).indices(num_entries) - * for ientry in xrange(*indices): - * entry_size = chain.GetEntry(ientry) # <<<<<<<<<<<<<< - * handle_load(entry_size) - * if entry_size == 0: - */ +#line 248 "root_numpy/src/tree.pyx" + } else { -#line 296 "root_numpy/src/tree.pyx" - __pyx_v_entry_size = __pyx_v_chain->GetEntry(__pyx_v_ientry); +#line 248 "root_numpy/src/tree.pyx" + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_20)) break; - /* "root_numpy/src/tree.pyx":297 - * for ientry in xrange(*indices): - * entry_size = chain.GetEntry(ientry) - * handle_load(entry_size) # <<<<<<<<<<<<<< - * if entry_size == 0: - * raise IOError("read failure in current tree") - */ +#line 248 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 297 "root_numpy/src/tree.pyx" - __pyx_t_19 = __pyx_f_13_librootnumpy_handle_load(__pyx_v_entry_size, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_20, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 297 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 248 "root_numpy/src/tree.pyx" + #else -#line 297 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = PySequence_ITEM(__pyx_t_20, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":298 - * entry_size = chain.GetEntry(ientry) - * handle_load(entry_size) - * if entry_size == 0: # <<<<<<<<<<<<<< - * raise IOError("read failure in current tree") - * - */ +#line 248 "root_numpy/src/tree.pyx" + #endif -#line 298 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_entry_size == 0) != 0); +#line 248 "root_numpy/src/tree.pyx" + } + } else +#line 248 "root_numpy/src/tree.pyx" +{ -#line 298 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_t_12(__pyx_t_20); - /* "root_numpy/src/tree.pyx":299 - * handle_load(entry_size) - * if entry_size == 0: - * raise IOError("read failure in current tree") # <<<<<<<<<<<<<< - * - * # Determine if this entry passes the selection, - */ +#line 248 "root_numpy/src/tree.pyx" + if (unlikely(!__pyx_t_2)) { -#line 299 "root_numpy/src/tree.pyx" - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + PyObject* exc_type = PyErr_Occurred(); -#line 299 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 248 "root_numpy/src/tree.pyx" + if (exc_type) { -#line 299 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_19, 0, 0, 0); +#line 248 "root_numpy/src/tree.pyx" + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 299 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 248 "root_numpy/src/tree.pyx" + else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 299 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 248 "root_numpy/src/tree.pyx" + } -#line 299 "root_numpy/src/tree.pyx" - } +#line 248 "root_numpy/src/tree.pyx" + break; - /* "root_numpy/src/tree.pyx":303 - * # Determine if this entry passes the selection, - * # similar to the code in ROOT's tree/treeplayer/src/TTreePlayer.cxx - * if selection_formula != NULL: # <<<<<<<<<<<<<< - * selection_formula.GetNdata() # required, as in TTreePlayer - * if selection_formula.EvalInstance(0) == 0: - */ +#line 248 "root_numpy/src/tree.pyx" + } -#line 303 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_selection_formula != NULL) != 0); +#line 248 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 303 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 248 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":304 - * # similar to the code in ROOT's tree/treeplayer/src/TTreePlayer.cxx - * if selection_formula != NULL: - * selection_formula.GetNdata() # required, as in TTreePlayer # <<<<<<<<<<<<<< - * if selection_formula.EvalInstance(0) == 0: - * continue - */ +#line 248 "root_numpy/src/tree.pyx" + __Pyx_XDECREF_SET(__pyx_v_expression, __pyx_t_2); -#line 304 "root_numpy/src/tree.pyx" - __pyx_v_selection_formula->GetNdata(); +#line 248 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; - /* "root_numpy/src/tree.pyx":305 - * if selection_formula != NULL: - * selection_formula.GetNdata() # required, as in TTreePlayer - * if selection_formula.EvalInstance(0) == 0: # <<<<<<<<<<<<<< - * continue - * + /* "root_numpy/src/tree.pyx":249 + * # Attempt to interpret remaining "branches" as expressions + * for expression in branch_dict.keys(): + * branch_idx = branch_dict[expression] # <<<<<<<<<<<<<< + * c_string = expression + * formula = new TTreeFormula(c_string, c_string, tree) */ -#line 305 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_selection_formula->EvalInstance(0) == 0.0) != 0); +#line 249 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyObject_GetItem(__pyx_v_branch_dict, __pyx_v_expression); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L8_error;}; -#line 305 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 249 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); - /* "root_numpy/src/tree.pyx":306 - * selection_formula.GetNdata() # required, as in TTreePlayer - * if selection_formula.EvalInstance(0) == 0: - * continue # <<<<<<<<<<<<<< - * - * # Copy the values into the array - */ +#line 249 "root_numpy/src/tree.pyx" + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 306 "root_numpy/src/tree.pyx" - goto __pyx_L40_continue; +#line 249 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 306 "root_numpy/src/tree.pyx" - } +#line 249 "root_numpy/src/tree.pyx" + __pyx_v_branch_idx = __pyx_t_13; -#line 306 "root_numpy/src/tree.pyx" - goto __pyx_L43; + /* "root_numpy/src/tree.pyx":250 + * for expression in branch_dict.keys(): + * branch_idx = branch_dict[expression] + * c_string = expression # <<<<<<<<<<<<<< + * formula = new TTreeFormula(c_string, c_string, tree) + * if formula == NULL or formula.GetNdim() == 0: + */ -#line 306 "root_numpy/src/tree.pyx" - } +#line 250 "root_numpy/src/tree.pyx" + __pyx_t_23 = __Pyx_PyObject_AsString(__pyx_v_expression); if (unlikely((!__pyx_t_23) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 306 "root_numpy/src/tree.pyx" - __pyx_L43:; +#line 250 "root_numpy/src/tree.pyx" + __pyx_v_c_string = __pyx_t_23; - /* "root_numpy/src/tree.pyx":309 - * - * # Copy the values into the array - * data_ptr = np.PyArray_GETPTR1(arr, num_entries_selected) # <<<<<<<<<<<<<< - * for icol in range(num_columns): - * col = columns[icol] + /* "root_numpy/src/tree.pyx":251 + * branch_idx = branch_dict[expression] + * c_string = expression + * formula = new TTreeFormula(c_string, c_string, tree) # <<<<<<<<<<<<<< + * if formula == NULL or formula.GetNdim() == 0: + * del formula */ -#line 309 "root_numpy/src/tree.pyx" - __pyx_v_data_ptr = PyArray_GETPTR1(__pyx_v_arr, __pyx_v_num_entries_selected); +#line 251 "root_numpy/src/tree.pyx" + __pyx_v_formula = new TTreeFormula(__pyx_v_c_string, __pyx_v_c_string, __pyx_v_tree); - /* "root_numpy/src/tree.pyx":310 - * # Copy the values into the array - * data_ptr = np.PyArray_GETPTR1(arr, num_entries_selected) - * for icol in range(num_columns): # <<<<<<<<<<<<<< - * col = columns[icol] - * conv = converters[icol] + /* "root_numpy/src/tree.pyx":252 + * c_string = expression + * formula = new TTreeFormula(c_string, c_string, tree) + * if formula == NULL or formula.GetNdim() == 0: # <<<<<<<<<<<<<< + * del formula + * raise ValueError( */ -#line 310 "root_numpy/src/tree.pyx" - __pyx_t_25 = __pyx_v_num_columns; +#line 252 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_formula == NULL) != 0); -#line 310 "root_numpy/src/tree.pyx" - for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_25; __pyx_t_27+=1) { +#line 252 "root_numpy/src/tree.pyx" + if (!__pyx_t_1) { -#line 310 "root_numpy/src/tree.pyx" - __pyx_v_icol = __pyx_t_27; +#line 252 "root_numpy/src/tree.pyx" + } else { - /* "root_numpy/src/tree.pyx":311 - * data_ptr = np.PyArray_GETPTR1(arr, num_entries_selected) - * for icol in range(num_columns): - * col = columns[icol] # <<<<<<<<<<<<<< - * conv = converters[icol] - * num_bytes = conv.write(col, data_ptr) - */ +#line 252 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_t_1; -#line 311 "root_numpy/src/tree.pyx" - __pyx_v_col = (__pyx_v_columns[__pyx_v_icol]); +#line 252 "root_numpy/src/tree.pyx" + goto __pyx_L35_bool_binop_done; - /* "root_numpy/src/tree.pyx":312 - * for icol in range(num_columns): - * col = columns[icol] - * conv = converters[icol] # <<<<<<<<<<<<<< - * num_bytes = conv.write(col, data_ptr) - * data_ptr = shift(data_ptr, num_bytes) - */ +#line 252 "root_numpy/src/tree.pyx" + } -#line 312 "root_numpy/src/tree.pyx" - __pyx_v_conv = (__pyx_v_converters[__pyx_v_icol]); +#line 252 "root_numpy/src/tree.pyx" + __pyx_t_1 = ((__pyx_v_formula->GetNdim() == 0) != 0); - /* "root_numpy/src/tree.pyx":313 - * col = columns[icol] - * conv = converters[icol] - * num_bytes = conv.write(col, data_ptr) # <<<<<<<<<<<<<< - * data_ptr = shift(data_ptr, num_bytes) - * if include_weight: - */ +#line 252 "root_numpy/src/tree.pyx" + __pyx_t_3 = __pyx_t_1; -#line 313 "root_numpy/src/tree.pyx" - __pyx_v_num_bytes = __pyx_v_conv->write(__pyx_v_col, __pyx_v_data_ptr); +#line 252 "root_numpy/src/tree.pyx" + __pyx_L35_bool_binop_done:; - /* "root_numpy/src/tree.pyx":314 - * conv = converters[icol] - * num_bytes = conv.write(col, data_ptr) - * data_ptr = shift(data_ptr, num_bytes) # <<<<<<<<<<<<<< - * if include_weight: - * ( data_ptr)[0] = tree.GetWeight() - */ +#line 252 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 314 "root_numpy/src/tree.pyx" - __pyx_v_data_ptr = shift(__pyx_v_data_ptr, __pyx_v_num_bytes); + /* "root_numpy/src/tree.pyx":253 + * formula = new TTreeFormula(c_string, c_string, tree) + * if formula == NULL or formula.GetNdim() == 0: + * del formula # <<<<<<<<<<<<<< + * raise ValueError( + * "the branch or expression '{0}' " + */ -#line 314 "root_numpy/src/tree.pyx" - } +#line 253 "root_numpy/src/tree.pyx" + delete __pyx_v_formula; - /* "root_numpy/src/tree.pyx":315 - * num_bytes = conv.write(col, data_ptr) - * data_ptr = shift(data_ptr, num_bytes) - * if include_weight: # <<<<<<<<<<<<<< - * ( data_ptr)[0] = tree.GetWeight() - * + /* "root_numpy/src/tree.pyx":256 + * raise ValueError( + * "the branch or expression '{0}' " + * "is not present or valid".format(expression)) # <<<<<<<<<<<<<< + * # The chain will take care of updating the formula leaves when + * # rolling over to the next tree. */ -#line 315 "root_numpy/src/tree.pyx" - __pyx_t_3 = (__pyx_v_include_weight != 0); - -#line 315 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 256 "root_numpy/src/tree.pyx" + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_the_branch_or_expression_0_is_no, __pyx_n_s_format); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":316 - * data_ptr = shift(data_ptr, num_bytes) - * if include_weight: - * ( data_ptr)[0] = tree.GetWeight() # <<<<<<<<<<<<<< - * - * # Increment number of selected entries last - */ +#line 256 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 316 "root_numpy/src/tree.pyx" - (((double *)__pyx_v_data_ptr)[0]) = __pyx_v_tree->GetWeight(); +#line 256 "root_numpy/src/tree.pyx" + __pyx_t_9 = NULL; -#line 316 "root_numpy/src/tree.pyx" - goto __pyx_L47; +#line 256 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) { -#line 316 "root_numpy/src/tree.pyx" - } +#line 256 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_19); -#line 316 "root_numpy/src/tree.pyx" - __pyx_L47:; +#line 256 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_9)) { - /* "root_numpy/src/tree.pyx":319 - * - * # Increment number of selected entries last - * num_entries_selected += 1 # <<<<<<<<<<<<<< - * - * finally: - */ +#line 256 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); -#line 319 "root_numpy/src/tree.pyx" - __pyx_v_num_entries_selected = (__pyx_v_num_entries_selected + 1); +#line 256 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_9); - /* "root_numpy/src/tree.pyx":295 - * # Loop on entries in the tree and write the data in the array - * indices = slice(start, stop, step).indices(num_entries) - * for ientry in xrange(*indices): # <<<<<<<<<<<<<< - * entry_size = chain.GetEntry(ientry) - * handle_load(entry_size) - */ +#line 256 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 295 "root_numpy/src/tree.pyx" - __pyx_L40_continue:; +#line 256 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_19, function); -#line 295 "root_numpy/src/tree.pyx" - } +#line 256 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 256 "root_numpy/src/tree.pyx" + } -#line 295 "root_numpy/src/tree.pyx" - } +#line 256 "root_numpy/src/tree.pyx" + if (!__pyx_t_9) { - /* "root_numpy/src/tree.pyx":323 - * finally: - * # Delete TreeChain - * del chain # <<<<<<<<<<<<<< - * # Delete Columns - * for icol in range(columns.size()): - */ +#line 256 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_v_expression); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 323 "root_numpy/src/tree.pyx" - /*finally:*/ { +#line 256 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 323 "root_numpy/src/tree.pyx" - /*normal exit:*/{ +#line 256 "root_numpy/src/tree.pyx" + } else { -#line 323 "root_numpy/src/tree.pyx" - delete __pyx_v_chain; +#line 256 "root_numpy/src/tree.pyx" + __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":325 - * del chain - * # Delete Columns - * for icol in range(columns.size()): # <<<<<<<<<<<<<< - * del columns[icol] - * - */ +#line 256 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 325 "root_numpy/src/tree.pyx" - __pyx_t_24 = __pyx_v_columns.size(); +#line 256 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; -#line 325 "root_numpy/src/tree.pyx" - for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { +#line 256 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_expression); -#line 325 "root_numpy/src/tree.pyx" - __pyx_v_icol = __pyx_t_25; +#line 256 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_expression); - /* "root_numpy/src/tree.pyx":326 - * # Delete Columns - * for icol in range(columns.size()): - * del columns[icol] # <<<<<<<<<<<<<< - * - * # Shrink the array if we selected fewer than num_entries entries - */ +#line 256 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_expression); -#line 326 "root_numpy/src/tree.pyx" - delete (__pyx_v_columns[__pyx_v_icol]); +#line 256 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" - } +#line 256 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 326 "root_numpy/src/tree.pyx" - goto __pyx_L9; +#line 256 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 326 "root_numpy/src/tree.pyx" - } +#line 256 "root_numpy/src/tree.pyx" + } -#line 326 "root_numpy/src/tree.pyx" - /*exception exit:*/{ +#line 256 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 326 "root_numpy/src/tree.pyx" - __pyx_L8_error:; + /* "root_numpy/src/tree.pyx":254 + * if formula == NULL or formula.GetNdim() == 0: + * del formula + * raise ValueError( # <<<<<<<<<<<<<< + * "the branch or expression '{0}' " + * "is not present or valid".format(expression)) + */ -#line 326 "root_numpy/src/tree.pyx" - __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __pyx_t_32 = 0; __pyx_t_33 = 0; __pyx_t_34 = 0; +#line 254 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; +#line 254 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; +#line 254 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; +#line 254 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; +#line 254 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 254 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; +#line 254 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 254 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 254 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 254 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 326 "root_numpy/src/tree.pyx" - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_32, &__pyx_t_33, &__pyx_t_34); +#line 254 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31); +#line 254 "root_numpy/src/tree.pyx" + } -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_29); + /* "root_numpy/src/tree.pyx":259 + * # The chain will take care of updating the formula leaves when + * # rolling over to the next tree. + * chain.AddFormula(formula) # <<<<<<<<<<<<<< + * col = new FormulaColumn(expression, formula) + * conv = find_converter_by_typename('double') + */ -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_30); +#line 259 "root_numpy/src/tree.pyx" + __pyx_v_chain->AddFormula(__pyx_v_formula); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_31); + /* "root_numpy/src/tree.pyx":260 + * # rolling over to the next tree. + * chain.AddFormula(formula) + * col = new FormulaColumn(expression, formula) # <<<<<<<<<<<<<< + * conv = find_converter_by_typename('double') + * if conv == NULL: + */ -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_32); +#line 260 "root_numpy/src/tree.pyx" + __pyx_t_18 = __pyx_convert_string_from_py_std__string(__pyx_v_expression); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_33); +#line 260 "root_numpy/src/tree.pyx" + __pyx_v_col = new FormulaColumn(__pyx_t_18, __pyx_v_formula); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_34); + /* "root_numpy/src/tree.pyx":261 + * chain.AddFormula(formula) + * col = new FormulaColumn(expression, formula) + * conv = find_converter_by_typename('double') # <<<<<<<<<<<<<< + * if conv == NULL: + * # Oops, this should never happen + */ -#line 326 "root_numpy/src/tree.pyx" - __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_28 = __pyx_filename; +#line 261 "root_numpy/src/tree.pyx" + __pyx_t_18 = __pyx_convert_string_from_py_std__string(__pyx_n_b_double); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" - { +#line 261 "root_numpy/src/tree.pyx" + __pyx_v_conv = __pyx_f_13_librootnumpy_find_converter_by_typename(__pyx_t_18); - /* "root_numpy/src/tree.pyx":323 - * finally: - * # Delete TreeChain - * del chain # <<<<<<<<<<<<<< - * # Delete Columns - * for icol in range(columns.size()): + /* "root_numpy/src/tree.pyx":262 + * col = new FormulaColumn(expression, formula) + * conv = find_converter_by_typename('double') + * if conv == NULL: # <<<<<<<<<<<<<< + * # Oops, this should never happen + * raise AssertionError( */ -#line 323 "root_numpy/src/tree.pyx" - delete __pyx_v_chain; +#line 262 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_conv == NULL) != 0); - /* "root_numpy/src/tree.pyx":325 - * del chain - * # Delete Columns - * for icol in range(columns.size()): # <<<<<<<<<<<<<< - * del columns[icol] +#line 262 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { + + /* "root_numpy/src/tree.pyx":264 + * if conv == NULL: + * # Oops, this should never happen + * raise AssertionError( # <<<<<<<<<<<<<< + * "could not find double converter for formula") * */ -#line 325 "root_numpy/src/tree.pyx" - __pyx_t_24 = __pyx_v_columns.size(); +#line 264 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 325 "root_numpy/src/tree.pyx" - for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { +#line 264 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 325 "root_numpy/src/tree.pyx" - __pyx_v_icol = __pyx_t_25; +#line 264 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_2, 0, 0, 0); - /* "root_numpy/src/tree.pyx":326 - * # Delete Columns - * for icol in range(columns.size()): - * del columns[icol] # <<<<<<<<<<<<<< - * - * # Shrink the array if we selected fewer than num_entries entries - */ +#line 264 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 326 "root_numpy/src/tree.pyx" - delete (__pyx_v_columns[__pyx_v_icol]); +#line 264 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 326 "root_numpy/src/tree.pyx" +#line 264 "root_numpy/src/tree.pyx" } -#line 326 "root_numpy/src/tree.pyx" - } - -#line 326 "root_numpy/src/tree.pyx" - if (PY_MAJOR_VERSION >= 3) { + /* "root_numpy/src/tree.pyx":267 + * "could not find double converter for formula") + * + * column_buckets[branch_idx].push_back(col) # <<<<<<<<<<<<<< + * converter_buckets[branch_idx].push_back(conv) + * + */ -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_32); +#line 267 "root_numpy/src/tree.pyx" + (__pyx_v_column_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_col); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_33); + /* "root_numpy/src/tree.pyx":268 + * + * column_buckets[branch_idx].push_back(col) + * converter_buckets[branch_idx].push_back(conv) # <<<<<<<<<<<<<< + * + * # Flatten buckets into 1D vectors, thus preserving branch order + */ -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_34); +#line 268 "root_numpy/src/tree.pyx" + (__pyx_v_converter_buckets[__pyx_v_branch_idx]).push_back(__pyx_v_conv); -#line 326 "root_numpy/src/tree.pyx" - __Pyx_ExceptionReset(__pyx_t_32, __pyx_t_33, __pyx_t_34); + /* "root_numpy/src/tree.pyx":248 + * if num_requested_branches > 0: + * # Attempt to interpret remaining "branches" as expressions + * for expression in branch_dict.keys(): # <<<<<<<<<<<<<< + * branch_idx = branch_dict[expression] + * c_string = expression + */ -#line 326 "root_numpy/src/tree.pyx" +#line 248 "root_numpy/src/tree.pyx" } -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_29); +#line 248 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_30); + /* "root_numpy/src/tree.pyx":271 + * + * # Flatten buckets into 1D vectors, thus preserving branch order + * for branch_idx in range(num_requested_branches): # <<<<<<<<<<<<<< + * columns.insert(columns.end(), + * column_buckets[branch_idx].begin(), + */ -#line 326 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_31); +#line 271 "root_numpy/src/tree.pyx" + __pyx_t_13 = __pyx_v_num_requested_branches; -#line 326 "root_numpy/src/tree.pyx" - __Pyx_ErrRestore(__pyx_t_29, __pyx_t_30, __pyx_t_31); +#line 271 "root_numpy/src/tree.pyx" + for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { -#line 326 "root_numpy/src/tree.pyx" - __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __pyx_t_32 = 0; __pyx_t_33 = 0; __pyx_t_34 = 0; +#line 271 "root_numpy/src/tree.pyx" + __pyx_v_branch_idx = __pyx_t_14; -#line 326 "root_numpy/src/tree.pyx" - __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_28; + /* "root_numpy/src/tree.pyx":272 + * # Flatten buckets into 1D vectors, thus preserving branch order + * for branch_idx in range(num_requested_branches): + * columns.insert(columns.end(), # <<<<<<<<<<<<<< + * column_buckets[branch_idx].begin(), + * column_buckets[branch_idx].end()) + */ -#line 326 "root_numpy/src/tree.pyx" - goto __pyx_L1_error; +#line 272 "root_numpy/src/tree.pyx" + __pyx_v_columns.insert(__pyx_v_columns.end(), (__pyx_v_column_buckets[__pyx_v_branch_idx]).begin(), (__pyx_v_column_buckets[__pyx_v_branch_idx]).end()); -#line 326 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":275 + * column_buckets[branch_idx].begin(), + * column_buckets[branch_idx].end()) + * converters.insert(converters.end(), # <<<<<<<<<<<<<< + * converter_buckets[branch_idx].begin(), + * converter_buckets[branch_idx].end()) + */ -#line 326 "root_numpy/src/tree.pyx" - __pyx_L9:; +#line 275 "root_numpy/src/tree.pyx" + __pyx_v_converters.insert(__pyx_v_converters.end(), (__pyx_v_converter_buckets[__pyx_v_branch_idx]).begin(), (__pyx_v_converter_buckets[__pyx_v_branch_idx]).end()); -#line 326 "root_numpy/src/tree.pyx" - } +#line 275 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":329 +#line 275 "root_numpy/src/tree.pyx" + goto __pyx_L31; + +#line 275 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":279 + * converter_buckets[branch_idx].end()) * - * # Shrink the array if we selected fewer than num_entries entries - * if num_entries_selected < num_entries: # <<<<<<<<<<<<<< - * arr.resize(num_entries_selected) + * elif columns.size() == 0: # <<<<<<<<<<<<<< + * raise RuntimeError("unable to convert any branches in this tree") * */ -#line 329 "root_numpy/src/tree.pyx" - __pyx_t_3 = ((__pyx_v_num_entries_selected < __pyx_v_num_entries) != 0); +#line 279 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_columns.size() == 0) != 0); -#line 329 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 279 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":330 - * # Shrink the array if we selected fewer than num_entries entries - * if num_entries_selected < num_entries: - * arr.resize(num_entries_selected) # <<<<<<<<<<<<<< + /* "root_numpy/src/tree.pyx":280 * - * return arr + * elif columns.size() == 0: + * raise RuntimeError("unable to convert any branches in this tree") # <<<<<<<<<<<<<< + * + * # Activate branches used by formulae and columns */ -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_resize); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 330 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_19); +#line 280 "root_numpy/src/tree.pyx" + __pyx_t_20 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_num_entries_selected); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 280 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 330 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 280 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_20, 0, 0, 0); -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_20 = NULL; +#line 280 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 330 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) { +#line 280 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); +#line 280 "root_numpy/src/tree.pyx" + } -#line 330 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_20)) { +#line 280 "root_numpy/src/tree.pyx" + __pyx_L31:; -#line 330 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); + /* "root_numpy/src/tree.pyx":284 + * # Activate branches used by formulae and columns + * # and deactivate all others + * chain.InitBranches() # <<<<<<<<<<<<<< + * + * # Now that we have all the columns we can + */ -#line 330 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_20); +#line 284 "root_numpy/src/tree.pyx" + __pyx_v_chain->InitBranches(); -#line 330 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); + /* "root_numpy/src/tree.pyx":288 + * # Now that we have all the columns we can + * # make an appropriate array structure + * dtype = [] # <<<<<<<<<<<<<< + * for icol in range(columns.size()): + * this_col = columns[icol] + */ -#line 330 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_19, function); +#line 288 "root_numpy/src/tree.pyx" + __pyx_t_20 = PyList_New(0); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 330 "root_numpy/src/tree.pyx" - } +#line 288 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 330 "root_numpy/src/tree.pyx" - } +#line 288 "root_numpy/src/tree.pyx" + __pyx_v_dtype = ((PyObject*)__pyx_t_20); -#line 330 "root_numpy/src/tree.pyx" - if (!__pyx_t_20) { +#line 288 "root_numpy/src/tree.pyx" + __pyx_t_20 = 0; -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/tree.pyx":289 + * # make an appropriate array structure + * dtype = [] + * for icol in range(columns.size()): # <<<<<<<<<<<<<< + * this_col = columns[icol] + * this_conv = converters[icol] + */ -#line 330 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 289 "root_numpy/src/tree.pyx" + __pyx_t_24 = __pyx_v_columns.size(); -#line 330 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 289 "root_numpy/src/tree.pyx" + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { -#line 330 "root_numpy/src/tree.pyx" - } else { +#line 289 "root_numpy/src/tree.pyx" + __pyx_v_icol = __pyx_t_25; -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/tree.pyx":290 + * dtype = [] + * for icol in range(columns.size()): + * this_col = columns[icol] # <<<<<<<<<<<<<< + * this_conv = converters[icol] + * dtype.append((this_col.name, this_conv.get_nptype())) + */ -#line 330 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 290 "root_numpy/src/tree.pyx" + __pyx_v_this_col = (__pyx_v_columns[__pyx_v_icol]); -#line 330 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = NULL; + /* "root_numpy/src/tree.pyx":291 + * for icol in range(columns.size()): + * this_col = columns[icol] + * this_conv = converters[icol] # <<<<<<<<<<<<<< + * dtype.append((this_col.name, this_conv.get_nptype())) + * if include_weight: + */ -#line 330 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_9); +#line 291 "root_numpy/src/tree.pyx" + __pyx_v_this_conv = (__pyx_v_converters[__pyx_v_icol]); -#line 330 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_9); + /* "root_numpy/src/tree.pyx":292 + * this_col = columns[icol] + * this_conv = converters[icol] + * dtype.append((this_col.name, this_conv.get_nptype())) # <<<<<<<<<<<<<< + * if include_weight: + * dtype.append((weight_name, np.dtype('d'))) + */ -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_9 = 0; +#line 292 "root_numpy/src/tree.pyx" + __pyx_t_20 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_this_col->name); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 330 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 292 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 330 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 292 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_v_this_conv->get_nptype(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 330 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 292 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 330 "root_numpy/src/tree.pyx" - } +#line 292 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 330 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; +#line 292 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 330 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +#line 292 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); -#line 330 "root_numpy/src/tree.pyx" - goto __pyx_L54; +#line 292 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_20); -#line 330 "root_numpy/src/tree.pyx" - } +#line 292 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_2); -#line 330 "root_numpy/src/tree.pyx" - __pyx_L54:; +#line 292 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); - /* "root_numpy/src/tree.pyx":332 - * arr.resize(num_entries_selected) - * - * return arr # <<<<<<<<<<<<<< - * - * - */ +#line 292 "root_numpy/src/tree.pyx" + __pyx_t_20 = 0; -#line 332 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 292 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 332 "root_numpy/src/tree.pyx" - __Pyx_INCREF(((PyObject *)__pyx_v_arr)); +#line 292 "root_numpy/src/tree.pyx" + __pyx_t_26 = __Pyx_PyList_Append(__pyx_v_dtype, __pyx_t_19); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 332 "root_numpy/src/tree.pyx" - __pyx_r = ((PyObject *)__pyx_v_arr); +#line 292 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 332 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 292 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":102 - * + /* "root_numpy/src/tree.pyx":293 + * this_conv = converters[icol] + * dtype.append((this_col.name, this_conv.get_nptype())) + * if include_weight: # <<<<<<<<<<<<<< + * dtype.append((weight_name, np.dtype('d'))) * - * cdef object tree2array(TTree* tree, branches, string selection, # <<<<<<<<<<<<<< - * start, stop, step, - * bool include_weight, string weight_name): */ -#line 102 "root_numpy/src/tree.pyx" - - -#line 102 "root_numpy/src/tree.pyx" - /* function exit code */ - -#line 102 "root_numpy/src/tree.pyx" - __pyx_L1_error:; - -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); - -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_8); - -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_9); - -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_10); +#line 293 "root_numpy/src/tree.pyx" + __pyx_t_3 = (__pyx_v_include_weight != 0); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_11); +#line 293 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_19); + /* "root_numpy/src/tree.pyx":294 + * dtype.append((this_col.name, this_conv.get_nptype())) + * if include_weight: + * dtype.append((weight_name, np.dtype('d'))) # <<<<<<<<<<<<<< + * + * # Initialize the array + */ -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_20); +#line 294 "root_numpy/src/tree.pyx" + __pyx_t_19 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_weight_name); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_21); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_22); +#line 294 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5numpy_dtype)), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 102 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.tree2array", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 102 "root_numpy/src/tree.pyx" - __pyx_r = 0; +#line 294 "root_numpy/src/tree.pyx" + __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 102 "root_numpy/src/tree.pyx" - __pyx_L0:; +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF((PyObject *)__pyx_v_arr); +#line 294 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_19); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_branch_dict); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_19); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_expression); +#line 294 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_2); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_dtype); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_2); -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_indices); +#line 294 "root_numpy/src/tree.pyx" + __pyx_t_19 = 0; -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_idx); +#line 294 "root_numpy/src/tree.pyx" + __pyx_t_2 = 0; -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_b); +#line 294 "root_numpy/src/tree.pyx" + __pyx_t_26 = __Pyx_PyList_Append(__pyx_v_dtype, __pyx_t_20); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 102 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 102 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 294 "root_numpy/src/tree.pyx" + goto __pyx_L42; -#line 102 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 294 "root_numpy/src/tree.pyx" + } -#line 102 "root_numpy/src/tree.pyx" -} +#line 294 "root_numpy/src/tree.pyx" + __pyx_L42:; -/* "root_numpy/src/tree.pyx":335 + /* "root_numpy/src/tree.pyx":297 * + * # Initialize the array + * arr = np.empty(num_entries, dtype=dtype) # <<<<<<<<<<<<<< * - * def root2array_fromFname(fnames, string treename, branches, # <<<<<<<<<<<<<< - * selection, start, stop, step, - * bool include_weight, string weight_name): + * # Exclude weight column in num_columns */ -#line 335 "root_numpy/src/tree.pyx" - - -#line 335 "root_numpy/src/tree.pyx" -/* Python wrapper */ - -#line 335 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_9root2array_fromFname(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_13_librootnumpy_9root2array_fromFname = -#line 335 "root_numpy/src/tree.pyx" -{"root2array_fromFname", (PyCFunction)__pyx_pw_13_librootnumpy_9root2array_fromFname, METH_VARARGS|METH_KEYWORDS, 0}; - -#line 335 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_9root2array_fromFname(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_fnames = 0 -#line 335 "root_numpy/src/tree.pyx" -; - std::string __pyx_v_treename -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_branches = 0 -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_selection = 0 -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_start = 0 -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_stop = 0 -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_step = 0 -#line 335 "root_numpy/src/tree.pyx" -; - bool __pyx_v_include_weight -#line 335 "root_numpy/src/tree.pyx" -; - std::string __pyx_v_weight_name -#line 335 "root_numpy/src/tree.pyx" -; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - -#line 335 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = 0; +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - __Pyx_RefNannyDeclarations +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("root2array_fromFname (wrapper)", 0); +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - { +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 335 "root_numpy/src/tree.pyx" - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fnames,&__pyx_n_s_treename,&__pyx_n_s_branches,&__pyx_n_s_selection,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,&__pyx_n_s_include_weight,&__pyx_n_s_weight_name,0}; +#line 297 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 335 "root_numpy/src/tree.pyx" - PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_num_entries); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - if (unlikely(__pyx_kwds)) { +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - Py_ssize_t kw_args; +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyTuple_New(1); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 335 "root_numpy/src/tree.pyx" - switch (pos_args) { - case 9: -#line 335 "root_numpy/src/tree.pyx" -values[8] = PyTuple_GET_ITEM(__pyx_args, 8); - case 8: -#line 335 "root_numpy/src/tree.pyx" -values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: -#line 335 "root_numpy/src/tree.pyx" -values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: -#line 335 "root_numpy/src/tree.pyx" -values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: -#line 335 "root_numpy/src/tree.pyx" -values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: -#line 335 "root_numpy/src/tree.pyx" -values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: -#line 335 "root_numpy/src/tree.pyx" -values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: -#line 335 "root_numpy/src/tree.pyx" -values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: -#line 335 "root_numpy/src/tree.pyx" -values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 297 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - case 0: break; - default: -#line 335 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - } +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_20 = 0; -#line 335 "root_numpy/src/tree.pyx" - kw_args = PyDict_Size(__pyx_kwds); +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_20 = PyDict_New(); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - switch (pos_args) { +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - case 0: +#line 297 "root_numpy/src/tree.pyx" + if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fnames)) != 0)) kw_args--; - else -#line 335 "root_numpy/src/tree.pyx" -goto __pyx_L5_argtuple_error; +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - case 1: +#line 297 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_treename)) != 0)) kw_args--; +#line 297 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 1); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 297 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 335 "root_numpy/src/tree.pyx" - } +#line 297 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 335 "root_numpy/src/tree.pyx" - case 2: +#line 297 "root_numpy/src/tree.pyx" + if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_branches)) != 0)) kw_args--; +#line 297 "root_numpy/src/tree.pyx" + __pyx_v_arr = ((PyArrayObject *)__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 2); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 297 "root_numpy/src/tree.pyx" + __pyx_t_8 = 0; -#line 335 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":300 + * + * # Exclude weight column in num_columns + * num_columns = columns.size() # <<<<<<<<<<<<<< + * + * # Loop on entries in the tree and write the data in the array + */ -#line 335 "root_numpy/src/tree.pyx" - case 3: +#line 300 "root_numpy/src/tree.pyx" + __pyx_v_num_columns = __pyx_v_columns.size(); -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selection)) != 0)) kw_args--; + /* "root_numpy/src/tree.pyx":303 + * + * # Loop on entries in the tree and write the data in the array + * indices = slice(start, stop, step).indices(num_entries) # <<<<<<<<<<<<<< + * for ientry in xrange(*indices): + * entry_size = chain.GetEntry(ientry) + */ -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 3); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_20 = PySlice_New(__pyx_v_start, __pyx_v_stop, __pyx_v_step); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - case 4: +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_indices); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 4); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_num_entries); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - case 5: +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_2 = NULL; -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 5); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) { -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_19); -#line 335 "root_numpy/src/tree.pyx" - case 6: +#line 303 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_2)) { -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--; +#line 303 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 6); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_2); -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 335 "root_numpy/src/tree.pyx" - case 7: +#line 303 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_19, function); -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_weight)) != 0)) kw_args--; +#line 303 "root_numpy/src/tree.pyx" + } -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 7); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + } -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + if (!__pyx_t_2) { -#line 335 "root_numpy/src/tree.pyx" - case 8: +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_20); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight_name)) != 0)) kw_args--; +#line 303 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 335 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 8); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + } else { -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - if (unlikely(kw_args > 0)) { +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 335 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "root2array_fromFname") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 303 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL; -#line 335 "root_numpy/src/tree.pyx" - } +#line 303 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" - goto __pyx_L5_argtuple_error; +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_20 = 0; -#line 335 "root_numpy/src/tree.pyx" - } else { +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 303 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); +#line 303 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 335 "root_numpy/src/tree.pyx" - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); +#line 303 "root_numpy/src/tree.pyx" + } -#line 335 "root_numpy/src/tree.pyx" - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); +#line 303 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 335 "root_numpy/src/tree.pyx" - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); +#line 303 "root_numpy/src/tree.pyx" + __pyx_v_indices = __pyx_t_8; -#line 335 "root_numpy/src/tree.pyx" - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); +#line 303 "root_numpy/src/tree.pyx" + __pyx_t_8 = 0; -#line 335 "root_numpy/src/tree.pyx" - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + /* "root_numpy/src/tree.pyx":304 + * # Loop on entries in the tree and write the data in the array + * indices = slice(start, stop, step).indices(num_entries) + * for ientry in xrange(*indices): # <<<<<<<<<<<<<< + * entry_size = chain.GetEntry(ientry) + * handle_load(entry_size) + */ -#line 335 "root_numpy/src/tree.pyx" - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_8 = PySequence_Tuple(__pyx_v_indices); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - values[8] = PyTuple_GET_ITEM(__pyx_args, 8); +#line 304 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_xrange, __pyx_t_8, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + +#line 304 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); + +#line 304 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + +#line 304 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_19)) || PyTuple_CheckExact(__pyx_t_19)) { + +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_8 = __pyx_t_19; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; + +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_12 = NULL; + +#line 304 "root_numpy/src/tree.pyx" + } else { + __pyx_t_4 = -1; +#line 304 "root_numpy/src/tree.pyx" +__pyx_t_8 = PyObject_GetIter(__pyx_t_19); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + +#line 304 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); + +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} + +#line 304 "root_numpy/src/tree.pyx" } -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_fnames = values[0]; +#line 304 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_treename = __pyx_convert_string_from_py_std__string(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 304 "root_numpy/src/tree.pyx" + for (;;) { -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_branches = values[2]; +#line 304 "root_numpy/src/tree.pyx" + if (likely(!__pyx_t_12)) { -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_selection = values[3]; +#line 304 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_8))) { -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_start = values[4]; +#line 304 "root_numpy/src/tree.pyx" + if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_8)) break; -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_stop = values[5]; +#line 304 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_step = values[6]; +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_19); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_include_weight = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_include_weight == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 304 "root_numpy/src/tree.pyx" + #else -#line 335 "root_numpy/src/tree.pyx" - __pyx_v_weight_name = __pyx_convert_string_from_py_std__string(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_19 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - } +#line 304 "root_numpy/src/tree.pyx" + #endif -#line 335 "root_numpy/src/tree.pyx" - goto __pyx_L4_argument_unpacking_done; +#line 304 "root_numpy/src/tree.pyx" + } else { -#line 335 "root_numpy/src/tree.pyx" - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); -#line 335 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 304 "root_numpy/src/tree.pyx" + if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_8)) break; -#line 335 "root_numpy/src/tree.pyx" - __pyx_L3_error:; +#line 304 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 335 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.root2array_fromFname", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_19 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_19); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 304 "root_numpy/src/tree.pyx" + #else -#line 335 "root_numpy/src/tree.pyx" - return NULL; +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_19 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 335 "root_numpy/src/tree.pyx" - __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 335 "root_numpy/src/tree.pyx" -__pyx_pf_13_librootnumpy_8root2array_fromFname(__pyx_self, __pyx_v_fnames, __pyx_v_treename, __pyx_v_branches, __pyx_v_selection, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); +#line 304 "root_numpy/src/tree.pyx" + #endif -#line 335 "root_numpy/src/tree.pyx" +#line 304 "root_numpy/src/tree.pyx" + } + } else +#line 304 "root_numpy/src/tree.pyx" +{ +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_19 = __pyx_t_12(__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 304 "root_numpy/src/tree.pyx" + if (unlikely(!__pyx_t_19)) { -#line 335 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 304 "root_numpy/src/tree.pyx" + PyObject* exc_type = PyErr_Occurred(); -#line 335 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 304 "root_numpy/src/tree.pyx" + if (exc_type) { -#line 335 "root_numpy/src/tree.pyx" -} +#line 304 "root_numpy/src/tree.pyx" + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 335 "root_numpy/src/tree.pyx" +#line 304 "root_numpy/src/tree.pyx" + else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} +#line 304 "root_numpy/src/tree.pyx" + } -#line 335 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pf_13_librootnumpy_8root2array_fromFname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fnames, std::string __pyx_v_treename, PyObject *__pyx_v_branches, PyObject *__pyx_v_selection, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, bool __pyx_v_include_weight, std::string __pyx_v_weight_name) { - TChain *__pyx_v_ttree -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_fn = NULL -#line 335 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_ret = NULL -#line 335 "root_numpy/src/tree.pyx" -; +#line 304 "root_numpy/src/tree.pyx" + break; -#line 335 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - const char *__pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - std::string __pyx_t_12; - std::string __pyx_t_13; - int __pyx_t_14; - int __pyx_t_15; - char const *__pyx_t_16; - PyObject *__pyx_t_17 = NULL; - PyObject *__pyx_t_18 = NULL; - PyObject *__pyx_t_19 = NULL; - PyObject *__pyx_t_20 = NULL; - PyObject *__pyx_t_21 = NULL; - PyObject *__pyx_t_22 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 304 "root_numpy/src/tree.pyx" + } -#line 335 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("root2array_fromFname", 0); +#line 304 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); - /* "root_numpy/src/tree.pyx":338 - * selection, start, stop, step, - * bool include_weight, string weight_name): - * cdef TChain* ttree = NULL # <<<<<<<<<<<<<< - * try: - * ttree = new TChain(treename.c_str()) - */ +#line 304 "root_numpy/src/tree.pyx" + } -#line 338 "root_numpy/src/tree.pyx" - __pyx_v_ttree = NULL; +#line 304 "root_numpy/src/tree.pyx" + __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_19); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L8_error;} - /* "root_numpy/src/tree.pyx":339 - * bool include_weight, string weight_name): - * cdef TChain* ttree = NULL - * try: # <<<<<<<<<<<<<< - * ttree = new TChain(treename.c_str()) - * for fn in fnames: - */ +#line 304 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 339 "root_numpy/src/tree.pyx" - /*try:*/ { +#line 304 "root_numpy/src/tree.pyx" + __pyx_v_ientry = __pyx_t_13; - /* "root_numpy/src/tree.pyx":340 - * cdef TChain* ttree = NULL - * try: - * ttree = new TChain(treename.c_str()) # <<<<<<<<<<<<<< - * for fn in fnames: - * if ttree.Add(fn, -1) == 0: + /* "root_numpy/src/tree.pyx":305 + * indices = slice(start, stop, step).indices(num_entries) + * for ientry in xrange(*indices): + * entry_size = chain.GetEntry(ientry) # <<<<<<<<<<<<<< + * handle_load(entry_size) + * if entry_size == 0: */ -#line 340 "root_numpy/src/tree.pyx" - __pyx_v_ttree = new TChain(__pyx_v_treename.c_str()); +#line 305 "root_numpy/src/tree.pyx" + __pyx_v_entry_size = __pyx_v_chain->GetEntry(__pyx_v_ientry); - /* "root_numpy/src/tree.pyx":341 - * try: - * ttree = new TChain(treename.c_str()) - * for fn in fnames: # <<<<<<<<<<<<<< - * if ttree.Add(fn, -1) == 0: - * raise IOError("unable to access tree '{0}' in {1}".format( + /* "root_numpy/src/tree.pyx":306 + * for ientry in xrange(*indices): + * entry_size = chain.GetEntry(ientry) + * handle_load(entry_size) # <<<<<<<<<<<<<< + * if entry_size == 0: + * raise IOError("read failure in current tree") */ -#line 341 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_v_fnames)) || PyTuple_CheckExact(__pyx_v_fnames)) { +#line 306 "root_numpy/src/tree.pyx" + __pyx_t_19 = __pyx_f_13_librootnumpy_handle_load(__pyx_v_entry_size, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_1 = __pyx_v_fnames; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; +#line 306 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_3 = NULL; +#line 306 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 341 "root_numpy/src/tree.pyx" - } else { - __pyx_t_2 = -1; -#line 341 "root_numpy/src/tree.pyx" -__pyx_t_1 = PyObject_GetIter(__pyx_v_fnames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + /* "root_numpy/src/tree.pyx":307 + * entry_size = chain.GetEntry(ientry) + * handle_load(entry_size) + * if entry_size == 0: # <<<<<<<<<<<<<< + * raise IOError("read failure in current tree") + * + */ -#line 341 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 307 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_entry_size == 0) != 0); -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 307 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 341 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":308 + * handle_load(entry_size) + * if entry_size == 0: + * raise IOError("read failure in current tree") # <<<<<<<<<<<<<< + * + * # Determine if this entry passes the selection, + */ -#line 341 "root_numpy/src/tree.pyx" - for (;;) { +#line 308 "root_numpy/src/tree.pyx" + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 341 "root_numpy/src/tree.pyx" - if (likely(!__pyx_t_3)) { +#line 308 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 341 "root_numpy/src/tree.pyx" - if (likely(PyList_CheckExact(__pyx_t_1))) { +#line 308 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_19, 0, 0, 0); -#line 341 "root_numpy/src/tree.pyx" - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; +#line 308 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 341 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 308 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L8_error;} -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 308 "root_numpy/src/tree.pyx" + } -#line 341 "root_numpy/src/tree.pyx" - #else + /* "root_numpy/src/tree.pyx":312 + * # Determine if this entry passes the selection, + * # similar to the code in ROOT's tree/treeplayer/src/TTreePlayer.cxx + * if selection_formula != NULL: # <<<<<<<<<<<<<< + * selection_formula.GetNdata() # required, as in TTreePlayer + * if selection_formula.EvalInstance(0) == 0: + */ -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 312 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_selection_formula != NULL) != 0); -#line 341 "root_numpy/src/tree.pyx" - #endif +#line 312 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 341 "root_numpy/src/tree.pyx" - } else { + /* "root_numpy/src/tree.pyx":313 + * # similar to the code in ROOT's tree/treeplayer/src/TTreePlayer.cxx + * if selection_formula != NULL: + * selection_formula.GetNdata() # required, as in TTreePlayer # <<<<<<<<<<<<<< + * if selection_formula.EvalInstance(0) == 0: + * continue + */ -#line 341 "root_numpy/src/tree.pyx" - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; +#line 313 "root_numpy/src/tree.pyx" + __pyx_v_selection_formula->GetNdata(); -#line 341 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON + /* "root_numpy/src/tree.pyx":314 + * if selection_formula != NULL: + * selection_formula.GetNdata() # required, as in TTreePlayer + * if selection_formula.EvalInstance(0) == 0: # <<<<<<<<<<<<<< + * continue + * + */ -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 314 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_selection_formula->EvalInstance(0) == 0.0) != 0); -#line 341 "root_numpy/src/tree.pyx" - #else +#line 314 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + /* "root_numpy/src/tree.pyx":315 + * selection_formula.GetNdata() # required, as in TTreePlayer + * if selection_formula.EvalInstance(0) == 0: + * continue # <<<<<<<<<<<<<< + * + * # Copy the values into the array + */ -#line 341 "root_numpy/src/tree.pyx" - #endif +#line 315 "root_numpy/src/tree.pyx" + goto __pyx_L43_continue; -#line 341 "root_numpy/src/tree.pyx" +#line 315 "root_numpy/src/tree.pyx" } - } else -#line 341 "root_numpy/src/tree.pyx" -{ -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_4 = __pyx_t_3(__pyx_t_1); +#line 315 "root_numpy/src/tree.pyx" + goto __pyx_L46; -#line 341 "root_numpy/src/tree.pyx" - if (unlikely(!__pyx_t_4)) { +#line 315 "root_numpy/src/tree.pyx" + } -#line 341 "root_numpy/src/tree.pyx" - PyObject* exc_type = PyErr_Occurred(); +#line 315 "root_numpy/src/tree.pyx" + __pyx_L46:; -#line 341 "root_numpy/src/tree.pyx" - if (exc_type) { + /* "root_numpy/src/tree.pyx":318 + * + * # Copy the values into the array + * data_ptr = np.PyArray_GETPTR1(arr, num_entries_selected) # <<<<<<<<<<<<<< + * for icol in range(num_columns): + * col = columns[icol] + */ -#line 341 "root_numpy/src/tree.pyx" - if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); +#line 318 "root_numpy/src/tree.pyx" + __pyx_v_data_ptr = PyArray_GETPTR1(__pyx_v_arr, __pyx_v_num_entries_selected); -#line 341 "root_numpy/src/tree.pyx" - else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + /* "root_numpy/src/tree.pyx":319 + * # Copy the values into the array + * data_ptr = np.PyArray_GETPTR1(arr, num_entries_selected) + * for icol in range(num_columns): # <<<<<<<<<<<<<< + * col = columns[icol] + * conv = converters[icol] + */ -#line 341 "root_numpy/src/tree.pyx" - } +#line 319 "root_numpy/src/tree.pyx" + __pyx_t_25 = __pyx_v_num_columns; -#line 341 "root_numpy/src/tree.pyx" - break; +#line 319 "root_numpy/src/tree.pyx" + for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_25; __pyx_t_27+=1) { -#line 341 "root_numpy/src/tree.pyx" - } +#line 319 "root_numpy/src/tree.pyx" + __pyx_v_icol = __pyx_t_27; -#line 341 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); + /* "root_numpy/src/tree.pyx":320 + * data_ptr = np.PyArray_GETPTR1(arr, num_entries_selected) + * for icol in range(num_columns): + * col = columns[icol] # <<<<<<<<<<<<<< + * conv = converters[icol] + * num_bytes = conv.write(col, data_ptr) + */ -#line 341 "root_numpy/src/tree.pyx" - } +#line 320 "root_numpy/src/tree.pyx" + __pyx_v_col = (__pyx_v_columns[__pyx_v_icol]); -#line 341 "root_numpy/src/tree.pyx" - __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_4); + /* "root_numpy/src/tree.pyx":321 + * for icol in range(num_columns): + * col = columns[icol] + * conv = converters[icol] # <<<<<<<<<<<<<< + * num_bytes = conv.write(col, data_ptr) + * data_ptr = shift(data_ptr, num_bytes) + */ -#line 341 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 321 "root_numpy/src/tree.pyx" + __pyx_v_conv = (__pyx_v_converters[__pyx_v_icol]); - /* "root_numpy/src/tree.pyx":342 - * ttree = new TChain(treename.c_str()) - * for fn in fnames: - * if ttree.Add(fn, -1) == 0: # <<<<<<<<<<<<<< - * raise IOError("unable to access tree '{0}' in {1}".format( - * treename, fn)) + /* "root_numpy/src/tree.pyx":322 + * col = columns[icol] + * conv = converters[icol] + * num_bytes = conv.write(col, data_ptr) # <<<<<<<<<<<<<< + * data_ptr = shift(data_ptr, num_bytes) + * if include_weight: */ -#line 342 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_fn); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 322 "root_numpy/src/tree.pyx" + __pyx_v_num_bytes = __pyx_v_conv->write(__pyx_v_col, __pyx_v_data_ptr); -#line 342 "root_numpy/src/tree.pyx" - __pyx_t_6 = ((__pyx_v_ttree->Add(__pyx_t_5, -1) == 0) != 0); + /* "root_numpy/src/tree.pyx":323 + * conv = converters[icol] + * num_bytes = conv.write(col, data_ptr) + * data_ptr = shift(data_ptr, num_bytes) # <<<<<<<<<<<<<< + * if include_weight: + * ( data_ptr)[0] = tree.GetWeight() + */ -#line 342 "root_numpy/src/tree.pyx" - if (__pyx_t_6) { +#line 323 "root_numpy/src/tree.pyx" + __pyx_v_data_ptr = shift(__pyx_v_data_ptr, __pyx_v_num_bytes); - /* "root_numpy/src/tree.pyx":343 - * for fn in fnames: - * if ttree.Add(fn, -1) == 0: - * raise IOError("unable to access tree '{0}' in {1}".format( # <<<<<<<<<<<<<< - * treename, fn)) - * ret = tree2array( +#line 323 "root_numpy/src/tree.pyx" + } + + /* "root_numpy/src/tree.pyx":324 + * num_bytes = conv.write(col, data_ptr) + * data_ptr = shift(data_ptr, num_bytes) + * if include_weight: # <<<<<<<<<<<<<< + * ( data_ptr)[0] = tree.GetWeight() + * */ -#line 343 "root_numpy/src/tree.pyx" - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unable_to_access_tree_0_in_1, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 324 "root_numpy/src/tree.pyx" + __pyx_t_3 = (__pyx_v_include_weight != 0); -#line 343 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 324 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":344 - * if ttree.Add(fn, -1) == 0: - * raise IOError("unable to access tree '{0}' in {1}".format( - * treename, fn)) # <<<<<<<<<<<<<< - * ret = tree2array( - * ttree, branches, + /* "root_numpy/src/tree.pyx":325 + * data_ptr = shift(data_ptr, num_bytes) + * if include_weight: + * ( data_ptr)[0] = tree.GetWeight() # <<<<<<<<<<<<<< + * + * # Increment number of selected entries last */ -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_8 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_treename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 325 "root_numpy/src/tree.pyx" + (((double *)__pyx_v_data_ptr)[0]) = __pyx_v_tree->GetWeight(); -#line 344 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_8); +#line 325 "root_numpy/src/tree.pyx" + goto __pyx_L50; -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_9 = NULL; +#line 325 "root_numpy/src/tree.pyx" + } -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_10 = 0; +#line 325 "root_numpy/src/tree.pyx" + __pyx_L50:; -#line 344 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { + /* "root_numpy/src/tree.pyx":328 + * + * # Increment number of selected entries last + * num_entries_selected += 1 # <<<<<<<<<<<<<< + * + * finally: + */ -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); +#line 328 "root_numpy/src/tree.pyx" + __pyx_v_num_entries_selected = (__pyx_v_num_entries_selected + 1); -#line 344 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_9)) { + /* "root_numpy/src/tree.pyx":304 + * # Loop on entries in the tree and write the data in the array + * indices = slice(start, stop, step).indices(num_entries) + * for ientry in xrange(*indices): # <<<<<<<<<<<<<< + * entry_size = chain.GetEntry(ientry) + * handle_load(entry_size) + */ -#line 344 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); +#line 304 "root_numpy/src/tree.pyx" + __pyx_L43_continue:; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_9); +#line 304 "root_numpy/src/tree.pyx" + } -#line 344 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 304 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_7, function); +#line 304 "root_numpy/src/tree.pyx" + } -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_10 = 1; + /* "root_numpy/src/tree.pyx":332 + * finally: + * # Delete TreeChain + * del chain # <<<<<<<<<<<<<< + * # Delete Columns + * for icol in range(columns.size()): + */ -#line 344 "root_numpy/src/tree.pyx" - } +#line 332 "root_numpy/src/tree.pyx" + /*finally:*/ { -#line 344 "root_numpy/src/tree.pyx" - } +#line 332 "root_numpy/src/tree.pyx" + /*normal exit:*/{ -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 332 "root_numpy/src/tree.pyx" + delete __pyx_v_chain; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_11); + /* "root_numpy/src/tree.pyx":334 + * del chain + * # Delete Columns + * for icol in range(columns.size()): # <<<<<<<<<<<<<< + * del columns[icol] + * + */ -#line 344 "root_numpy/src/tree.pyx" - if (__pyx_t_9) { +#line 334 "root_numpy/src/tree.pyx" + __pyx_t_24 = __pyx_v_columns.size(); -#line 344 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; +#line 334 "root_numpy/src/tree.pyx" + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { -#line 344 "root_numpy/src/tree.pyx" - } +#line 334 "root_numpy/src/tree.pyx" + __pyx_v_icol = __pyx_t_25; -#line 344 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_8); + /* "root_numpy/src/tree.pyx":335 + * # Delete Columns + * for icol in range(columns.size()): + * del columns[icol] # <<<<<<<<<<<<<< + * + * # Shrink the array if we selected fewer than num_entries entries + */ -#line 344 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_8); +#line 335 "root_numpy/src/tree.pyx" + delete (__pyx_v_columns[__pyx_v_icol]); -#line 344 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_fn); +#line 335 "root_numpy/src/tree.pyx" + } -#line 344 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_fn); +#line 335 "root_numpy/src/tree.pyx" + goto __pyx_L9; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_fn); +#line 335 "root_numpy/src/tree.pyx" + } -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_8 = 0; +#line 335 "root_numpy/src/tree.pyx" + /*exception exit:*/{ -#line 344 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 335 "root_numpy/src/tree.pyx" + __pyx_L8_error:; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 335 "root_numpy/src/tree.pyx" + __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __pyx_t_32 = 0; __pyx_t_33 = 0; __pyx_t_34 = 0; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; -#line 344 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "root_numpy/src/tree.pyx":343 - * for fn in fnames: - * if ttree.Add(fn, -1) == 0: - * raise IOError("unable to access tree '{0}' in {1}".format( # <<<<<<<<<<<<<< - * treename, fn)) - * ret = tree2array( - */ +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 343 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; -#line 343 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_7); +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 343 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; -#line 343 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_4); +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 343 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 343 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 343 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 335 "root_numpy/src/tree.pyx" + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_32, &__pyx_t_33, &__pyx_t_34); -#line 343 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 335 "root_numpy/src/tree.pyx" + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31) < 0)) __Pyx_ErrFetch(&__pyx_t_29, &__pyx_t_30, &__pyx_t_31); -#line 343 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_4, 0, 0, 0); +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_29); -#line 343 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_30); -#line 343 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_31); -#line 343 "root_numpy/src/tree.pyx" - } +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_32); - /* "root_numpy/src/tree.pyx":341 - * try: - * ttree = new TChain(treename.c_str()) - * for fn in fnames: # <<<<<<<<<<<<<< - * if ttree.Add(fn, -1) == 0: - * raise IOError("unable to access tree '{0}' in {1}".format( - */ +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_33); -#line 341 "root_numpy/src/tree.pyx" - } +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_34); -#line 341 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 335 "root_numpy/src/tree.pyx" + __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_28 = __pyx_filename; - /* "root_numpy/src/tree.pyx":347 - * ret = tree2array( - * ttree, branches, - * selection or '', start, stop, step, # <<<<<<<<<<<<<< - * include_weight, weight_name) +#line 335 "root_numpy/src/tree.pyx" + { + + /* "root_numpy/src/tree.pyx":332 * finally: + * # Delete TreeChain + * del chain # <<<<<<<<<<<<<< + * # Delete Columns + * for icol in range(columns.size()): */ -#line 347 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_selection); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - -#line 347 "root_numpy/src/tree.pyx" - if (!__pyx_t_6) { +#line 332 "root_numpy/src/tree.pyx" + delete __pyx_v_chain; -#line 347 "root_numpy/src/tree.pyx" - } else { + /* "root_numpy/src/tree.pyx":334 + * del chain + * # Delete Columns + * for icol in range(columns.size()): # <<<<<<<<<<<<<< + * del columns[icol] + * + */ -#line 347 "root_numpy/src/tree.pyx" - __pyx_t_13 = __pyx_convert_string_from_py_std__string(__pyx_v_selection); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 334 "root_numpy/src/tree.pyx" + __pyx_t_24 = __pyx_v_columns.size(); -#line 347 "root_numpy/src/tree.pyx" - __pyx_t_12 = __pyx_t_13; +#line 334 "root_numpy/src/tree.pyx" + for (__pyx_t_25 = 0; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) { -#line 347 "root_numpy/src/tree.pyx" - goto __pyx_L9_bool_binop_done; +#line 334 "root_numpy/src/tree.pyx" + __pyx_v_icol = __pyx_t_25; -#line 347 "root_numpy/src/tree.pyx" - } + /* "root_numpy/src/tree.pyx":335 + * # Delete Columns + * for icol in range(columns.size()): + * del columns[icol] # <<<<<<<<<<<<<< + * + * # Shrink the array if we selected fewer than num_entries entries + */ -#line 347 "root_numpy/src/tree.pyx" - __pyx_t_13 = __pyx_convert_string_from_py_std__string(__pyx_kp_s__24); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 335 "root_numpy/src/tree.pyx" + delete (__pyx_v_columns[__pyx_v_icol]); -#line 347 "root_numpy/src/tree.pyx" - __pyx_t_12 = __pyx_t_13; +#line 335 "root_numpy/src/tree.pyx" + } -#line 347 "root_numpy/src/tree.pyx" - __pyx_L9_bool_binop_done:; +#line 335 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":345 - * raise IOError("unable to access tree '{0}' in {1}".format( - * treename, fn)) - * ret = tree2array( # <<<<<<<<<<<<<< - * ttree, branches, - * selection or '', start, stop, step, - */ +#line 335 "root_numpy/src/tree.pyx" + if (PY_MAJOR_VERSION >= 3) { -#line 345 "root_numpy/src/tree.pyx" - __pyx_t_1 = __pyx_f_13_librootnumpy_tree2array(((TTree *)__pyx_v_ttree), __pyx_v_branches, __pyx_t_12, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_32); -#line 345 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_33); -#line 345 "root_numpy/src/tree.pyx" - __pyx_v_ret = __pyx_t_1; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_34); -#line 345 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_ExceptionReset(__pyx_t_32, __pyx_t_33, __pyx_t_34); -#line 345 "root_numpy/src/tree.pyx" - } +#line 335 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":350 - * include_weight, weight_name) - * finally: - * del ttree # <<<<<<<<<<<<<< - * return ret - * - */ +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_29); -#line 350 "root_numpy/src/tree.pyx" - /*finally:*/ { +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_30); -#line 350 "root_numpy/src/tree.pyx" - /*normal exit:*/{ +#line 335 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_31); -#line 350 "root_numpy/src/tree.pyx" - delete __pyx_v_ttree; +#line 335 "root_numpy/src/tree.pyx" + __Pyx_ErrRestore(__pyx_t_29, __pyx_t_30, __pyx_t_31); -#line 350 "root_numpy/src/tree.pyx" - goto __pyx_L5; +#line 335 "root_numpy/src/tree.pyx" + __pyx_t_29 = 0; __pyx_t_30 = 0; __pyx_t_31 = 0; __pyx_t_32 = 0; __pyx_t_33 = 0; __pyx_t_34 = 0; -#line 350 "root_numpy/src/tree.pyx" - } +#line 335 "root_numpy/src/tree.pyx" + __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_28; -#line 350 "root_numpy/src/tree.pyx" - /*exception exit:*/{ +#line 335 "root_numpy/src/tree.pyx" + goto __pyx_L1_error; -#line 350 "root_numpy/src/tree.pyx" - __pyx_L4_error:; +#line 335 "root_numpy/src/tree.pyx" + } -#line 350 "root_numpy/src/tree.pyx" - __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; +#line 335 "root_numpy/src/tree.pyx" + __pyx_L9:; -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; +#line 335 "root_numpy/src/tree.pyx" + } -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + /* "root_numpy/src/tree.pyx":338 + * + * # Shrink the array if we selected fewer than num_entries entries + * if num_entries_selected < num_entries: # <<<<<<<<<<<<<< + * arr.resize(num_entries_selected) + * + */ -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; +#line 338 "root_numpy/src/tree.pyx" + __pyx_t_3 = ((__pyx_v_num_entries_selected < __pyx_v_num_entries) != 0); -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 338 "root_numpy/src/tree.pyx" + if (__pyx_t_3) { -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + /* "root_numpy/src/tree.pyx":339 + * # Shrink the array if we selected fewer than num_entries entries + * if num_entries_selected < num_entries: + * arr.resize(num_entries_selected) # <<<<<<<<<<<<<< + * + * return arr + */ -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_resize); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 350 "root_numpy/src/tree.pyx" - if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); +#line 339 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_19); -#line 350 "root_numpy/src/tree.pyx" - if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_num_entries_selected); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_17); +#line 339 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_9); -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_18); +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_20 = NULL; -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_19); +#line 339 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_19))) { -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_20); +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19); -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_21); +#line 339 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_20)) { -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGOTREF(__pyx_t_22); +#line 339 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19); -#line 350 "root_numpy/src/tree.pyx" - __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; +#line 339 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_20); -#line 350 "root_numpy/src/tree.pyx" - { +#line 339 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 350 "root_numpy/src/tree.pyx" - delete __pyx_v_ttree; +#line 339 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_19, function); -#line 350 "root_numpy/src/tree.pyx" +#line 339 "root_numpy/src/tree.pyx" } -#line 350 "root_numpy/src/tree.pyx" - if (PY_MAJOR_VERSION >= 3) { +#line 339 "root_numpy/src/tree.pyx" + } -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_20); +#line 339 "root_numpy/src/tree.pyx" + if (!__pyx_t_20) { -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_21); +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_22); +#line 339 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 350 "root_numpy/src/tree.pyx" - __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); +#line 339 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 350 "root_numpy/src/tree.pyx" - } +#line 339 "root_numpy/src/tree.pyx" + } else { -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_17); +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_18); +#line 339 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_2); -#line 350 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_t_19); +#line 339 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = NULL; -#line 350 "root_numpy/src/tree.pyx" - __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); +#line 339 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_9); -#line 350 "root_numpy/src/tree.pyx" - __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; +#line 339 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_9); -#line 350 "root_numpy/src/tree.pyx" - __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_9 = 0; -#line 350 "root_numpy/src/tree.pyx" - goto __pyx_L1_error; +#line 339 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 350 "root_numpy/src/tree.pyx" +#line 339 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); + +#line 339 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + +#line 339 "root_numpy/src/tree.pyx" } -#line 350 "root_numpy/src/tree.pyx" - __pyx_L5:; +#line 339 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; -#line 350 "root_numpy/src/tree.pyx" +#line 339 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + +#line 339 "root_numpy/src/tree.pyx" + goto __pyx_L57; + +#line 339 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":351 - * finally: - * del ttree - * return ret # <<<<<<<<<<<<<< +#line 339 "root_numpy/src/tree.pyx" + __pyx_L57:; + + /* "root_numpy/src/tree.pyx":341 + * arr.resize(num_entries_selected) + * + * return arr # <<<<<<<<<<<<<< * * */ -#line 351 "root_numpy/src/tree.pyx" +#line 341 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_r); -#line 351 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_ret); +#line 341 "root_numpy/src/tree.pyx" + __Pyx_INCREF(((PyObject *)__pyx_v_arr)); -#line 351 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_v_ret; +#line 341 "root_numpy/src/tree.pyx" + __pyx_r = ((PyObject *)__pyx_v_arr); -#line 351 "root_numpy/src/tree.pyx" +#line 341 "root_numpy/src/tree.pyx" goto __pyx_L0; - /* "root_numpy/src/tree.pyx":335 + /* "root_numpy/src/tree.pyx":102 * * - * def root2array_fromFname(fnames, string treename, branches, # <<<<<<<<<<<<<< - * selection, start, stop, step, - * bool include_weight, string weight_name): + * cdef object tree2array(TTree* tree, branches, string selection, # <<<<<<<<<<<<<< + * start, stop, step, + * bool include_weight, string weight_name): */ -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" /* function exit code */ -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" __pyx_L1_error:; -#line 335 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_1); - -#line 335 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); - -#line 335 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_7); +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_2); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_8); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_9); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_10); + +#line 102 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_11); -#line 335 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.root2array_fromFname", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_19); -#line 335 "root_numpy/src/tree.pyx" - __pyx_r = NULL; +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_20); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_21); + +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_22); + +#line 102 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.tree2array", __pyx_clineno, __pyx_lineno, __pyx_filename); + +#line 102 "root_numpy/src/tree.pyx" + __pyx_r = 0; + +#line 102 "root_numpy/src/tree.pyx" __pyx_L0:; -#line 335 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_fn); +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF((PyObject *)__pyx_v_arr); -#line 335 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_ret); +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_branch_dict); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_expression); + +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_dtype); + +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_indices); + +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_idx); + +#line 102 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_b); + +#line 102 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_r); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" return __pyx_r; -#line 335 "root_numpy/src/tree.pyx" +#line 102 "root_numpy/src/tree.pyx" } -/* "root_numpy/src/tree.pyx":354 +/* "root_numpy/src/tree.pyx":344 * * - * def root2array_fromCObj(tree, branches, selection, # <<<<<<<<<<<<<< - * start, stop, step, - * bool include_weight, string weight_name): + * def root2array_fromFname(fnames, string treename, branches, # <<<<<<<<<<<<<< + * selection, start, stop, step, + * bool include_weight, string weight_name): */ -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" /* Python wrapper */ -#line 354 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_11root2array_fromCObj(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_13_librootnumpy_11root2array_fromCObj = -#line 354 "root_numpy/src/tree.pyx" -{"root2array_fromCObj", (PyCFunction)__pyx_pw_13_librootnumpy_11root2array_fromCObj, METH_VARARGS|METH_KEYWORDS, 0}; +#line 344 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_9root2array_fromFname(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_13_librootnumpy_9root2array_fromFname = +#line 344 "root_numpy/src/tree.pyx" +{"root2array_fromFname", (PyCFunction)__pyx_pw_13_librootnumpy_9root2array_fromFname, METH_VARARGS|METH_KEYWORDS, 0}; -#line 354 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pw_13_librootnumpy_11root2array_fromCObj(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_tree = 0 -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_9root2array_fromFname(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_fnames = 0 +#line 344 "root_numpy/src/tree.pyx" +; + std::string __pyx_v_treename +#line 344 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_branches = 0 -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_selection = 0 -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_start = 0 -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_stop = 0 -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_step = 0 -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; bool __pyx_v_include_weight -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; std::string __pyx_v_weight_name -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" ; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" PyObject *__pyx_r = 0; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" __Pyx_RefNannyDeclarations -#line 354 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("root2array_fromCObj (wrapper)", 0); +#line 344 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("root2array_fromFname (wrapper)", 0); -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" { -#line 354 "root_numpy/src/tree.pyx" - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_branches,&__pyx_n_s_selection,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,&__pyx_n_s_include_weight,&__pyx_n_s_weight_name,0}; +#line 344 "root_numpy/src/tree.pyx" + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fnames,&__pyx_n_s_treename,&__pyx_n_s_branches,&__pyx_n_s_selection,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,&__pyx_n_s_include_weight,&__pyx_n_s_weight_name,0}; -#line 354 "root_numpy/src/tree.pyx" - PyObject* values[8] = {0,0,0,0,0,0,0,0}; +#line 344 "root_numpy/src/tree.pyx" + PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" if (unlikely(__pyx_kwds)) { -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" Py_ssize_t kw_args; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" switch (pos_args) { + case 9: +#line 344 "root_numpy/src/tree.pyx" +values[8] = PyTuple_GET_ITEM(__pyx_args, 8); case 8: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[7] = PyTuple_GET_ITEM(__pyx_args, 7); case 7: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[6] = PyTuple_GET_ITEM(__pyx_args, 6); case 6: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[5] = PyTuple_GET_ITEM(__pyx_args, 5); case 5: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[4] = PyTuple_GET_ITEM(__pyx_args, 4); case 4: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" case 0: break; default: -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" } -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" kw_args = PyDict_Size(__pyx_kwds); -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" switch (pos_args) { -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" case 0: -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--; +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fnames)) != 0)) kw_args--; else -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" case 1: -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_branches)) != 0)) kw_args--; +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_treename)) != 0)) kw_args--; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 1); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 1); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" } -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" case 2: -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selection)) != 0)) kw_args--; - -#line 354 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 2); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - case 3: - -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; - -#line 354 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 3); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - case 4: - -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; - -#line 354 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 4); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - case 5: - -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--; - -#line 354 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 5); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - case 6: - -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_weight)) != 0)) kw_args--; - -#line 354 "root_numpy/src/tree.pyx" - else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 6); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - case 7: - -#line 354 "root_numpy/src/tree.pyx" - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight_name)) != 0)) kw_args--; +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_branches)) != 0)) kw_args--; -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" else { - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 7); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 2); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" } -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - if (unlikely(kw_args > 0)) { - -#line 354 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "root2array_fromCObj") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { - -#line 354 "root_numpy/src/tree.pyx" - goto __pyx_L5_argtuple_error; - -#line 354 "root_numpy/src/tree.pyx" - } else { - -#line 354 "root_numpy/src/tree.pyx" - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - -#line 354 "root_numpy/src/tree.pyx" - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - -#line 354 "root_numpy/src/tree.pyx" - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - -#line 354 "root_numpy/src/tree.pyx" - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - -#line 354 "root_numpy/src/tree.pyx" - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - -#line 354 "root_numpy/src/tree.pyx" - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - -#line 354 "root_numpy/src/tree.pyx" - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - -#line 354 "root_numpy/src/tree.pyx" - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_tree = values[0]; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_branches = values[1]; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_selection = values[2]; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_start = values[3]; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_stop = values[4]; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_step = values[5]; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_include_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_include_weight == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - __pyx_v_weight_name = __pyx_convert_string_from_py_std__string(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - } - -#line 354 "root_numpy/src/tree.pyx" - goto __pyx_L4_argument_unpacking_done; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); -#line 354 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - -#line 354 "root_numpy/src/tree.pyx" - __pyx_L3_error:; - -#line 354 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.root2array_fromCObj", __pyx_clineno, __pyx_lineno, __pyx_filename); - -#line 354 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); - -#line 354 "root_numpy/src/tree.pyx" - return NULL; - -#line 354 "root_numpy/src/tree.pyx" - __pyx_L4_argument_unpacking_done:; - __pyx_r = -#line 354 "root_numpy/src/tree.pyx" -__pyx_pf_13_librootnumpy_10root2array_fromCObj(__pyx_self, __pyx_v_tree, __pyx_v_branches, __pyx_v_selection, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); - -#line 354 "root_numpy/src/tree.pyx" - - -#line 354 "root_numpy/src/tree.pyx" - /* function exit code */ - -#line 354 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 344 "root_numpy/src/tree.pyx" + case 3: -#line 354 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selection)) != 0)) kw_args--; -#line 354 "root_numpy/src/tree.pyx" -} +#line 344 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 3); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" + } +#line 344 "root_numpy/src/tree.pyx" + case 4: -#line 354 "root_numpy/src/tree.pyx" -static PyObject *__pyx_pf_13_librootnumpy_10root2array_fromCObj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tree, PyObject *__pyx_v_branches, PyObject *__pyx_v_selection, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, bool __pyx_v_include_weight, std::string __pyx_v_weight_name) { - TTree *__pyx_v_chain -#line 354 "root_numpy/src/tree.pyx" -; +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; -#line 354 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - void *__pyx_t_1; - std::string __pyx_t_2; - int __pyx_t_3; - std::string __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 344 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 4); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 354 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("root2array_fromCObj", 0); +#line 344 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":357 - * start, stop, step, - * bool include_weight, string weight_name): - * cdef TTree* chain = PyCObject_AsVoidPtr(tree) # <<<<<<<<<<<<<< - * return tree2array( - * chain, branches, - */ +#line 344 "root_numpy/src/tree.pyx" + case 5: -#line 357 "root_numpy/src/tree.pyx" - __pyx_t_1 = PyCObject_AsVoidPtr(__pyx_v_tree); if (unlikely(__pyx_t_1 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; -#line 357 "root_numpy/src/tree.pyx" - __pyx_v_chain = ((TTree *)__pyx_t_1); +#line 344 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 5); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - /* "root_numpy/src/tree.pyx":358 - * bool include_weight, string weight_name): - * cdef TTree* chain = PyCObject_AsVoidPtr(tree) - * return tree2array( # <<<<<<<<<<<<<< - * chain, branches, - * selection or '', start, stop, step, - */ +#line 344 "root_numpy/src/tree.pyx" + } -#line 358 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_r); +#line 344 "root_numpy/src/tree.pyx" + case 6: - /* "root_numpy/src/tree.pyx":360 - * return tree2array( - * chain, branches, - * selection or '', start, stop, step, # <<<<<<<<<<<<<< - * include_weight, weight_name) - * - */ +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--; -#line 360 "root_numpy/src/tree.pyx" - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_selection); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 6); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 360 "root_numpy/src/tree.pyx" - if (!__pyx_t_3) { +#line 344 "root_numpy/src/tree.pyx" + } -#line 360 "root_numpy/src/tree.pyx" - } else { +#line 344 "root_numpy/src/tree.pyx" + case 7: -#line 360 "root_numpy/src/tree.pyx" - __pyx_t_4 = __pyx_convert_string_from_py_std__string(__pyx_v_selection); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_weight)) != 0)) kw_args--; -#line 360 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_t_4; +#line 344 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 7); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 360 "root_numpy/src/tree.pyx" - goto __pyx_L3_bool_binop_done; +#line 344 "root_numpy/src/tree.pyx" + } -#line 360 "root_numpy/src/tree.pyx" - } +#line 344 "root_numpy/src/tree.pyx" + case 8: -#line 360 "root_numpy/src/tree.pyx" - __pyx_t_4 = __pyx_convert_string_from_py_std__string(__pyx_kp_s__24); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight_name)) != 0)) kw_args--; -#line 360 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_t_4; +#line 344 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, 8); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 360 "root_numpy/src/tree.pyx" - __pyx_L3_bool_binop_done:; +#line 344 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":358 - * bool include_weight, string weight_name): - * cdef TTree* chain = PyCObject_AsVoidPtr(tree) - * return tree2array( # <<<<<<<<<<<<<< - * chain, branches, - * selection or '', start, stop, step, - */ +#line 344 "root_numpy/src/tree.pyx" + } -#line 358 "root_numpy/src/tree.pyx" - __pyx_t_5 = __pyx_f_13_librootnumpy_tree2array(__pyx_v_chain, __pyx_v_branches, __pyx_t_2, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + if (unlikely(kw_args > 0)) { -#line 358 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 344 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "root2array_fromFname") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 358 "root_numpy/src/tree.pyx" - __pyx_r = __pyx_t_5; +#line 344 "root_numpy/src/tree.pyx" + } -#line 358 "root_numpy/src/tree.pyx" - __pyx_t_5 = 0; +#line 344 "root_numpy/src/tree.pyx" + } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { -#line 358 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 344 "root_numpy/src/tree.pyx" + goto __pyx_L5_argtuple_error; - /* "root_numpy/src/tree.pyx":354 - * - * - * def root2array_fromCObj(tree, branches, selection, # <<<<<<<<<<<<<< - * start, stop, step, - * bool include_weight, string weight_name): - */ +#line 344 "root_numpy/src/tree.pyx" + } else { -#line 354 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); +#line 344 "root_numpy/src/tree.pyx" + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); -#line 354 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 344 "root_numpy/src/tree.pyx" + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); -#line 354 "root_numpy/src/tree.pyx" - __pyx_L1_error:; +#line 344 "root_numpy/src/tree.pyx" + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); -#line 354 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_5); +#line 344 "root_numpy/src/tree.pyx" + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); -#line 354 "root_numpy/src/tree.pyx" - __Pyx_AddTraceback("_librootnumpy.root2array_fromCObj", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 344 "root_numpy/src/tree.pyx" + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); -#line 354 "root_numpy/src/tree.pyx" - __pyx_r = NULL; +#line 344 "root_numpy/src/tree.pyx" + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); -#line 354 "root_numpy/src/tree.pyx" - __pyx_L0:; +#line 344 "root_numpy/src/tree.pyx" + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); -#line 354 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 344 "root_numpy/src/tree.pyx" + values[8] = PyTuple_GET_ITEM(__pyx_args, 8); -#line 354 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 344 "root_numpy/src/tree.pyx" + } -#line 354 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_fnames = values[0]; -#line 354 "root_numpy/src/tree.pyx" -} +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_treename = __pyx_convert_string_from_py_std__string(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -/* "root_numpy/src/tree.pyx":370 - * cdef cppclass NP2CConverter: - * - * void fill_from(void* source): # <<<<<<<<<<<<<< - * pass - * - */ +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_branches = values[2]; -#line 370 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_selection = values[3]; +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_start = values[4]; -#line 370 "root_numpy/src/tree.pyx" -void __pyx_t_13_librootnumpy_NP2CConverter::fill_from(CYTHON_UNUSED void *__pyx_v_source) { - __Pyx_RefNannyDeclarations +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_stop = values[5]; -#line 370 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("fill_from", 0); +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_step = values[6]; -#line 370 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_include_weight = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_include_weight == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 344 "root_numpy/src/tree.pyx" + __pyx_v_weight_name = __pyx_convert_string_from_py_std__string(values[8]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 370 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 344 "root_numpy/src/tree.pyx" + } -#line 370 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 344 "root_numpy/src/tree.pyx" + goto __pyx_L4_argument_unpacking_done; -#line 370 "root_numpy/src/tree.pyx" -} +#line 344 "root_numpy/src/tree.pyx" + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("root2array_fromFname", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); +#line 344 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -/* "root_numpy/src/tree.pyx":373 - * pass - * - * __dealloc__(): # <<<<<<<<<<<<<< - * pass - * - */ +#line 344 "root_numpy/src/tree.pyx" + __pyx_L3_error:; -#line 373 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.root2array_fromFname", __pyx_clineno, __pyx_lineno, __pyx_filename); +#line 344 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 373 "root_numpy/src/tree.pyx" - __pyx_t_13_librootnumpy_NP2CConverter::~__pyx_t_13_librootnumpy_NP2CConverter(void) { - __Pyx_RefNannyDeclarations +#line 344 "root_numpy/src/tree.pyx" + return NULL; -#line 373 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("", 0); +#line 344 "root_numpy/src/tree.pyx" + __pyx_L4_argument_unpacking_done:; + __pyx_r = +#line 344 "root_numpy/src/tree.pyx" +__pyx_pf_13_librootnumpy_8root2array_fromFname(__pyx_self, __pyx_v_fnames, __pyx_v_treename, __pyx_v_branches, __pyx_v_selection, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); -#line 373 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" -#line 373 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" /* function exit code */ -#line 373 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 373 "root_numpy/src/tree.pyx" -} +#line 344 "root_numpy/src/tree.pyx" + return __pyx_r; -/* "root_numpy/src/tree.pyx":384 - * TBranch* branch - * - * __init__(TTree* tree, string name, string roottype, int nbytes): # <<<<<<<<<<<<<< - * cdef string leaflist - * this.nbytes = nbytes - */ +#line 344 "root_numpy/src/tree.pyx" +} -#line 384 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" -#line 384 "root_numpy/src/tree.pyx" - __pyx_t_13_librootnumpy_ScalarNP2CConverter::__pyx_t_13_librootnumpy_ScalarNP2CConverter(TTree *__pyx_v_tree, std::string __pyx_v_name, std::string __pyx_v_roottype, int __pyx_v_nbytes) { - std::string __pyx_v_leaflist -#line 384 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pf_13_librootnumpy_8root2array_fromFname(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fnames, std::string __pyx_v_treename, PyObject *__pyx_v_branches, PyObject *__pyx_v_selection, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, bool __pyx_v_include_weight, std::string __pyx_v_weight_name) { + TChain *__pyx_v_ttree +#line 344 "root_numpy/src/tree.pyx" ; - PyObject *__pyx_v_existing_type = NULL -#line 384 "root_numpy/src/tree.pyx" + PyObject *__pyx_v_fn = NULL +#line 344 "root_numpy/src/tree.pyx" ; + PyObject *__pyx_v_ret = NULL +#line 344 "root_numpy/src/tree.pyx" +; + +#line 344 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); PyObject *__pyx_t_4 = NULL; - std::string __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + const char *__pyx_t_5; + int __pyx_t_6; PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; + PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + std::string __pyx_t_12; + std::string __pyx_t_13; + int __pyx_t_14; + int __pyx_t_15; + char const *__pyx_t_16; + PyObject *__pyx_t_17 = NULL; + PyObject *__pyx_t_18 = NULL; + PyObject *__pyx_t_19 = NULL; + PyObject *__pyx_t_20 = NULL; + PyObject *__pyx_t_21 = NULL; + PyObject *__pyx_t_22 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 384 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("", 0); - - /* "root_numpy/src/tree.pyx":386 - * __init__(TTree* tree, string name, string roottype, int nbytes): - * cdef string leaflist - * this.nbytes = nbytes # <<<<<<<<<<<<<< - * this.roottype = roottype - * this.name = name - */ - -#line 386 "root_numpy/src/tree.pyx" - this->nbytes = __pyx_v_nbytes; +#line 344 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("root2array_fromFname", 0); - /* "root_numpy/src/tree.pyx":387 - * cdef string leaflist - * this.nbytes = nbytes - * this.roottype = roottype # <<<<<<<<<<<<<< - * this.name = name - * this.value = malloc(nbytes) + /* "root_numpy/src/tree.pyx":347 + * selection, start, stop, step, + * bool include_weight, string weight_name): + * cdef TChain* ttree = NULL # <<<<<<<<<<<<<< + * try: + * ttree = new TChain(treename.c_str()) */ -#line 387 "root_numpy/src/tree.pyx" - this->roottype = __pyx_v_roottype; +#line 347 "root_numpy/src/tree.pyx" + __pyx_v_ttree = NULL; - /* "root_numpy/src/tree.pyx":388 - * this.nbytes = nbytes - * this.roottype = roottype - * this.name = name # <<<<<<<<<<<<<< - * this.value = malloc(nbytes) - * this.branch = tree.GetBranch(this.name.c_str()) + /* "root_numpy/src/tree.pyx":348 + * bool include_weight, string weight_name): + * cdef TChain* ttree = NULL + * try: # <<<<<<<<<<<<<< + * ttree = new TChain(treename.c_str()) + * for fn in fnames: */ -#line 388 "root_numpy/src/tree.pyx" - this->name = __pyx_v_name; +#line 348 "root_numpy/src/tree.pyx" + /*try:*/ { - /* "root_numpy/src/tree.pyx":389 - * this.roottype = roottype - * this.name = name - * this.value = malloc(nbytes) # <<<<<<<<<<<<<< - * this.branch = tree.GetBranch(this.name.c_str()) - * if this.branch == NULL: + /* "root_numpy/src/tree.pyx":349 + * cdef TChain* ttree = NULL + * try: + * ttree = new TChain(treename.c_str()) # <<<<<<<<<<<<<< + * for fn in fnames: + * if ttree.Add(fn, -1) == 0: */ -#line 389 "root_numpy/src/tree.pyx" - this->value = malloc(__pyx_v_nbytes); +#line 349 "root_numpy/src/tree.pyx" + __pyx_v_ttree = new TChain(__pyx_v_treename.c_str()); - /* "root_numpy/src/tree.pyx":390 - * this.name = name - * this.value = malloc(nbytes) - * this.branch = tree.GetBranch(this.name.c_str()) # <<<<<<<<<<<<<< - * if this.branch == NULL: - * leaflist = this.name + '/' + this.roottype + /* "root_numpy/src/tree.pyx":350 + * try: + * ttree = new TChain(treename.c_str()) + * for fn in fnames: # <<<<<<<<<<<<<< + * if ttree.Add(fn, -1) == 0: + * raise IOError("unable to access tree '{0}' in {1}".format( */ -#line 390 "root_numpy/src/tree.pyx" - this->branch = __pyx_v_tree->GetBranch(this->name.c_str()); - - /* "root_numpy/src/tree.pyx":391 - * this.value = malloc(nbytes) - * this.branch = tree.GetBranch(this.name.c_str()) - * if this.branch == NULL: # <<<<<<<<<<<<<< - * leaflist = this.name + '/' + this.roottype - * this.branch = tree.Branch(this.name.c_str(), this.value, leaflist.c_str()) - */ +#line 350 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_v_fnames)) || PyTuple_CheckExact(__pyx_v_fnames)) { -#line 391 "root_numpy/src/tree.pyx" - __pyx_t_1 = ((this->branch == NULL) != 0); +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_1 = __pyx_v_fnames; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; -#line 391 "root_numpy/src/tree.pyx" - if (__pyx_t_1) { +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_3 = NULL; - /* "root_numpy/src/tree.pyx":392 - * this.branch = tree.GetBranch(this.name.c_str()) - * if this.branch == NULL: - * leaflist = this.name + '/' + this.roottype # <<<<<<<<<<<<<< - * this.branch = tree.Branch(this.name.c_str(), this.value, leaflist.c_str()) - * else: - */ +#line 350 "root_numpy/src/tree.pyx" + } else { + __pyx_t_2 = -1; +#line 350 "root_numpy/src/tree.pyx" +__pyx_t_1 = PyObject_GetIter(__pyx_v_fnames); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 392 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_convert_PyStr_string_to_py_std__string(this->name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 392 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 392 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s__25); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + } -#line 392 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 350 "root_numpy/src/tree.pyx" + for (;;) { -#line 392 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 350 "root_numpy/src/tree.pyx" + if (likely(!__pyx_t_3)) { -#line 392 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_convert_PyStr_string_to_py_std__string(this->roottype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + if (likely(PyList_CheckExact(__pyx_t_1))) { -#line 392 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 350 "root_numpy/src/tree.pyx" + if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; -#line 392 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 392 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 392 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +#line 350 "root_numpy/src/tree.pyx" + #else -#line 392 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 392 "root_numpy/src/tree.pyx" - __pyx_t_5 = __pyx_convert_string_from_py_std__string(__pyx_t_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + #endif -#line 392 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 350 "root_numpy/src/tree.pyx" + } else { -#line 392 "root_numpy/src/tree.pyx" - __pyx_v_leaflist = __pyx_t_5; +#line 350 "root_numpy/src/tree.pyx" + if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - /* "root_numpy/src/tree.pyx":393 - * if this.branch == NULL: - * leaflist = this.name + '/' + this.roottype - * this.branch = tree.Branch(this.name.c_str(), this.value, leaflist.c_str()) # <<<<<<<<<<<<<< - * else: - * # check type compatibility of existing branch - */ +#line 350 "root_numpy/src/tree.pyx" + #if CYTHON_COMPILING_IN_CPYTHON -#line 393 "root_numpy/src/tree.pyx" - this->branch = __pyx_v_tree->Branch(this->name.c_str(), this->value, __pyx_v_leaflist.c_str()); +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 393 "root_numpy/src/tree.pyx" - goto __pyx_L3; +#line 350 "root_numpy/src/tree.pyx" + #else -#line 393 "root_numpy/src/tree.pyx" - } +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 393 "root_numpy/src/tree.pyx" - /*else*/ { +#line 350 "root_numpy/src/tree.pyx" + #endif - /* "root_numpy/src/tree.pyx":396 - * else: - * # check type compatibility of existing branch - * existing_type = this.branch.GetTitle().rpartition('/')[-1] # <<<<<<<<<<<<<< - * if str(roottype) != existing_type: - * raise TypeError( - */ +#line 350 "root_numpy/src/tree.pyx" + } + } else +#line 350 "root_numpy/src/tree.pyx" +{ -#line 396 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyStr_FromString(this->branch->GetTitle()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_4 = __pyx_t_3(__pyx_t_1); -#line 396 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 350 "root_numpy/src/tree.pyx" + if (unlikely(!__pyx_t_4)) { -#line 396 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_rpartition); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + PyObject* exc_type = PyErr_Occurred(); -#line 396 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 350 "root_numpy/src/tree.pyx" + if (exc_type) { -#line 396 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 350 "root_numpy/src/tree.pyx" + if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 396 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/tree.pyx" + else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 396 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 350 "root_numpy/src/tree.pyx" + } -#line 396 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 350 "root_numpy/src/tree.pyx" + break; -#line 396 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 350 "root_numpy/src/tree.pyx" + } -#line 396 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 350 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 396 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 350 "root_numpy/src/tree.pyx" + } -#line 396 "root_numpy/src/tree.pyx" - __pyx_v_existing_type = __pyx_t_2; +#line 350 "root_numpy/src/tree.pyx" + __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_4); -#line 396 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; +#line 350 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; - /* "root_numpy/src/tree.pyx":397 - * # check type compatibility of existing branch - * existing_type = this.branch.GetTitle().rpartition('/')[-1] - * if str(roottype) != existing_type: # <<<<<<<<<<<<<< - * raise TypeError( - * "field '{0}' of type '{1}' is not compatible " + /* "root_numpy/src/tree.pyx":351 + * ttree = new TChain(treename.c_str()) + * for fn in fnames: + * if ttree.Add(fn, -1) == 0: # <<<<<<<<<<<<<< + * raise IOError("unable to access tree '{0}' in {1}".format( + * treename, fn)) */ -#line 397 "root_numpy/src/tree.pyx" - __pyx_t_2 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_roottype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 397 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 397 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 397 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); - -#line 397 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - -#line 397 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_2); - -#line 397 "root_numpy/src/tree.pyx" - __pyx_t_2 = 0; - -#line 397 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 397 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); - -#line 397 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - -#line 397 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_existing_type, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 397 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - -#line 397 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 351 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_fn); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 397 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 351 "root_numpy/src/tree.pyx" + __pyx_t_6 = ((__pyx_v_ttree->Add(__pyx_t_5, -1) == 0) != 0); -#line 397 "root_numpy/src/tree.pyx" - if (__pyx_t_1) { +#line 351 "root_numpy/src/tree.pyx" + if (__pyx_t_6) { - /* "root_numpy/src/tree.pyx":400 - * raise TypeError( - * "field '{0}' of type '{1}' is not compatible " - * "with existing branch of type '{2}'".format( # <<<<<<<<<<<<<< - * name, roottype, existing_type)) - * this.branch.SetAddress(this.value) + /* "root_numpy/src/tree.pyx":352 + * for fn in fnames: + * if ttree.Add(fn, -1) == 0: + * raise IOError("unable to access tree '{0}' in {1}".format( # <<<<<<<<<<<<<< + * treename, fn)) + * ret = tree2array( */ -#line 400 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_field_0_of_type_1_is_not_compati, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 352 "root_numpy/src/tree.pyx" + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_unable_to_access_tree_0_in_1, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 400 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 352 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_7); - /* "root_numpy/src/tree.pyx":401 - * "field '{0}' of type '{1}' is not compatible " - * "with existing branch of type '{2}'".format( - * name, roottype, existing_type)) # <<<<<<<<<<<<<< - * this.branch.SetAddress(this.value) - * this.branch.SetStatus(1) + /* "root_numpy/src/tree.pyx":353 + * if ttree.Add(fn, -1) == 0: + * raise IOError("unable to access tree '{0}' in {1}".format( + * treename, fn)) # <<<<<<<<<<<<<< + * ret = tree2array( + * ttree, branches, */ -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_3 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_3); +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_8 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_treename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_6 = __pyx_convert_PyStr_string_to_py_std__string(__pyx_v_roottype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 353 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_8); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_9 = NULL; -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_7 = NULL; +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_10 = 0; -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_8 = 0; +#line 353 "root_numpy/src/tree.pyx" + if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) { -#line 401 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) { +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); +#line 353 "root_numpy/src/tree.pyx" + if (likely(__pyx_t_9)) { -#line 401 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_7)) { +#line 353 "root_numpy/src/tree.pyx" + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); -#line 401 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_t_9); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_7); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_INCREF(function); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_DECREF_SET(__pyx_t_7, function); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_2, function); +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_10 = 1; -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_8 = 1; +#line 353 "root_numpy/src/tree.pyx" + } -#line 401 "root_numpy/src/tree.pyx" +#line 353 "root_numpy/src/tree.pyx" } -#line 401 "root_numpy/src/tree.pyx" - } - -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_9); +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 401 "root_numpy/src/tree.pyx" - if (__pyx_t_7) { +#line 353 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_11); -#line 401 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL; +#line 353 "root_numpy/src/tree.pyx" + if (__pyx_t_9) { -#line 401 "root_numpy/src/tree.pyx" - } +#line 353 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL; -#line 401 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3); +#line 353 "root_numpy/src/tree.pyx" + } -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_3); +#line 353 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_8); -#line 401 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_8); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_6); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_fn); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_existing_type); +#line 353 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_fn); -#line 401 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_v_existing_type); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_v_fn); -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_existing_type); +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_8 = 0; -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_3 = 0; +#line 353 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_6 = 0; +#line 353 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 401 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 353 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; -#line 401 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 353 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; -#line 401 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + /* "root_numpy/src/tree.pyx":352 + * for fn in fnames: + * if ttree.Add(fn, -1) == 0: + * raise IOError("unable to access tree '{0}' in {1}".format( # <<<<<<<<<<<<<< + * treename, fn)) + * ret = tree2array( + */ -#line 401 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 352 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;} - /* "root_numpy/src/tree.pyx":398 - * existing_type = this.branch.GetTitle().rpartition('/')[-1] - * if str(roottype) != existing_type: - * raise TypeError( # <<<<<<<<<<<<<< - * "field '{0}' of type '{1}' is not compatible " - * "with existing branch of type '{2}'".format( - */ +#line 352 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_7); -#line 398 "root_numpy/src/tree.pyx" - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 352 "root_numpy/src/tree.pyx" + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); -#line 398 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_2); +#line 352 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_t_4); -#line 398 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); +#line 352 "root_numpy/src/tree.pyx" + __pyx_t_4 = 0; -#line 398 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_4); +#line 352 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 398 "root_numpy/src/tree.pyx" - __pyx_t_4 = 0; +#line 352 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_4); -#line 398 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 352 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; -#line 398 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 352 "root_numpy/src/tree.pyx" + __Pyx_Raise(__pyx_t_4, 0, 0, 0); -#line 398 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +#line 352 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 398 "root_numpy/src/tree.pyx" - __Pyx_Raise(__pyx_t_4, 0, 0, 0); +#line 352 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 398 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 352 "root_numpy/src/tree.pyx" + } -#line 398 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/tree.pyx":350 + * try: + * ttree = new TChain(treename.c_str()) + * for fn in fnames: # <<<<<<<<<<<<<< + * if ttree.Add(fn, -1) == 0: + * raise IOError("unable to access tree '{0}' in {1}".format( + */ -#line 398 "root_numpy/src/tree.pyx" +#line 350 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":402 - * "with existing branch of type '{2}'".format( - * name, roottype, existing_type)) - * this.branch.SetAddress(this.value) # <<<<<<<<<<<<<< - * this.branch.SetStatus(1) - * +#line 350 "root_numpy/src/tree.pyx" + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "root_numpy/src/tree.pyx":356 + * ret = tree2array( + * ttree, branches, + * selection or '', start, stop, step, # <<<<<<<<<<<<<< + * include_weight, weight_name) + * finally: */ -#line 402 "root_numpy/src/tree.pyx" - this->branch->SetAddress(this->value); +#line 356 "root_numpy/src/tree.pyx" + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_selection); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 402 "root_numpy/src/tree.pyx" - } +#line 356 "root_numpy/src/tree.pyx" + if (!__pyx_t_6) { -#line 402 "root_numpy/src/tree.pyx" - __pyx_L3:; +#line 356 "root_numpy/src/tree.pyx" + } else { - /* "root_numpy/src/tree.pyx":403 - * name, roottype, existing_type)) - * this.branch.SetAddress(this.value) - * this.branch.SetStatus(1) # <<<<<<<<<<<<<< - * - * __del__(self): # does this do what I want? - */ +#line 356 "root_numpy/src/tree.pyx" + __pyx_t_13 = __pyx_convert_string_from_py_std__string(__pyx_v_selection); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L4_error;} -#line 403 "root_numpy/src/tree.pyx" - this->branch->SetStatus(1); +#line 356 "root_numpy/src/tree.pyx" + __pyx_t_12 = __pyx_t_13; - /* "root_numpy/src/tree.pyx":384 - * TBranch* branch - * - * __init__(TTree* tree, string name, string roottype, int nbytes): # <<<<<<<<<<<<<< - * cdef string leaflist - * this.nbytes = nbytes +#line 356 "root_numpy/src/tree.pyx" + goto __pyx_L9_bool_binop_done; + +#line 356 "root_numpy/src/tree.pyx" + } + +#line 356 "root_numpy/src/tree.pyx" + __pyx_t_13 = __pyx_convert_string_from_py_std__string(__pyx_kp_s__26); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L4_error;} + +#line 356 "root_numpy/src/tree.pyx" + __pyx_t_12 = __pyx_t_13; + +#line 356 "root_numpy/src/tree.pyx" + __pyx_L9_bool_binop_done:; + + /* "root_numpy/src/tree.pyx":354 + * raise IOError("unable to access tree '{0}' in {1}".format( + * treename, fn)) + * ret = tree2array( # <<<<<<<<<<<<<< + * ttree, branches, + * selection or '', start, stop, step, */ -#line 384 "root_numpy/src/tree.pyx" +#line 354 "root_numpy/src/tree.pyx" + __pyx_t_1 = __pyx_f_13_librootnumpy_tree2array(((TTree *)__pyx_v_ttree), __pyx_v_branches, __pyx_t_12, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L4_error;} +#line 354 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_1); -#line 384 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 354 "root_numpy/src/tree.pyx" + __pyx_v_ret = __pyx_t_1; -#line 384 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 354 "root_numpy/src/tree.pyx" + __pyx_t_1 = 0; -#line 384 "root_numpy/src/tree.pyx" - __pyx_L1_error:; +#line 354 "root_numpy/src/tree.pyx" + } -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_2); + /* "root_numpy/src/tree.pyx":359 + * include_weight, weight_name) + * finally: + * del ttree # <<<<<<<<<<<<<< + * return ret + * + */ -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_3); +#line 359 "root_numpy/src/tree.pyx" + /*finally:*/ { -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); +#line 359 "root_numpy/src/tree.pyx" + /*normal exit:*/{ -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_6); +#line 359 "root_numpy/src/tree.pyx" + delete __pyx_v_ttree; -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_7); +#line 359 "root_numpy/src/tree.pyx" + goto __pyx_L5; -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_9); +#line 359 "root_numpy/src/tree.pyx" + } -#line 384 "root_numpy/src/tree.pyx" - __Pyx_WriteUnraisable("ScalarNP2CConverter.", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 359 "root_numpy/src/tree.pyx" + /*exception exit:*/{ -#line 384 "root_numpy/src/tree.pyx" - __pyx_L0:; +#line 359 "root_numpy/src/tree.pyx" + __pyx_L4_error:; -#line 384 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_existing_type); +#line 359 "root_numpy/src/tree.pyx" + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; -#line 384 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 384 "root_numpy/src/tree.pyx" -} +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; -/* "root_numpy/src/tree.pyx":405 - * this.branch.SetStatus(1) - * - * __del__(self): # does this do what I want? # <<<<<<<<<<<<<< - * free(this.value) - * - */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; -#line 405 "root_numpy/src/tree.pyx" +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 405 "root_numpy/src/tree.pyx" -PyObject *__pyx_t_13_librootnumpy_ScalarNP2CConverter::__del__(CYTHON_UNUSED PyObject *__pyx_v_self) { +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 405 "root_numpy/src/tree.pyx" - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations +#line 359 "root_numpy/src/tree.pyx" + if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); -#line 405 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("__del__", 0); +#line 359 "root_numpy/src/tree.pyx" + if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19); - /* "root_numpy/src/tree.pyx":406 - * - * __del__(self): # does this do what I want? - * free(this.value) # <<<<<<<<<<<<<< - * - * void fill_from(void* source): - */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_17); -#line 406 "root_numpy/src/tree.pyx" - free(this->value); +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_18); - /* "root_numpy/src/tree.pyx":405 - * this.branch.SetStatus(1) - * - * __del__(self): # does this do what I want? # <<<<<<<<<<<<<< - * free(this.value) - * - */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_19); -#line 405 "root_numpy/src/tree.pyx" +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_20); +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_21); -#line 405 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGOTREF(__pyx_t_22); -#line 405 "root_numpy/src/tree.pyx" - __pyx_r = Py_None; __Pyx_INCREF(Py_None); +#line 359 "root_numpy/src/tree.pyx" + __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename; -#line 405 "root_numpy/src/tree.pyx" - __Pyx_XGIVEREF(__pyx_r); +#line 359 "root_numpy/src/tree.pyx" + { -#line 405 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 359 "root_numpy/src/tree.pyx" + delete __pyx_v_ttree; -#line 405 "root_numpy/src/tree.pyx" - return __pyx_r; +#line 359 "root_numpy/src/tree.pyx" + } -#line 405 "root_numpy/src/tree.pyx" -} +#line 359 "root_numpy/src/tree.pyx" + if (PY_MAJOR_VERSION >= 3) { -/* "root_numpy/src/tree.pyx":408 - * free(this.value) - * - * void fill_from(void* source): # <<<<<<<<<<<<<< - * memcpy(this.value, source, this.nbytes) - * this.branch.Fill() - */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_20); -#line 408 "root_numpy/src/tree.pyx" +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_21); +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_22); -#line 408 "root_numpy/src/tree.pyx" -void __pyx_t_13_librootnumpy_ScalarNP2CConverter::fill_from(void *__pyx_v_source) { - __Pyx_RefNannyDeclarations +#line 359 "root_numpy/src/tree.pyx" + __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); -#line 408 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("fill_from", 0); +#line 359 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":409 - * - * void fill_from(void* source): - * memcpy(this.value, source, this.nbytes) # <<<<<<<<<<<<<< - * this.branch.Fill() - * - */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_17); -#line 409 "root_numpy/src/tree.pyx" - memcpy(this->value, __pyx_v_source, this->nbytes); +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_18); - /* "root_numpy/src/tree.pyx":410 - * void fill_from(void* source): - * memcpy(this.value, source, this.nbytes) - * this.branch.Fill() # <<<<<<<<<<<<<< - * - * - */ +#line 359 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_t_19); -#line 410 "root_numpy/src/tree.pyx" - this->branch->Fill(); +#line 359 "root_numpy/src/tree.pyx" + __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19); - /* "root_numpy/src/tree.pyx":408 - * free(this.value) - * - * void fill_from(void* source): # <<<<<<<<<<<<<< - * memcpy(this.value, source, this.nbytes) - * this.branch.Fill() - */ +#line 359 "root_numpy/src/tree.pyx" + __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; -#line 408 "root_numpy/src/tree.pyx" +#line 359 "root_numpy/src/tree.pyx" + __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16; +#line 359 "root_numpy/src/tree.pyx" + goto __pyx_L1_error; -#line 408 "root_numpy/src/tree.pyx" - /* function exit code */ +#line 359 "root_numpy/src/tree.pyx" + } -#line 408 "root_numpy/src/tree.pyx" - __Pyx_RefNannyFinishContext(); +#line 359 "root_numpy/src/tree.pyx" + __pyx_L5:; -#line 408 "root_numpy/src/tree.pyx" -} +#line 359 "root_numpy/src/tree.pyx" + } -/* "root_numpy/src/tree.pyx":413 + /* "root_numpy/src/tree.pyx":360 + * finally: + * del ttree + * return ret # <<<<<<<<<<<<<< * * - * cdef NP2CConverter* find_np2c_converter(TTree* tree, name, dtype): # <<<<<<<<<<<<<< - * # TODO: - * # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. */ -#line 413 "root_numpy/src/tree.pyx" - +#line 360 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 413 "root_numpy/src/tree.pyx" -static __pyx_t_13_librootnumpy_NP2CConverter *__pyx_f_13_librootnumpy_find_np2c_converter(TTree *__pyx_v_tree, PyObject *__pyx_v_name, PyObject *__pyx_v_dtype) { - PyObject *__pyx_v_nbytes = NULL -#line 413 "root_numpy/src/tree.pyx" -; - PyObject *__pyx_v_roottype = NULL -#line 413 "root_numpy/src/tree.pyx" -; +#line 360 "root_numpy/src/tree.pyx" + __Pyx_INCREF(__pyx_v_ret); -#line 413 "root_numpy/src/tree.pyx" - __pyx_t_13_librootnumpy_NP2CConverter *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *(*__pyx_t_7)(PyObject *); - std::string __pyx_t_8; - std::string __pyx_t_9; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; +#line 360 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_v_ret; -#line 413 "root_numpy/src/tree.pyx" - __Pyx_RefNannySetupContext("find_np2c_converter", 0); +#line 360 "root_numpy/src/tree.pyx" + goto __pyx_L0; - /* "root_numpy/src/tree.pyx":417 - * # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. - * # Handle np.object (array) columns - * if dtype in TYPES_NUMPY2ROOT: # <<<<<<<<<<<<<< - * nbytes, roottype = TYPES_NUMPY2ROOT[dtype] - * return new ScalarNP2CConverter(tree, name, roottype, nbytes) + /* "root_numpy/src/tree.pyx":344 + * + * + * def root2array_fromFname(fnames, string treename, branches, # <<<<<<<<<<<<<< + * selection, start, stop, step, + * bool include_weight, string weight_name): */ -#line 417 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES_NUMPY2ROOT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 417 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); - -#line 417 "root_numpy/src/tree.pyx" - __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_dtype, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 417 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 344 "root_numpy/src/tree.pyx" -#line 417 "root_numpy/src/tree.pyx" - __pyx_t_3 = (__pyx_t_2 != 0); -#line 417 "root_numpy/src/tree.pyx" - if (__pyx_t_3) { +#line 344 "root_numpy/src/tree.pyx" + /* function exit code */ - /* "root_numpy/src/tree.pyx":418 - * # Handle np.object (array) columns - * if dtype in TYPES_NUMPY2ROOT: - * nbytes, roottype = TYPES_NUMPY2ROOT[dtype] # <<<<<<<<<<<<<< - * return new ScalarNP2CConverter(tree, name, roottype, nbytes) - * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) - */ +#line 344 "root_numpy/src/tree.pyx" + __pyx_L1_error:; -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES_NUMPY2ROOT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_1); -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_4); -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_v_dtype); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_7); -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_8); -#line 418 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_9); -#line 418 "root_numpy/src/tree.pyx" - if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) { +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_t_11); -#line 418 "root_numpy/src/tree.pyx" - PyObject* sequence = __pyx_t_4; +#line 344 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.root2array_fromFname", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 418 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON +#line 344 "root_numpy/src/tree.pyx" + __pyx_r = NULL; -#line 418 "root_numpy/src/tree.pyx" - Py_ssize_t size = Py_SIZE(sequence); +#line 344 "root_numpy/src/tree.pyx" + __pyx_L0:; -#line 418 "root_numpy/src/tree.pyx" - #else +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_fn); -#line 418 "root_numpy/src/tree.pyx" - Py_ssize_t size = PySequence_Size(sequence); +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_v_ret); -#line 418 "root_numpy/src/tree.pyx" - #endif +#line 344 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 418 "root_numpy/src/tree.pyx" - if (unlikely(size != 2)) { +#line 344 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 418 "root_numpy/src/tree.pyx" - if (size > 2) __Pyx_RaiseTooManyValuesError(2); +#line 344 "root_numpy/src/tree.pyx" + return __pyx_r; -#line 418 "root_numpy/src/tree.pyx" - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); +#line 344 "root_numpy/src/tree.pyx" +} -#line 418 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +/* "root_numpy/src/tree.pyx":363 + * + * + * def root2array_fromCObj(tree, branches, selection, # <<<<<<<<<<<<<< + * start, stop, step, + * bool include_weight, string weight_name): + */ -#line 418 "root_numpy/src/tree.pyx" - } +#line 363 "root_numpy/src/tree.pyx" -#line 418 "root_numpy/src/tree.pyx" - #if CYTHON_COMPILING_IN_CPYTHON -#line 418 "root_numpy/src/tree.pyx" - if (likely(PyTuple_CheckExact(sequence))) { +#line 363 "root_numpy/src/tree.pyx" +/* Python wrapper */ -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); +#line 363 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_11root2array_fromCObj(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_13_librootnumpy_11root2array_fromCObj = +#line 363 "root_numpy/src/tree.pyx" +{"root2array_fromCObj", (PyCFunction)__pyx_pw_13_librootnumpy_11root2array_fromCObj, METH_VARARGS|METH_KEYWORDS, 0}; -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); +#line 363 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pw_13_librootnumpy_11root2array_fromCObj(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_tree = 0 +#line 363 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_branches = 0 +#line 363 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_selection = 0 +#line 363 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_start = 0 +#line 363 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_stop = 0 +#line 363 "root_numpy/src/tree.pyx" +; + PyObject *__pyx_v_step = 0 +#line 363 "root_numpy/src/tree.pyx" +; + bool __pyx_v_include_weight +#line 363 "root_numpy/src/tree.pyx" +; + std::string __pyx_v_weight_name +#line 363 "root_numpy/src/tree.pyx" +; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 418 "root_numpy/src/tree.pyx" - } else { +#line 363 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = 0; -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); +#line 363 "root_numpy/src/tree.pyx" + __Pyx_RefNannyDeclarations -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyList_GET_ITEM(sequence, 1); +#line 363 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("root2array_fromCObj (wrapper)", 0); -#line 418 "root_numpy/src/tree.pyx" - } +#line 363 "root_numpy/src/tree.pyx" + { -#line 418 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_1); +#line 363 "root_numpy/src/tree.pyx" + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_tree,&__pyx_n_s_branches,&__pyx_n_s_selection,&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,&__pyx_n_s_include_weight,&__pyx_n_s_weight_name,0}; -#line 418 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_5); +#line 363 "root_numpy/src/tree.pyx" + PyObject* values[8] = {0,0,0,0,0,0,0,0}; -#line 418 "root_numpy/src/tree.pyx" - #else +#line 363 "root_numpy/src/tree.pyx" + if (unlikely(__pyx_kwds)) { -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + Py_ssize_t kw_args; -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 363 "root_numpy/src/tree.pyx" + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + switch (pos_args) { + case 8: +#line 363 "root_numpy/src/tree.pyx" +values[7] = PyTuple_GET_ITEM(__pyx_args, 7); + case 7: +#line 363 "root_numpy/src/tree.pyx" +values[6] = PyTuple_GET_ITEM(__pyx_args, 6); + case 6: +#line 363 "root_numpy/src/tree.pyx" +values[5] = PyTuple_GET_ITEM(__pyx_args, 5); + case 5: +#line 363 "root_numpy/src/tree.pyx" +values[4] = PyTuple_GET_ITEM(__pyx_args, 4); + case 4: +#line 363 "root_numpy/src/tree.pyx" +values[3] = PyTuple_GET_ITEM(__pyx_args, 3); + case 3: +#line 363 "root_numpy/src/tree.pyx" +values[2] = PyTuple_GET_ITEM(__pyx_args, 2); + case 2: +#line 363 "root_numpy/src/tree.pyx" +values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: +#line 363 "root_numpy/src/tree.pyx" +values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 363 "root_numpy/src/tree.pyx" + case 0: break; + default: +#line 363 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; -#line 418 "root_numpy/src/tree.pyx" - #endif +#line 363 "root_numpy/src/tree.pyx" + } -#line 418 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 363 "root_numpy/src/tree.pyx" + kw_args = PyDict_Size(__pyx_kwds); -#line 418 "root_numpy/src/tree.pyx" - } else { +#line 363 "root_numpy/src/tree.pyx" + switch (pos_args) { -#line 418 "root_numpy/src/tree.pyx" - Py_ssize_t index = -1; +#line 363 "root_numpy/src/tree.pyx" + case 0: -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree)) != 0)) kw_args--; + else +#line 363 "root_numpy/src/tree.pyx" +goto __pyx_L5_argtuple_error; -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 363 "root_numpy/src/tree.pyx" + case 1: -#line 418 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_branches)) != 0)) kw_args--; -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) -#line 418 "root_numpy/src/tree.pyx" -goto __pyx_L4_unpacking_failed; +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 1); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) -#line 418 "root_numpy/src/tree.pyx" -goto __pyx_L4_unpacking_failed; +#line 363 "root_numpy/src/tree.pyx" + } -#line 418 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 363 "root_numpy/src/tree.pyx" + case 2: -#line 418 "root_numpy/src/tree.pyx" - if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_selection)) != 0)) kw_args--; -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_7 = NULL; +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 2); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 418 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 363 "root_numpy/src/tree.pyx" + } -#line 418 "root_numpy/src/tree.pyx" - goto __pyx_L5_unpacking_done; +#line 363 "root_numpy/src/tree.pyx" + case 3: -#line 418 "root_numpy/src/tree.pyx" - __pyx_L4_unpacking_failed:; +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--; -#line 418 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 3); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_7 = NULL; +#line 363 "root_numpy/src/tree.pyx" + } -#line 418 "root_numpy/src/tree.pyx" - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); +#line 363 "root_numpy/src/tree.pyx" + case 4: -#line 418 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--; -#line 418 "root_numpy/src/tree.pyx" - __pyx_L5_unpacking_done:; +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 4); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 418 "root_numpy/src/tree.pyx" - } +#line 363 "root_numpy/src/tree.pyx" + } -#line 418 "root_numpy/src/tree.pyx" - __pyx_v_nbytes = __pyx_t_1; +#line 363 "root_numpy/src/tree.pyx" + case 5: -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_1 = 0; +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--; -#line 418 "root_numpy/src/tree.pyx" - __pyx_v_roottype = __pyx_t_5; +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 5); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 418 "root_numpy/src/tree.pyx" - __pyx_t_5 = 0; +#line 363 "root_numpy/src/tree.pyx" + } - /* "root_numpy/src/tree.pyx":419 - * if dtype in TYPES_NUMPY2ROOT: - * nbytes, roottype = TYPES_NUMPY2ROOT[dtype] - * return new ScalarNP2CConverter(tree, name, roottype, nbytes) # <<<<<<<<<<<<<< - * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) - * return NULL - */ +#line 363 "root_numpy/src/tree.pyx" + case 6: -#line 419 "root_numpy/src/tree.pyx" - __pyx_t_8 = __pyx_convert_string_from_py_std__string(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_include_weight)) != 0)) kw_args--; -#line 419 "root_numpy/src/tree.pyx" - __pyx_t_9 = __pyx_convert_string_from_py_std__string(__pyx_v_roottype); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 6); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 419 "root_numpy/src/tree.pyx" - __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_nbytes); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + } -#line 419 "root_numpy/src/tree.pyx" - __pyx_r = new __pyx_t_13_librootnumpy_ScalarNP2CConverter(__pyx_v_tree, __pyx_t_8, __pyx_t_9, __pyx_t_10); +#line 363 "root_numpy/src/tree.pyx" + case 7: -#line 419 "root_numpy/src/tree.pyx" - goto __pyx_L0; +#line 363 "root_numpy/src/tree.pyx" + if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight_name)) != 0)) kw_args--; -#line 419 "root_numpy/src/tree.pyx" - } +#line 363 "root_numpy/src/tree.pyx" + else { + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, 7); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - /* "root_numpy/src/tree.pyx":420 - * nbytes, roottype = TYPES_NUMPY2ROOT[dtype] - * return new ScalarNP2CConverter(tree, name, roottype, nbytes) - * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) # <<<<<<<<<<<<<< - * return NULL - * - */ +#line 363 "root_numpy/src/tree.pyx" + } -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + } -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 363 "root_numpy/src/tree.pyx" + if (unlikely(kw_args > 0)) { -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "root2array_fromCObj") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_1); +#line 363 "root_numpy/src/tree.pyx" + } -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +#line 363 "root_numpy/src/tree.pyx" + } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_converter_for_r_is_not_implement, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + goto __pyx_L5_argtuple_error; -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_6); +#line 363 "root_numpy/src/tree.pyx" + } else { -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_11 = NULL; +#line 363 "root_numpy/src/tree.pyx" + values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 420 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) { +#line 363 "root_numpy/src/tree.pyx" + values[1] = PyTuple_GET_ITEM(__pyx_args, 1); -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6); +#line 363 "root_numpy/src/tree.pyx" + values[2] = PyTuple_GET_ITEM(__pyx_args, 2); -#line 420 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_11)) { +#line 363 "root_numpy/src/tree.pyx" + values[3] = PyTuple_GET_ITEM(__pyx_args, 3); -#line 420 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); +#line 363 "root_numpy/src/tree.pyx" + values[4] = PyTuple_GET_ITEM(__pyx_args, 4); -#line 420 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_11); +#line 363 "root_numpy/src/tree.pyx" + values[5] = PyTuple_GET_ITEM(__pyx_args, 5); -#line 420 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 363 "root_numpy/src/tree.pyx" + values[6] = PyTuple_GET_ITEM(__pyx_args, 6); -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_6, function); +#line 363 "root_numpy/src/tree.pyx" + values[7] = PyTuple_GET_ITEM(__pyx_args, 7); -#line 420 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" } -#line 420 "root_numpy/src/tree.pyx" - } - -#line 420 "root_numpy/src/tree.pyx" - if (!__pyx_t_11) { +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_tree = values[0]; -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_branches = values[1]; -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_selection = values[2]; -#line 420 "root_numpy/src/tree.pyx" - } else { +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_start = values[3]; -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_stop = values[4]; -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_12); +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_step = values[5]; -#line 420 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL; +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_include_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_include_weight == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_v_dtype); +#line 363 "root_numpy/src/tree.pyx" + __pyx_v_weight_name = __pyx_convert_string_from_py_std__string(values[7]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 420 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_dtype); +#line 363 "root_numpy/src/tree.pyx" + } -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_v_dtype); +#line 363 "root_numpy/src/tree.pyx" + goto __pyx_L4_argument_unpacking_done; -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("root2array_fromCObj", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); +#line 363 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_5); +#line 363 "root_numpy/src/tree.pyx" + __pyx_L3_error:; -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; +#line 363 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.root2array_fromCObj", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 420 "root_numpy/src/tree.pyx" - } +#line 363 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +#line 363 "root_numpy/src/tree.pyx" + return NULL; -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_6 = NULL; +#line 363 "root_numpy/src/tree.pyx" + __pyx_L4_argument_unpacking_done:; + __pyx_r = +#line 363 "root_numpy/src/tree.pyx" +__pyx_pf_13_librootnumpy_10root2array_fromCObj(__pyx_self, __pyx_v_tree, __pyx_v_branches, __pyx_v_selection, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); -#line 420 "root_numpy/src/tree.pyx" - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) { +#line 363 "root_numpy/src/tree.pyx" -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); -#line 420 "root_numpy/src/tree.pyx" - if (likely(__pyx_t_6)) { +#line 363 "root_numpy/src/tree.pyx" + /* function exit code */ -#line 420 "root_numpy/src/tree.pyx" - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); +#line 363 "root_numpy/src/tree.pyx" + __Pyx_RefNannyFinishContext(); -#line 420 "root_numpy/src/tree.pyx" - __Pyx_INCREF(__pyx_t_6); +#line 363 "root_numpy/src/tree.pyx" + return __pyx_r; -#line 420 "root_numpy/src/tree.pyx" - __Pyx_INCREF(function); +#line 363 "root_numpy/src/tree.pyx" +} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF_SET(__pyx_t_1, function); +#line 363 "root_numpy/src/tree.pyx" -#line 420 "root_numpy/src/tree.pyx" - } -#line 420 "root_numpy/src/tree.pyx" - } +#line 363 "root_numpy/src/tree.pyx" +static PyObject *__pyx_pf_13_librootnumpy_10root2array_fromCObj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tree, PyObject *__pyx_v_branches, PyObject *__pyx_v_selection, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, bool __pyx_v_include_weight, std::string __pyx_v_weight_name) { + TTree *__pyx_v_chain +#line 363 "root_numpy/src/tree.pyx" +; -#line 420 "root_numpy/src/tree.pyx" - if (!__pyx_t_6) { +#line 363 "root_numpy/src/tree.pyx" + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + void *__pyx_t_1; + std::string __pyx_t_2; + int __pyx_t_3; + std::string __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __Pyx_RefNannySetupContext("root2array_fromCObj", 0); -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + /* "root_numpy/src/tree.pyx":366 + * start, stop, step, + * bool include_weight, string weight_name): + * cdef TTree* chain = PyCObject_AsVoidPtr(tree) # <<<<<<<<<<<<<< + * return tree2array( + * chain, branches, + */ -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 366 "root_numpy/src/tree.pyx" + __pyx_t_1 = PyCObject_AsVoidPtr(__pyx_v_tree); if (unlikely(__pyx_t_1 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 420 "root_numpy/src/tree.pyx" - } else { +#line 366 "root_numpy/src/tree.pyx" + __pyx_v_chain = ((TTree *)__pyx_t_1); -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "root_numpy/src/tree.pyx":367 + * bool include_weight, string weight_name): + * cdef TTree* chain = PyCObject_AsVoidPtr(tree) + * return tree2array( # <<<<<<<<<<<<<< + * chain, branches, + * selection or '', start, stop, step, + */ -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_12); +#line 367 "root_numpy/src/tree.pyx" + __Pyx_XDECREF(__pyx_r); -#line 420 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL; + /* "root_numpy/src/tree.pyx":369 + * return tree2array( + * chain, branches, + * selection or '', start, stop, step, # <<<<<<<<<<<<<< + * include_weight, weight_name) + * + */ -#line 420 "root_numpy/src/tree.pyx" - PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5); +#line 369 "root_numpy/src/tree.pyx" + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_selection); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_t_5); +#line 369 "root_numpy/src/tree.pyx" + if (!__pyx_t_3) { -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_5 = 0; +#line 369 "root_numpy/src/tree.pyx" + } else { -#line 420 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 369 "root_numpy/src/tree.pyx" + __pyx_t_4 = __pyx_convert_string_from_py_std__string(__pyx_v_selection); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_t_4); +#line 369 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_t_4; -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; +#line 369 "root_numpy/src/tree.pyx" + goto __pyx_L3_bool_binop_done; -#line 420 "root_numpy/src/tree.pyx" +#line 369 "root_numpy/src/tree.pyx" } -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +#line 369 "root_numpy/src/tree.pyx" + __pyx_t_4 = __pyx_convert_string_from_py_std__string(__pyx_kp_s__26); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 420 "root_numpy/src/tree.pyx" - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +#line 369 "root_numpy/src/tree.pyx" + __pyx_t_2 = __pyx_t_4; - /* "root_numpy/src/tree.pyx":421 - * return new ScalarNP2CConverter(tree, name, roottype, nbytes) - * warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) - * return NULL # <<<<<<<<<<<<<< - * - * +#line 369 "root_numpy/src/tree.pyx" + __pyx_L3_bool_binop_done:; + + /* "root_numpy/src/tree.pyx":367 + * bool include_weight, string weight_name): + * cdef TTree* chain = PyCObject_AsVoidPtr(tree) + * return tree2array( # <<<<<<<<<<<<<< + * chain, branches, + * selection or '', start, stop, step, */ -#line 421 "root_numpy/src/tree.pyx" - __pyx_r = NULL; +#line 367 "root_numpy/src/tree.pyx" + __pyx_t_5 = __pyx_f_13_librootnumpy_tree2array(__pyx_v_chain, __pyx_v_branches, __pyx_t_2, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_include_weight, __pyx_v_weight_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 421 "root_numpy/src/tree.pyx" +#line 367 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_t_5); + +#line 367 "root_numpy/src/tree.pyx" + __pyx_r = __pyx_t_5; + +#line 367 "root_numpy/src/tree.pyx" + __pyx_t_5 = 0; + +#line 367 "root_numpy/src/tree.pyx" goto __pyx_L0; - /* "root_numpy/src/tree.pyx":413 + /* "root_numpy/src/tree.pyx":363 * * - * cdef NP2CConverter* find_np2c_converter(TTree* tree, name, dtype): # <<<<<<<<<<<<<< - * # TODO: - * # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. + * def root2array_fromCObj(tree, branches, selection, # <<<<<<<<<<<<<< + * start, stop, step, + * bool include_weight, string weight_name): */ -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" /* function exit code */ -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __pyx_L1_error:; -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_1); - -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_4); - -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_5); -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_6); - -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_11); - -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_t_12); - -#line 413 "root_numpy/src/tree.pyx" - __Pyx_WriteUnraisable("_librootnumpy.find_np2c_converter", __pyx_clineno, __pyx_lineno, __pyx_filename, 0); +#line 363 "root_numpy/src/tree.pyx" + __Pyx_AddTraceback("_librootnumpy.root2array_fromCObj", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 413 "root_numpy/src/tree.pyx" - __pyx_r = 0; +#line 363 "root_numpy/src/tree.pyx" + __pyx_r = NULL; -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __pyx_L0:; -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_nbytes); - -#line 413 "root_numpy/src/tree.pyx" - __Pyx_XDECREF(__pyx_v_roottype); +#line 363 "root_numpy/src/tree.pyx" + __Pyx_XGIVEREF(__pyx_r); -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" return __pyx_r; -#line 413 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" } -/* "root_numpy/src/tree.pyx":424 +/* "root_numpy/src/tree.pyx":373 * * * cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) except *: # <<<<<<<<<<<<<< - * cdef vector[NP2CConverter*] converters + * cdef vector[NP2ROOTConverter*] converters * cdef vector[int] posarray */ -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, struct __pyx_opt_args_13_librootnumpy_array2tree *__pyx_optional_args) { -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" std::string __pyx_v_name = __pyx_k__27; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" TTree *__pyx_v_tree = ((TTree *)NULL); - std::vector<__pyx_t_13_librootnumpy_NP2CConverter *> __pyx_v_converters -#line 424 "root_numpy/src/tree.pyx" + std::vector<__pyx_t_13_librootnumpy_NP2ROOTConverter *> __pyx_v_converters +#line 373 "root_numpy/src/tree.pyx" ; std::vector __pyx_v_posarray -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; std::vector __pyx_v_roffsetarray -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; unsigned int __pyx_v_icv -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; int __pyx_v_icol -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; long __pyx_v_arr_len -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; long __pyx_v_idata -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; unsigned long __pyx_v_pos_len -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; unsigned long __pyx_v_ipos -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; void *__pyx_v_source -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; void *__pyx_v_thisrow -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_fieldnames = NULL -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_fields = NULL -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_fieldname = NULL -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_dtype = NULL -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_roffset = NULL -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" ; - __pyx_t_13_librootnumpy_NP2CConverter *__pyx_v_cvt -#line 424 "root_numpy/src/tree.pyx" + __pyx_t_13_librootnumpy_NP2ROOTConverter *__pyx_v_cvt +#line 373 "root_numpy/src/tree.pyx" ; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" TTree *__pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -18965,34 +20943,34 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_RefNannySetupContext("array2tree", 0); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" if (__pyx_optional_args) { -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" if (__pyx_optional_args->__pyx_n > 0) { -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __pyx_v_name = __pyx_optional_args->name; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" if (__pyx_optional_args->__pyx_n > 1) { -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __pyx_v_tree = __pyx_optional_args->tree; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" } -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" } -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":430 + /* "root_numpy/src/tree.pyx":379 * cdef unsigned int icv * cdef int icol * cdef long arr_len = arr.shape[0] # <<<<<<<<<<<<<< @@ -19000,10 +20978,10 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * cdef unsigned long pos_len */ -#line 430 "root_numpy/src/tree.pyx" +#line 379 "root_numpy/src/tree.pyx" __pyx_v_arr_len = (__pyx_v_arr->dimensions[0]); - /* "root_numpy/src/tree.pyx":434 + /* "root_numpy/src/tree.pyx":383 * cdef unsigned long pos_len * cdef unsigned long ipos * cdef void* source = NULL # <<<<<<<<<<<<<< @@ -19011,10 +20989,10 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * */ -#line 434 "root_numpy/src/tree.pyx" +#line 383 "root_numpy/src/tree.pyx" __pyx_v_source = NULL; - /* "root_numpy/src/tree.pyx":435 + /* "root_numpy/src/tree.pyx":384 * cdef unsigned long ipos * cdef void* source = NULL * cdef void* thisrow = NULL # <<<<<<<<<<<<<< @@ -19022,10 +21000,10 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * try: */ -#line 435 "root_numpy/src/tree.pyx" +#line 384 "root_numpy/src/tree.pyx" __pyx_v_thisrow = NULL; - /* "root_numpy/src/tree.pyx":437 + /* "root_numpy/src/tree.pyx":386 * cdef void* thisrow = NULL * * try: # <<<<<<<<<<<<<< @@ -19033,20 +21011,20 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * tree = new TTree(name.c_str(), name.c_str()) */ -#line 437 "root_numpy/src/tree.pyx" +#line 386 "root_numpy/src/tree.pyx" /*try:*/ { -#line 437 "root_numpy/src/tree.pyx" +#line 386 "root_numpy/src/tree.pyx" { __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_3); -#line 437 "root_numpy/src/tree.pyx" +#line 386 "root_numpy/src/tree.pyx" /*try:*/ { - /* "root_numpy/src/tree.pyx":438 + /* "root_numpy/src/tree.pyx":387 * * try: * if tree == NULL: # <<<<<<<<<<<<<< @@ -19054,13 +21032,13 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * */ -#line 438 "root_numpy/src/tree.pyx" +#line 387 "root_numpy/src/tree.pyx" __pyx_t_4 = ((__pyx_v_tree == NULL) != 0); -#line 438 "root_numpy/src/tree.pyx" +#line 387 "root_numpy/src/tree.pyx" if (__pyx_t_4) { - /* "root_numpy/src/tree.pyx":439 + /* "root_numpy/src/tree.pyx":388 * try: * if tree == NULL: * tree = new TTree(name.c_str(), name.c_str()) # <<<<<<<<<<<<<< @@ -19068,19 +21046,19 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * fieldnames = arr.dtype.names */ -#line 439 "root_numpy/src/tree.pyx" +#line 388 "root_numpy/src/tree.pyx" __pyx_v_tree = new TTree(__pyx_v_name.c_str(), __pyx_v_name.c_str()); -#line 439 "root_numpy/src/tree.pyx" +#line 388 "root_numpy/src/tree.pyx" goto __pyx_L14; -#line 439 "root_numpy/src/tree.pyx" +#line 388 "root_numpy/src/tree.pyx" } -#line 439 "root_numpy/src/tree.pyx" +#line 388 "root_numpy/src/tree.pyx" __pyx_L14:; - /* "root_numpy/src/tree.pyx":441 + /* "root_numpy/src/tree.pyx":390 * tree = new TTree(name.c_str(), name.c_str()) * * fieldnames = arr.dtype.names # <<<<<<<<<<<<<< @@ -19088,309 +21066,309 @@ static TTree *__pyx_f_13_librootnumpy_array2tree(PyArrayObject *__pyx_v_arr, str * */ -#line 441 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 390 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 441 "root_numpy/src/tree.pyx" +#line 390 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 441 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_names); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 390 "root_numpy/src/tree.pyx" + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_names); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 441 "root_numpy/src/tree.pyx" +#line 390 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_6); -#line 441 "root_numpy/src/tree.pyx" +#line 390 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 441 "root_numpy/src/tree.pyx" +#line 390 "root_numpy/src/tree.pyx" __pyx_v_fieldnames = __pyx_t_6; -#line 441 "root_numpy/src/tree.pyx" +#line 390 "root_numpy/src/tree.pyx" __pyx_t_6 = 0; - /* "root_numpy/src/tree.pyx":442 + /* "root_numpy/src/tree.pyx":391 * * fieldnames = arr.dtype.names * fields = arr.dtype.fields # <<<<<<<<<<<<<< * - * # determine the structure + * # Determine the structure */ -#line 442 "root_numpy/src/tree.pyx" - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 391 "root_numpy/src/tree.pyx" + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_arr), __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 442 "root_numpy/src/tree.pyx" +#line 391 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_6); -#line 442 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 391 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fields); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 442 "root_numpy/src/tree.pyx" +#line 391 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 442 "root_numpy/src/tree.pyx" +#line 391 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 442 "root_numpy/src/tree.pyx" +#line 391 "root_numpy/src/tree.pyx" __pyx_v_fields = __pyx_t_5; -#line 442 "root_numpy/src/tree.pyx" +#line 391 "root_numpy/src/tree.pyx" __pyx_t_5 = 0; - /* "root_numpy/src/tree.pyx":445 + /* "root_numpy/src/tree.pyx":394 * - * # determine the structure + * # Determine the structure * for icol in range(len(fieldnames)): # <<<<<<<<<<<<<< * fieldname = fieldnames[icol] * # roffset is an offset of particular field in each record */ -#line 445 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 394 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 445 "root_numpy/src/tree.pyx" +#line 394 "root_numpy/src/tree.pyx" for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { -#line 445 "root_numpy/src/tree.pyx" +#line 394 "root_numpy/src/tree.pyx" __pyx_v_icol = __pyx_t_8; - /* "root_numpy/src/tree.pyx":446 - * # determine the structure + /* "root_numpy/src/tree.pyx":395 + * # Determine the structure * for icol in range(len(fieldnames)): * fieldname = fieldnames[icol] # <<<<<<<<<<<<<< * # roffset is an offset of particular field in each record * dtype, roffset = fields[fieldname] */ -#line 446 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_icol, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; +#line 395 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_icol, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; -#line 446 "root_numpy/src/tree.pyx" +#line 395 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 446 "root_numpy/src/tree.pyx" +#line 395 "root_numpy/src/tree.pyx" __Pyx_XDECREF_SET(__pyx_v_fieldname, __pyx_t_5); -#line 446 "root_numpy/src/tree.pyx" +#line 395 "root_numpy/src/tree.pyx" __pyx_t_5 = 0; - /* "root_numpy/src/tree.pyx":448 + /* "root_numpy/src/tree.pyx":397 * fieldname = fieldnames[icol] * # roffset is an offset of particular field in each record * dtype, roffset = fields[fieldname] # <<<<<<<<<<<<<< - * cvt = find_np2c_converter(tree, fieldname, dtype) + * cvt = find_np2root_converter(tree, fieldname, dtype) * if cvt != NULL: */ -#line 448 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyObject_GetItem(__pyx_v_fields, __pyx_v_fieldname); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; +#line 397 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyObject_GetItem(__pyx_v_fields, __pyx_v_fieldname); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;}; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" PyObject* sequence = __pyx_t_5; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" Py_ssize_t size = Py_SIZE(sequence); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" #else -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" Py_ssize_t size = PySequence_Size(sequence); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" #endif -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" if (unlikely(size != 2)) { -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" if (size > 2) __Pyx_RaiseTooManyValuesError(2); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); -#line 448 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 397 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" } -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" if (likely(PyTuple_CheckExact(sequence))) { -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" } else { -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_6 = PyList_GET_ITEM(sequence, 0); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_9 = PyList_GET_ITEM(sequence, 1); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" } -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_INCREF(__pyx_t_6); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_INCREF(__pyx_t_9); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" #else -#line 448 "root_numpy/src/tree.pyx" - __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 397 "root_numpy/src/tree.pyx" + __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_6); -#line 448 "root_numpy/src/tree.pyx" - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 397 "root_numpy/src/tree.pyx" + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_9); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" #endif -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" } else { -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" Py_ssize_t index = -1; -#line 448 "root_numpy/src/tree.pyx" - __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 397 "root_numpy/src/tree.pyx" + __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_10); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext; index = 0; __pyx_t_6 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_6)) -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" goto __pyx_L17_unpacking_failed; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_6); index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" goto __pyx_L17_unpacking_failed; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_9); -#line 448 "root_numpy/src/tree.pyx" - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 397 "root_numpy/src/tree.pyx" + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_11 = NULL; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" goto __pyx_L18_unpacking_done; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_L17_unpacking_failed:; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_11 = NULL; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); -#line 448 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 397 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_L18_unpacking_done:; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" } -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_6); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_6 = 0; -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __Pyx_XDECREF_SET(__pyx_v_roffset, __pyx_t_9); -#line 448 "root_numpy/src/tree.pyx" +#line 397 "root_numpy/src/tree.pyx" __pyx_t_9 = 0; - /* "root_numpy/src/tree.pyx":449 + /* "root_numpy/src/tree.pyx":398 * # roffset is an offset of particular field in each record * dtype, roffset = fields[fieldname] - * cvt = find_np2c_converter(tree, fieldname, dtype) # <<<<<<<<<<<<<< + * cvt = find_np2root_converter(tree, fieldname, dtype) # <<<<<<<<<<<<<< * if cvt != NULL: * roffsetarray.push_back(roffset) */ -#line 449 "root_numpy/src/tree.pyx" - __pyx_v_cvt = __pyx_f_13_librootnumpy_find_np2c_converter(__pyx_v_tree, __pyx_v_fieldname, __pyx_v_dtype); +#line 398 "root_numpy/src/tree.pyx" + __pyx_v_cvt = __pyx_f_13_librootnumpy_find_np2root_converter(__pyx_v_tree, __pyx_v_fieldname, __pyx_v_dtype); - /* "root_numpy/src/tree.pyx":450 + /* "root_numpy/src/tree.pyx":399 * dtype, roffset = fields[fieldname] - * cvt = find_np2c_converter(tree, fieldname, dtype) + * cvt = find_np2root_converter(tree, fieldname, dtype) * if cvt != NULL: # <<<<<<<<<<<<<< * roffsetarray.push_back(roffset) * converters.push_back(cvt) */ -#line 450 "root_numpy/src/tree.pyx" +#line 399 "root_numpy/src/tree.pyx" __pyx_t_4 = ((__pyx_v_cvt != NULL) != 0); -#line 450 "root_numpy/src/tree.pyx" +#line 399 "root_numpy/src/tree.pyx" if (__pyx_t_4) { - /* "root_numpy/src/tree.pyx":451 - * cvt = find_np2c_converter(tree, fieldname, dtype) + /* "root_numpy/src/tree.pyx":400 + * cvt = find_np2root_converter(tree, fieldname, dtype) * if cvt != NULL: * roffsetarray.push_back(roffset) # <<<<<<<<<<<<<< * converters.push_back(cvt) * posarray.push_back(icol) */ -#line 451 "root_numpy/src/tree.pyx" - __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_roffset); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 400 "root_numpy/src/tree.pyx" + __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_roffset); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 451 "root_numpy/src/tree.pyx" +#line 400 "root_numpy/src/tree.pyx" __pyx_v_roffsetarray.push_back(__pyx_t_12); - /* "root_numpy/src/tree.pyx":452 + /* "root_numpy/src/tree.pyx":401 * if cvt != NULL: * roffsetarray.push_back(roffset) * converters.push_back(cvt) # <<<<<<<<<<<<<< @@ -19398,61 +21376,61 @@ goto __pyx_L17_unpacking_failed; * */ -#line 452 "root_numpy/src/tree.pyx" +#line 401 "root_numpy/src/tree.pyx" __pyx_v_converters.push_back(__pyx_v_cvt); - /* "root_numpy/src/tree.pyx":453 + /* "root_numpy/src/tree.pyx":402 * roffsetarray.push_back(roffset) * converters.push_back(cvt) * posarray.push_back(icol) # <<<<<<<<<<<<<< * - * # fill in data + * # Fill the data */ -#line 453 "root_numpy/src/tree.pyx" +#line 402 "root_numpy/src/tree.pyx" __pyx_v_posarray.push_back(__pyx_v_icol); -#line 453 "root_numpy/src/tree.pyx" +#line 402 "root_numpy/src/tree.pyx" goto __pyx_L19; -#line 453 "root_numpy/src/tree.pyx" +#line 402 "root_numpy/src/tree.pyx" } -#line 453 "root_numpy/src/tree.pyx" +#line 402 "root_numpy/src/tree.pyx" __pyx_L19:; -#line 453 "root_numpy/src/tree.pyx" +#line 402 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":456 + /* "root_numpy/src/tree.pyx":405 * - * # fill in data + * # Fill the data * pos_len = posarray.size() # <<<<<<<<<<<<<< * for idata in range(arr_len): * thisrow = np.PyArray_GETPTR1(arr, idata) */ -#line 456 "root_numpy/src/tree.pyx" +#line 405 "root_numpy/src/tree.pyx" __pyx_v_pos_len = __pyx_v_posarray.size(); - /* "root_numpy/src/tree.pyx":457 - * # fill in data + /* "root_numpy/src/tree.pyx":406 + * # Fill the data * pos_len = posarray.size() * for idata in range(arr_len): # <<<<<<<<<<<<<< * thisrow = np.PyArray_GETPTR1(arr, idata) * for ipos in range(pos_len): */ -#line 457 "root_numpy/src/tree.pyx" +#line 406 "root_numpy/src/tree.pyx" __pyx_t_13 = __pyx_v_arr_len; -#line 457 "root_numpy/src/tree.pyx" +#line 406 "root_numpy/src/tree.pyx" for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) { -#line 457 "root_numpy/src/tree.pyx" +#line 406 "root_numpy/src/tree.pyx" __pyx_v_idata = __pyx_t_14; - /* "root_numpy/src/tree.pyx":458 + /* "root_numpy/src/tree.pyx":407 * pos_len = posarray.size() * for idata in range(arr_len): * thisrow = np.PyArray_GETPTR1(arr, idata) # <<<<<<<<<<<<<< @@ -19460,10 +21438,10 @@ goto __pyx_L17_unpacking_failed; * roffset = roffsetarray[ipos] */ -#line 458 "root_numpy/src/tree.pyx" +#line 407 "root_numpy/src/tree.pyx" __pyx_v_thisrow = PyArray_GETPTR1(__pyx_v_arr, __pyx_v_idata); - /* "root_numpy/src/tree.pyx":459 + /* "root_numpy/src/tree.pyx":408 * for idata in range(arr_len): * thisrow = np.PyArray_GETPTR1(arr, idata) * for ipos in range(pos_len): # <<<<<<<<<<<<<< @@ -19471,16 +21449,16 @@ goto __pyx_L17_unpacking_failed; * source = shift(thisrow, roffset) */ -#line 459 "root_numpy/src/tree.pyx" +#line 408 "root_numpy/src/tree.pyx" __pyx_t_15 = __pyx_v_pos_len; -#line 459 "root_numpy/src/tree.pyx" +#line 408 "root_numpy/src/tree.pyx" for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { -#line 459 "root_numpy/src/tree.pyx" +#line 408 "root_numpy/src/tree.pyx" __pyx_v_ipos = __pyx_t_16; - /* "root_numpy/src/tree.pyx":460 + /* "root_numpy/src/tree.pyx":409 * thisrow = np.PyArray_GETPTR1(arr, idata) * for ipos in range(pos_len): * roffset = roffsetarray[ipos] # <<<<<<<<<<<<<< @@ -19488,19 +21466,19 @@ goto __pyx_L17_unpacking_failed; * converters[ipos].fill_from(source) */ -#line 460 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_roffsetarray[__pyx_v_ipos])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 409 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_roffsetarray[__pyx_v_ipos])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 460 "root_numpy/src/tree.pyx" +#line 409 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 460 "root_numpy/src/tree.pyx" +#line 409 "root_numpy/src/tree.pyx" __Pyx_XDECREF_SET(__pyx_v_roffset, __pyx_t_5); -#line 460 "root_numpy/src/tree.pyx" +#line 409 "root_numpy/src/tree.pyx" __pyx_t_5 = 0; - /* "root_numpy/src/tree.pyx":461 + /* "root_numpy/src/tree.pyx":410 * for ipos in range(pos_len): * roffset = roffsetarray[ipos] * source = shift(thisrow, roffset) # <<<<<<<<<<<<<< @@ -19508,71 +21486,71 @@ goto __pyx_L17_unpacking_failed; * */ -#line 461 "root_numpy/src/tree.pyx" - __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_roffset); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L6_error;} +#line 410 "root_numpy/src/tree.pyx" + __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_roffset); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L6_error;} -#line 461 "root_numpy/src/tree.pyx" +#line 410 "root_numpy/src/tree.pyx" __pyx_v_source = shift(__pyx_v_thisrow, __pyx_t_8); - /* "root_numpy/src/tree.pyx":462 + /* "root_numpy/src/tree.pyx":411 * roffset = roffsetarray[ipos] * source = shift(thisrow, roffset) * converters[ipos].fill_from(source) # <<<<<<<<<<<<<< * - * # need to update the number of entries in the tree to match + * # Need to update the number of entries in the tree to match */ -#line 462 "root_numpy/src/tree.pyx" +#line 411 "root_numpy/src/tree.pyx" (__pyx_v_converters[__pyx_v_ipos])->fill_from(__pyx_v_source); -#line 462 "root_numpy/src/tree.pyx" +#line 411 "root_numpy/src/tree.pyx" } -#line 462 "root_numpy/src/tree.pyx" +#line 411 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":466 - * # need to update the number of entries in the tree to match + /* "root_numpy/src/tree.pyx":415 + * # Need to update the number of entries in the tree to match * # the number in the branches since each branch is filled separately. * tree.SetEntries(-1) # <<<<<<<<<<<<<< * * except: */ -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __pyx_v_tree->SetEntries(-1); -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" } -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" goto __pyx_L13_try_end; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __pyx_L6_error:; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 466 "root_numpy/src/tree.pyx" +#line 415 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "root_numpy/src/tree.pyx":468 + /* "root_numpy/src/tree.pyx":417 * tree.SetEntries(-1) * * except: # <<<<<<<<<<<<<< @@ -19580,25 +21558,25 @@ goto __pyx_L17_unpacking_failed; * */ -#line 468 "root_numpy/src/tree.pyx" +#line 417 "root_numpy/src/tree.pyx" /*except:*/ { -#line 468 "root_numpy/src/tree.pyx" +#line 417 "root_numpy/src/tree.pyx" __Pyx_AddTraceback("_librootnumpy.array2tree", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 468 "root_numpy/src/tree.pyx" - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} +#line 417 "root_numpy/src/tree.pyx" + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} -#line 468 "root_numpy/src/tree.pyx" +#line 417 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 468 "root_numpy/src/tree.pyx" +#line 417 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_9); -#line 468 "root_numpy/src/tree.pyx" +#line 417 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_6); - /* "root_numpy/src/tree.pyx":469 + /* "root_numpy/src/tree.pyx":418 * * except: * raise # <<<<<<<<<<<<<< @@ -19606,55 +21584,55 @@ goto __pyx_L17_unpacking_failed; * finally: */ -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_t_5); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_t_9); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_6); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_ErrRestore(__pyx_t_5, __pyx_t_9, __pyx_t_6); __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_6 = 0; -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" -#line 469 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} +#line 418 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;} -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" } -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __pyx_L8_except_error:; -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_1); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_2); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_3); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" goto __pyx_L4_error; -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" __pyx_L13_try_end:; -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" } -#line 469 "root_numpy/src/tree.pyx" +#line 418 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":472 + /* "root_numpy/src/tree.pyx":421 * * finally: * for icv in range(converters.size()): # <<<<<<<<<<<<<< @@ -19662,22 +21640,22 @@ goto __pyx_L17_unpacking_failed; * # TODO: clean up tree */ -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" /*finally:*/ { -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" /*normal exit:*/{ -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" __pyx_t_17 = __pyx_v_converters.size(); -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" __pyx_v_icv = __pyx_t_18; - /* "root_numpy/src/tree.pyx":473 + /* "root_numpy/src/tree.pyx":422 * finally: * for icv in range(converters.size()): * del converters[icv] # <<<<<<<<<<<<<< @@ -19685,70 +21663,70 @@ goto __pyx_L17_unpacking_failed; * */ -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" delete (__pyx_v_converters[__pyx_v_icv]); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" goto __pyx_L5; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" /*exception exit:*/{ -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __pyx_L4_error:; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGOTREF(__pyx_t_3); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGOTREF(__pyx_t_2); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGOTREF(__pyx_t_1); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGOTREF(__pyx_t_20); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGOTREF(__pyx_t_21); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGOTREF(__pyx_t_22); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_19 = __pyx_filename; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" { - /* "root_numpy/src/tree.pyx":472 + /* "root_numpy/src/tree.pyx":421 * * finally: * for icv in range(converters.size()): # <<<<<<<<<<<<<< @@ -19756,16 +21734,16 @@ goto __pyx_L17_unpacking_failed; * # TODO: clean up tree */ -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" __pyx_t_17 = __pyx_v_converters.size(); -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) { -#line 472 "root_numpy/src/tree.pyx" +#line 421 "root_numpy/src/tree.pyx" __pyx_v_icv = __pyx_t_18; - /* "root_numpy/src/tree.pyx":473 + /* "root_numpy/src/tree.pyx":422 * finally: * for icv in range(converters.size()): * del converters[icv] # <<<<<<<<<<<<<< @@ -19773,64 +21751,64 @@ goto __pyx_L17_unpacking_failed; * */ -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" delete (__pyx_v_converters[__pyx_v_icv]); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" if (PY_MAJOR_VERSION >= 3) { -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_20); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_21); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_22); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_3); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_2); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_t_1); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1); -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_19; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" goto __pyx_L1_error; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" __pyx_L5:; -#line 473 "root_numpy/src/tree.pyx" +#line 422 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":476 + /* "root_numpy/src/tree.pyx":425 * # TODO: clean up tree * * return tree # <<<<<<<<<<<<<< @@ -19838,75 +21816,75 @@ goto __pyx_L17_unpacking_failed; * */ -#line 476 "root_numpy/src/tree.pyx" +#line 425 "root_numpy/src/tree.pyx" __pyx_r = __pyx_v_tree; -#line 476 "root_numpy/src/tree.pyx" +#line 425 "root_numpy/src/tree.pyx" goto __pyx_L0; - /* "root_numpy/src/tree.pyx":424 + /* "root_numpy/src/tree.pyx":373 * * * cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) except *: # <<<<<<<<<<<<<< - * cdef vector[NP2CConverter*] converters + * cdef vector[NP2ROOTConverter*] converters * cdef vector[int] posarray */ -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" /* function exit code */ -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __pyx_L1_error:; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_5); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_6); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_9); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_10); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_AddTraceback("_librootnumpy.array2tree", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __pyx_r = 0; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __pyx_L0:; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_v_fieldnames); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_v_fields); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_v_fieldname); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_v_dtype); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_v_roffset); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" return __pyx_r; -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" } -/* "root_numpy/src/tree.pyx":479 +/* "root_numpy/src/tree.pyx":428 * * * def array2tree_toCObj(arr, name='tree', tree=None): # <<<<<<<<<<<<<< @@ -19914,238 +21892,238 @@ goto __pyx_L17_unpacking_failed; * cdef TTree* outtree = NULL */ -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" /* Python wrapper */ -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" static PyObject *__pyx_pw_13_librootnumpy_13array2tree_toCObj(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_13_librootnumpy_13array2tree_toCObj = -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" {"array2tree_toCObj", (PyCFunction)__pyx_pw_13_librootnumpy_13array2tree_toCObj, METH_VARARGS|METH_KEYWORDS, 0}; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" static PyObject *__pyx_pw_13_librootnumpy_13array2tree_toCObj(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_arr = 0 -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_name = 0 -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_tree = 0 -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" ; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" PyObject *__pyx_r = 0; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_RefNannyDeclarations -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_RefNannySetupContext("array2tree_toCObj (wrapper)", 0); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" { -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_name,&__pyx_n_s_tree,0}; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" PyObject* values[3] = {0,0,0}; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[1] = ((PyObject *)__pyx_n_s_tree); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[2] = ((PyObject *)Py_None); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (unlikely(__pyx_kwds)) { -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" Py_ssize_t kw_args; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" switch (pos_args) { case 3: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" case 0: break; default: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" kw_args = PyDict_Size(__pyx_kwds); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" switch (pos_args) { -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" case 0: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; else -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" case 1: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (kw_args > 0) { -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (value) { values[1] = value; kw_args--; } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" case 2: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (kw_args > 0) { -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tree); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (value) { values[2] = value; kw_args--; } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" if (unlikely(kw_args > 0)) { -#line 479 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array2tree_toCObj") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 428 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array2tree_toCObj") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } else { -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" break; default: -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_v_arr = values[0]; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_v_name = values[1]; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_v_tree = values[2]; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" goto __pyx_L4_argument_unpacking_done; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("array2tree_toCObj", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); -#line 479 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 428 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_L3_error:; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_AddTraceback("_librootnumpy.array2tree_toCObj", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" return NULL; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_L4_argument_unpacking_done:; __pyx_r = -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_pf_13_librootnumpy_12array2tree_toCObj(__pyx_self, __pyx_v_arr, __pyx_v_name, __pyx_v_tree); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" /* function exit code */ -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" return __pyx_r; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_name, PyObject *__pyx_v_tree) { TTree *__pyx_v_intree -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" ; TTree *__pyx_v_outtree -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" ; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; @@ -20159,10 +22137,10 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_RefNannySetupContext("array2tree_toCObj", 0); - /* "root_numpy/src/tree.pyx":480 + /* "root_numpy/src/tree.pyx":429 * * def array2tree_toCObj(arr, name='tree', tree=None): * cdef TTree* intree = NULL # <<<<<<<<<<<<<< @@ -20170,10 +22148,10 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * if tree is not None: */ -#line 480 "root_numpy/src/tree.pyx" +#line 429 "root_numpy/src/tree.pyx" __pyx_v_intree = NULL; - /* "root_numpy/src/tree.pyx":481 + /* "root_numpy/src/tree.pyx":430 * def array2tree_toCObj(arr, name='tree', tree=None): * cdef TTree* intree = NULL * cdef TTree* outtree = NULL # <<<<<<<<<<<<<< @@ -20181,10 +22159,10 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * intree = PyCObject_AsVoidPtr(tree) */ -#line 481 "root_numpy/src/tree.pyx" +#line 430 "root_numpy/src/tree.pyx" __pyx_v_outtree = NULL; - /* "root_numpy/src/tree.pyx":482 + /* "root_numpy/src/tree.pyx":431 * cdef TTree* intree = NULL * cdef TTree* outtree = NULL * if tree is not None: # <<<<<<<<<<<<<< @@ -20192,16 +22170,16 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * outtree = array2tree(arr, name=name, tree=intree) */ -#line 482 "root_numpy/src/tree.pyx" +#line 431 "root_numpy/src/tree.pyx" __pyx_t_1 = (__pyx_v_tree != Py_None); -#line 482 "root_numpy/src/tree.pyx" +#line 431 "root_numpy/src/tree.pyx" __pyx_t_2 = (__pyx_t_1 != 0); -#line 482 "root_numpy/src/tree.pyx" +#line 431 "root_numpy/src/tree.pyx" if (__pyx_t_2) { - /* "root_numpy/src/tree.pyx":483 + /* "root_numpy/src/tree.pyx":432 * cdef TTree* outtree = NULL * if tree is not None: * intree = PyCObject_AsVoidPtr(tree) # <<<<<<<<<<<<<< @@ -20209,22 +22187,22 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * return PyCObject_FromVoidPtr(outtree, NULL) */ -#line 483 "root_numpy/src/tree.pyx" - __pyx_t_3 = PyCObject_AsVoidPtr(__pyx_v_tree); if (unlikely(__pyx_t_3 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 432 "root_numpy/src/tree.pyx" + __pyx_t_3 = PyCObject_AsVoidPtr(__pyx_v_tree); if (unlikely(__pyx_t_3 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 483 "root_numpy/src/tree.pyx" +#line 432 "root_numpy/src/tree.pyx" __pyx_v_intree = ((TTree *)__pyx_t_3); -#line 483 "root_numpy/src/tree.pyx" +#line 432 "root_numpy/src/tree.pyx" goto __pyx_L3; -#line 483 "root_numpy/src/tree.pyx" +#line 432 "root_numpy/src/tree.pyx" } -#line 483 "root_numpy/src/tree.pyx" +#line 432 "root_numpy/src/tree.pyx" __pyx_L3:; - /* "root_numpy/src/tree.pyx":484 + /* "root_numpy/src/tree.pyx":433 * if tree is not None: * intree = PyCObject_AsVoidPtr(tree) * outtree = array2tree(arr, name=name, tree=intree) # <<<<<<<<<<<<<< @@ -20232,28 +22210,28 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * */ -#line 484 "root_numpy/src/tree.pyx" - if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 433 "root_numpy/src/tree.pyx" + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 484 "root_numpy/src/tree.pyx" - __pyx_t_4 = __pyx_convert_string_from_py_std__string(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 433 "root_numpy/src/tree.pyx" + __pyx_t_4 = __pyx_convert_string_from_py_std__string(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 484 "root_numpy/src/tree.pyx" +#line 433 "root_numpy/src/tree.pyx" __pyx_t_6.__pyx_n = 2; -#line 484 "root_numpy/src/tree.pyx" +#line 433 "root_numpy/src/tree.pyx" __pyx_t_6.name = __pyx_t_4; -#line 484 "root_numpy/src/tree.pyx" +#line 433 "root_numpy/src/tree.pyx" __pyx_t_6.tree = __pyx_v_intree; -#line 484 "root_numpy/src/tree.pyx" - __pyx_t_5 = __pyx_f_13_librootnumpy_array2tree(((PyArrayObject *)__pyx_v_arr), &__pyx_t_6); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 433 "root_numpy/src/tree.pyx" + __pyx_t_5 = __pyx_f_13_librootnumpy_array2tree(((PyArrayObject *)__pyx_v_arr), &__pyx_t_6); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 484 "root_numpy/src/tree.pyx" +#line 433 "root_numpy/src/tree.pyx" __pyx_v_outtree = __pyx_t_5; - /* "root_numpy/src/tree.pyx":485 + /* "root_numpy/src/tree.pyx":434 * intree = PyCObject_AsVoidPtr(tree) * outtree = array2tree(arr, name=name, tree=intree) * return PyCObject_FromVoidPtr(outtree, NULL) # <<<<<<<<<<<<<< @@ -20261,25 +22239,25 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * */ -#line 485 "root_numpy/src/tree.pyx" +#line 434 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_r); -#line 485 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyCObject_FromVoidPtr(__pyx_v_outtree, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 434 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyCObject_FromVoidPtr(__pyx_v_outtree, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 485 "root_numpy/src/tree.pyx" +#line 434 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 485 "root_numpy/src/tree.pyx" +#line 434 "root_numpy/src/tree.pyx" __pyx_r = __pyx_t_7; -#line 485 "root_numpy/src/tree.pyx" +#line 434 "root_numpy/src/tree.pyx" __pyx_t_7 = 0; -#line 485 "root_numpy/src/tree.pyx" +#line 434 "root_numpy/src/tree.pyx" goto __pyx_L0; - /* "root_numpy/src/tree.pyx":479 + /* "root_numpy/src/tree.pyx":428 * * * def array2tree_toCObj(arr, name='tree', tree=None): # <<<<<<<<<<<<<< @@ -20287,40 +22265,40 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * cdef TTree* outtree = NULL */ -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" /* function exit code */ -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_L1_error:; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_7); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_AddTraceback("_librootnumpy.array2tree_toCObj", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_r = NULL; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __pyx_L0:; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_r); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" return __pyx_r; -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" } -/* "root_numpy/src/tree.pyx":488 +/* "root_numpy/src/tree.pyx":437 * * * def array2root(arr, filename, treename='tree', mode='update'): # <<<<<<<<<<<<<< @@ -20328,265 +22306,265 @@ static PyObject *__pyx_pf_13_librootnumpy_12array2tree_toCObj(CYTHON_UNUSED PyOb * if rfile == NULL: */ -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" /* Python wrapper */ -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" static PyObject *__pyx_pw_13_librootnumpy_15array2root(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_13_librootnumpy_15array2root = -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" {"array2root", (PyCFunction)__pyx_pw_13_librootnumpy_15array2root, METH_VARARGS|METH_KEYWORDS, 0}; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" static PyObject *__pyx_pw_13_librootnumpy_15array2root(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_arr = 0 -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_filename = 0 -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_treename = 0 -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" ; PyObject *__pyx_v_mode = 0 -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" ; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" PyObject *__pyx_r = 0; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_RefNannyDeclarations -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_RefNannySetupContext("array2root (wrapper)", 0); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" { -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arr,&__pyx_n_s_filename,&__pyx_n_s_treename,&__pyx_n_s_mode,0}; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" PyObject* values[4] = {0,0,0,0}; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[2] = ((PyObject *)__pyx_n_s_tree); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[3] = ((PyObject *)__pyx_n_s_update); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (unlikely(__pyx_kwds)) { -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" Py_ssize_t kw_args; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" switch (pos_args) { case 4: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" case 0: break; default: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" kw_args = PyDict_Size(__pyx_kwds); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" switch (pos_args) { -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" case 0: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arr)) != 0)) kw_args--; else -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" case 1: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" else { __Pyx_RaiseArgtupleInvalid("array2root", 0, 2, 4, 1); -#line 488 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 437 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" case 2: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (kw_args > 0) { -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_treename); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (value) { values[2] = value; kw_args--; } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" case 3: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (kw_args > 0) { -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (value) { values[3] = value; kw_args--; } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" if (unlikely(kw_args > 0)) { -#line 488 "root_numpy/src/tree.pyx" - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array2root") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 437 "root_numpy/src/tree.pyx" + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "array2root") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } else { -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[1] = PyTuple_GET_ITEM(__pyx_args, 1); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" values[0] = PyTuple_GET_ITEM(__pyx_args, 0); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" break; default: -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" goto __pyx_L5_argtuple_error; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_v_arr = values[0]; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_v_filename = values[1]; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_v_treename = values[2]; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_v_mode = values[3]; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" goto __pyx_L4_argument_unpacking_done; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("array2root", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); -#line 488 "root_numpy/src/tree.pyx" -{__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L3_error;} +#line 437 "root_numpy/src/tree.pyx" +{__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_L3_error:; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_AddTraceback("_librootnumpy.array2root", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" return NULL; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_L4_argument_unpacking_done:; __pyx_r = -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_pf_13_librootnumpy_14array2root(__pyx_self, __pyx_v_arr, __pyx_v_filename, __pyx_v_treename, __pyx_v_mode); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" /* function exit code */ -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" return __pyx_r; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arr, PyObject *__pyx_v_filename, PyObject *__pyx_v_treename, PyObject *__pyx_v_mode) { TFile *__pyx_v_rfile -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" ; TTree *__pyx_v_tree -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" ; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations const char *__pyx_t_1; @@ -20603,10 +22581,10 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_RefNannySetupContext("array2root", 0); - /* "root_numpy/src/tree.pyx":489 + /* "root_numpy/src/tree.pyx":438 * * def array2root(arr, filename, treename='tree', mode='update'): * cdef TFile* rfile = Open(filename, mode) # <<<<<<<<<<<<<< @@ -20614,16 +22592,16 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * raise IOError("cannot open file {0}".format(filename)) */ -#line 489 "root_numpy/src/tree.pyx" - __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 438 "root_numpy/src/tree.pyx" + __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 489 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 438 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 489 "root_numpy/src/tree.pyx" +#line 438 "root_numpy/src/tree.pyx" __pyx_v_rfile = TFile::Open(__pyx_t_1, __pyx_t_2); - /* "root_numpy/src/tree.pyx":490 + /* "root_numpy/src/tree.pyx":439 * def array2root(arr, filename, treename='tree', mode='update'): * cdef TFile* rfile = Open(filename, mode) * if rfile == NULL: # <<<<<<<<<<<<<< @@ -20631,13 +22609,13 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * if not rfile.IsWritable(): */ -#line 490 "root_numpy/src/tree.pyx" +#line 439 "root_numpy/src/tree.pyx" __pyx_t_3 = ((__pyx_v_rfile == NULL) != 0); -#line 490 "root_numpy/src/tree.pyx" +#line 439 "root_numpy/src/tree.pyx" if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":491 + /* "root_numpy/src/tree.pyx":440 * cdef TFile* rfile = Open(filename, mode) * if rfile == NULL: * raise IOError("cannot open file {0}".format(filename)) # <<<<<<<<<<<<<< @@ -20645,124 +22623,124 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * raise IOError("file {0} is not writable".format(filename)) */ -#line 491 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_open_file_0, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_cannot_open_file_0, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __pyx_t_6 = NULL; -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" if (likely(__pyx_t_6)) { -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_INCREF(__pyx_t_6); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_INCREF(function); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_DECREF_SET(__pyx_t_5, function); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" } -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" } -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" if (!__pyx_t_6) { -#line 491 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_4); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" } else { -#line 491 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL; -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_INCREF(__pyx_v_filename); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_filename); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_v_filename); -#line 491 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_4); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" } -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 491 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_t_4); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __pyx_t_4 = 0; -#line 491 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_4); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_Raise(__pyx_t_4, 0, 0, 0); -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 491 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 491 "root_numpy/src/tree.pyx" +#line 440 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":492 + /* "root_numpy/src/tree.pyx":441 * if rfile == NULL: * raise IOError("cannot open file {0}".format(filename)) * if not rfile.IsWritable(): # <<<<<<<<<<<<<< @@ -20770,13 +22748,13 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * # If a tree with that name exists, we want to update it */ -#line 492 "root_numpy/src/tree.pyx" +#line 441 "root_numpy/src/tree.pyx" __pyx_t_3 = ((!(__pyx_v_rfile->IsWritable() != 0)) != 0); -#line 492 "root_numpy/src/tree.pyx" +#line 441 "root_numpy/src/tree.pyx" if (__pyx_t_3) { - /* "root_numpy/src/tree.pyx":493 + /* "root_numpy/src/tree.pyx":442 * raise IOError("cannot open file {0}".format(filename)) * if not rfile.IsWritable(): * raise IOError("file {0} is not writable".format(filename)) # <<<<<<<<<<<<<< @@ -20784,124 +22762,124 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * cdef TTree* tree = rfile.Get(treename) */ -#line 493 "root_numpy/src/tree.pyx" - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_file_0_is_not_writable, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_file_0_is_not_writable, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __pyx_t_7 = NULL; -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" if (likely(__pyx_t_7)) { -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_INCREF(__pyx_t_7); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_INCREF(function); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_DECREF_SET(__pyx_t_5, function); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" } -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" } -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" if (!__pyx_t_7) { -#line 493 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_4); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" } else { -#line 493 "root_numpy/src/tree.pyx" - __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_6); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL; -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_INCREF(__pyx_v_filename); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_filename); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_v_filename); -#line 493 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_4); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" } -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 493 "root_numpy/src/tree.pyx" - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_t_4); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __pyx_t_4 = 0; -#line 493 "root_numpy/src/tree.pyx" - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_4); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_Raise(__pyx_t_4, 0, 0, 0); -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -#line 493 "root_numpy/src/tree.pyx" - {__pyx_filename = __pyx_f[2]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/tree.pyx" + {__pyx_filename = __pyx_f[2]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 493 "root_numpy/src/tree.pyx" +#line 442 "root_numpy/src/tree.pyx" } - /* "root_numpy/src/tree.pyx":495 + /* "root_numpy/src/tree.pyx":444 * raise IOError("file {0} is not writable".format(filename)) * # If a tree with that name exists, we want to update it * cdef TTree* tree = rfile.Get(treename) # <<<<<<<<<<<<<< @@ -20909,13 +22887,13 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * tree.Write(treename, 2) # TObject::kOverwrite */ -#line 495 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_treename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 444 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_treename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 495 "root_numpy/src/tree.pyx" +#line 444 "root_numpy/src/tree.pyx" __pyx_v_tree = ((TTree *)__pyx_v_rfile->Get(__pyx_t_2)); - /* "root_numpy/src/tree.pyx":496 + /* "root_numpy/src/tree.pyx":445 * # If a tree with that name exists, we want to update it * cdef TTree* tree = rfile.Get(treename) * tree = array2tree(arr, name=treename, tree=tree) # <<<<<<<<<<<<<< @@ -20923,28 +22901,28 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * rfile.Close() */ -#line 496 "root_numpy/src/tree.pyx" - if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 445 "root_numpy/src/tree.pyx" + if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 496 "root_numpy/src/tree.pyx" - __pyx_t_8 = __pyx_convert_string_from_py_std__string(__pyx_v_treename); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 445 "root_numpy/src/tree.pyx" + __pyx_t_8 = __pyx_convert_string_from_py_std__string(__pyx_v_treename); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 496 "root_numpy/src/tree.pyx" +#line 445 "root_numpy/src/tree.pyx" __pyx_t_10.__pyx_n = 2; -#line 496 "root_numpy/src/tree.pyx" +#line 445 "root_numpy/src/tree.pyx" __pyx_t_10.name = __pyx_t_8; -#line 496 "root_numpy/src/tree.pyx" +#line 445 "root_numpy/src/tree.pyx" __pyx_t_10.tree = __pyx_v_tree; -#line 496 "root_numpy/src/tree.pyx" - __pyx_t_9 = __pyx_f_13_librootnumpy_array2tree(((PyArrayObject *)__pyx_v_arr), &__pyx_t_10); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 445 "root_numpy/src/tree.pyx" + __pyx_t_9 = __pyx_f_13_librootnumpy_array2tree(((PyArrayObject *)__pyx_v_arr), &__pyx_t_10); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 496 "root_numpy/src/tree.pyx" +#line 445 "root_numpy/src/tree.pyx" __pyx_v_tree = __pyx_t_9; - /* "root_numpy/src/tree.pyx":497 + /* "root_numpy/src/tree.pyx":446 * cdef TTree* tree = rfile.Get(treename) * tree = array2tree(arr, name=treename, tree=tree) * tree.Write(treename, 2) # TObject::kOverwrite # <<<<<<<<<<<<<< @@ -20952,13 +22930,13 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * # TODO: clean up tree */ -#line 497 "root_numpy/src/tree.pyx" - __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_treename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 446 "root_numpy/src/tree.pyx" + __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_treename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 497 "root_numpy/src/tree.pyx" +#line 446 "root_numpy/src/tree.pyx" __pyx_v_tree->Write(__pyx_t_2, 2); - /* "root_numpy/src/tree.pyx":498 + /* "root_numpy/src/tree.pyx":447 * tree = array2tree(arr, name=treename, tree=tree) * tree.Write(treename, 2) # TObject::kOverwrite * rfile.Close() # <<<<<<<<<<<<<< @@ -20966,19 +22944,19 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * del rfile */ -#line 498 "root_numpy/src/tree.pyx" +#line 447 "root_numpy/src/tree.pyx" __pyx_v_rfile->Close(); - /* "root_numpy/src/tree.pyx":500 + /* "root_numpy/src/tree.pyx":449 * rfile.Close() * # TODO: clean up tree * del rfile # <<<<<<<<<<<<<< */ -#line 500 "root_numpy/src/tree.pyx" +#line 449 "root_numpy/src/tree.pyx" delete __pyx_v_rfile; - /* "root_numpy/src/tree.pyx":488 + /* "root_numpy/src/tree.pyx":437 * * * def array2root(arr, filename, treename='tree', mode='update'): # <<<<<<<<<<<<<< @@ -20986,52 +22964,52 @@ static PyObject *__pyx_pf_13_librootnumpy_14array2root(CYTHON_UNUSED PyObject *_ * if rfile == NULL: */ -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" /* function exit code */ -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_r = Py_None; __Pyx_INCREF(Py_None); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" goto __pyx_L0; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_L1_error:; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_4); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_5); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_6); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_XDECREF(__pyx_t_7); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_AddTraceback("_librootnumpy.array2root", __pyx_clineno, __pyx_lineno, __pyx_filename); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_r = NULL; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __pyx_L0:; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_XGIVEREF(__pyx_r); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_RefNannyFinishContext(); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" return __pyx_r; -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" } /* "root_numpy/src/array.pyx":4 @@ -61456,8 +63434,11 @@ static struct PyModuleDef __pyx_moduledef = { #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_kp_s_0_d, __pyx_k_0_d, sizeof(__pyx_k_0_d), 0, 0, 1, 0}, + {&__pyx_kp_s_0_d_C, __pyx_k_0_d_C, sizeof(__pyx_k_0_d_C), 0, 0, 1, 0}, {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1}, {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, + {&__pyx_n_b_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 0, 1}, {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1}, {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, @@ -61477,6 +63458,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, {&__pyx_n_s_SPECIAL_TYPEDEFS, __pyx_k_SPECIAL_TYPEDEFS, sizeof(__pyx_k_SPECIAL_TYPEDEFS), 0, 0, 1, 1}, + {&__pyx_kp_s_S_0_d, __pyx_k_S_0_d, sizeof(__pyx_k_S_0_d), 0, 0, 1, 0}, {&__pyx_n_s_TNtuple, __pyx_k_TNtuple, sizeof(__pyx_k_TNtuple), 0, 0, 1, 1}, {&__pyx_n_s_TTree, __pyx_k_TTree, sizeof(__pyx_k_TTree), 0, 0, 1, 1}, {&__pyx_n_s_TYPES, __pyx_k_TYPES, sizeof(__pyx_k_TYPES), 0, 0, 1, 1}, @@ -61484,10 +63466,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ULong64_t, __pyx_k_ULong64_t, sizeof(__pyx_k_ULong64_t), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0}, - {&__pyx_n_b__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 0, 1}, - {&__pyx_kp_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 0}, - {&__pyx_kp_s__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 0, 1, 0}, + {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 0}, + {&__pyx_n_b__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 0, 1}, + {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0}, {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, {&__pyx_kp_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 0}, {&__pyx_n_s_arr, __pyx_k_arr, sizeof(__pyx_k_arr), 0, 0, 1, 1}, @@ -61519,12 +63500,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_cannot_read_0, __pyx_k_cannot_read_0, sizeof(__pyx_k_cannot_read_0), 0, 0, 1, 0}, {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1}, {&__pyx_kp_s_chain_is_empty, __pyx_k_chain_is_empty, sizeof(__pyx_k_chain_is_empty), 0, 0, 1, 0}, + {&__pyx_n_b_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 0, 1}, {&__pyx_n_s_char, __pyx_k_char, sizeof(__pyx_k_char), 0, 0, 1, 1}, {&__pyx_n_s_cleanup, __pyx_k_cleanup, sizeof(__pyx_k_cleanup), 0, 0, 1, 1}, {&__pyx_n_s_clsname, __pyx_k_clsname, sizeof(__pyx_k_clsname), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 0, 0, 1, 1}, {&__pyx_kp_s_converter_for_r_is_not_implement, __pyx_k_converter_for_r_is_not_implement, sizeof(__pyx_k_converter_for_r_is_not_implement), 0, 0, 1, 0}, + {&__pyx_kp_s_could_not_allocate_d_bytes, __pyx_k_could_not_allocate_d_bytes, sizeof(__pyx_k_could_not_allocate_d_bytes), 0, 0, 1, 0}, {&__pyx_kp_s_could_not_compile_selection_expr, __pyx_k_could_not_compile_selection_expr, sizeof(__pyx_k_could_not_compile_selection_expr), 0, 0, 1, 0}, {&__pyx_kp_s_could_not_find_double_converter, __pyx_k_could_not_find_double_converter, sizeof(__pyx_k_could_not_find_double_converter), 0, 0, 1, 0}, {&__pyx_n_s_count_nonzero, __pyx_k_count_nonzero, sizeof(__pyx_k_count_nonzero), 0, 0, 1, 1}, @@ -61538,6 +63521,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_dtypecode, __pyx_k_dtypecode, sizeof(__pyx_k_dtypecode), 0, 0, 1, 1}, {&__pyx_kp_s_duplicate_branches_requested, __pyx_k_duplicate_branches_requested, sizeof(__pyx_k_duplicate_branches_requested), 0, 0, 1, 0}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_evaluate_f1, __pyx_k_evaluate_f1, sizeof(__pyx_k_evaluate_f1), 0, 0, 1, 1}, {&__pyx_n_s_evaluate_f2, __pyx_k_evaluate_f2, sizeof(__pyx_k_evaluate_f2), 0, 0, 1, 1}, @@ -61638,6 +63622,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, + {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1}, {&__pyx_kp_s_leaf_list_for_branch_0_is_empty, __pyx_k_leaf_list_for_branch_0_is_empty, sizeof(__pyx_k_leaf_list_for_branch_0_is_empty), 0, 0, 1, 0}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, @@ -61683,7 +63668,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_root_arr, __pyx_k_root_arr, sizeof(__pyx_k_root_arr), 0, 0, 1, 1}, {&__pyx_n_s_root_hist, __pyx_k_root_hist, sizeof(__pyx_k_root_hist), 0, 0, 1, 1}, {&__pyx_n_s_root_mat, __pyx_k_root_mat, sizeof(__pyx_k_root_mat), 0, 0, 1, 1}, - {&__pyx_n_s_rpartition, __pyx_k_rpartition, sizeof(__pyx_k_rpartition), 0, 0, 1, 1}, {&__pyx_n_s_rtree, __pyx_k_rtree, sizeof(__pyx_k_rtree), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_kp_s_s_0_9, __pyx_k_s_0_9, sizeof(__pyx_k_s_0_9), 0, 0, 1, 0}, @@ -61705,6 +63689,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_b_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 0, 1}, {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1}, {&__pyx_n_s_structure, __pyx_k_structure, sizeof(__pyx_k_structure), 0, 0, 1, 1}, + {&__pyx_n_s_subdtype, __pyx_k_subdtype, sizeof(__pyx_k_subdtype), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_kp_s_the_branch_or_expression_0_is_no, __pyx_k_the_branch_or_expression_0_is_no, sizeof(__pyx_k_the_branch_or_expression_0_is_no), 0, 0, 1, 0}, {&__pyx_kp_s_the_chain_is_not_initialized, __pyx_k_the_chain_is_not_initialized, sizeof(__pyx_k_the_chain_is_not_initialized), 0, 0, 1, 0}, @@ -61730,6 +63715,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_unsigned_long_long, __pyx_k_unsigned_long_long, sizeof(__pyx_k_unsigned_long_long), 0, 0, 1, 0}, {&__pyx_kp_s_unsigned_short, __pyx_k_unsigned_short, sizeof(__pyx_k_unsigned_short), 0, 0, 1, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, + {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1}, {&__pyx_kp_b_vector_bool, __pyx_k_vector_bool, sizeof(__pyx_k_vector_bool), 0, 0, 0, 0}, {&__pyx_kp_b_vector_char, __pyx_k_vector_char, sizeof(__pyx_k_vector_char), 0, 0, 0, 0}, @@ -61773,19 +63759,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #if PY_MAJOR_VERSION >= 3 - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else - __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif - __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; @@ -61796,7 +63782,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "root_numpy/src/converters.pyx":95 - * cdef np.npy_intp dims[1] + * cdef SIZE_t dims[1] * dims[0] = numele; * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< * cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_OBJECT, 0) @@ -61812,7 +63798,7 @@ static int __Pyx_InitCachedConstants(void) { #line 95 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple_); - /* "root_numpy/src/converters.pyx":239 + /* "root_numpy/src/converters.pyx":262 * cdef T* fa * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< @@ -61820,16 +63806,16 @@ static int __Pyx_InitCachedConstants(void) { * numele = tmp[0].size() */ -#line 239 "root_numpy/src/converters.pyx" - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 262 "root_numpy/src/converters.pyx" + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 239 "root_numpy/src/converters.pyx" +#line 262 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__2); -#line 239 "root_numpy/src/converters.pyx" +#line 262 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__2); - /* "root_numpy/src/converters.pyx":279 + /* "root_numpy/src/converters.pyx":302 * cdef unsigned long numele * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< @@ -61837,16 +63823,16 @@ static int __Pyx_InitCachedConstants(void) { * numele = tmp[0].size() */ -#line 279 "root_numpy/src/converters.pyx" - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 302 "root_numpy/src/converters.pyx" + __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 279 "root_numpy/src/converters.pyx" +#line 302 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__3); -#line 279 "root_numpy/src/converters.pyx" +#line 302 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__3); - /* "root_numpy/src/converters.pyx":327 + /* "root_numpy/src/converters.pyx":350 * cdef unsigned long numele * # these are defined solely for the outer array wrapper * cdef int objsize = np.dtype('O').itemsize # <<<<<<<<<<<<<< @@ -61854,16 +63840,16 @@ static int __Pyx_InitCachedConstants(void) { * numele = tmp[0].size() */ -#line 327 "root_numpy/src/converters.pyx" - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 350 "root_numpy/src/converters.pyx" + __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_O); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 327 "root_numpy/src/converters.pyx" +#line 350 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__4); -#line 327 "root_numpy/src/converters.pyx" +#line 350 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__4); - /* "root_numpy/src/converters.pyx":455 + /* "root_numpy/src/converters.pyx":487 * match = re.match(LEAF_PATTERN, leaf_title) * if match is not None: * arraydef = match.group(1) # <<<<<<<<<<<<<< @@ -61871,16 +63857,16 @@ static int __Pyx_InitCachedConstants(void) { * arraytokens = arraydef.strip('[]').split('][') */ -#line 455 "root_numpy/src/converters.pyx" - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 487 "root_numpy/src/converters.pyx" + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 455 "root_numpy/src/converters.pyx" +#line 487 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__5); -#line 455 "root_numpy/src/converters.pyx" +#line 487 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__5); - /* "root_numpy/src/converters.pyx":457 + /* "root_numpy/src/converters.pyx":489 * arraydef = match.group(1) * if arraydef is not None: * arraytokens = arraydef.strip('[]').split('][') # <<<<<<<<<<<<<< @@ -61888,24 +63874,41 @@ static int __Pyx_InitCachedConstants(void) { * # First group might be the name of the length-leaf */ -#line 457 "root_numpy/src/converters.pyx" - __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 489 "root_numpy/src/converters.pyx" + __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 457 "root_numpy/src/converters.pyx" +#line 489 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__7); -#line 457 "root_numpy/src/converters.pyx" +#line 489 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__7); -#line 457 "root_numpy/src/converters.pyx" - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 489 "root_numpy/src/converters.pyx" + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s__8); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 457 "root_numpy/src/converters.pyx" +#line 489 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__9); -#line 457 "root_numpy/src/converters.pyx" +#line 489 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__9); + /* "root_numpy/src/converters.pyx":582 + * if ndim > 0 and roottype.compare('C') != 0: + * for axis in range(ndim): + * token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') # <<<<<<<<<<<<<< + * leaflist.append( token) + * leaflist.append(b'/') + */ + +#line 582 "root_numpy/src/converters.pyx" + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GOTREF(__pyx_tuple__10); + +#line 582 "root_numpy/src/converters.pyx" + __Pyx_GIVEREF(__pyx_tuple__10); + /* "root_numpy/src/tree.pyx":90 * return * if load == -1: @@ -61915,13 +63918,13 @@ static int __Pyx_InitCachedConstants(void) { */ #line 90 "root_numpy/src/tree.pyx" - __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_chain_is_empty); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_chain_is_empty); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 90 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__11); + __Pyx_GOTREF(__pyx_tuple__13); #line 90 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__11); + __Pyx_GIVEREF(__pyx_tuple__13); /* "root_numpy/src/tree.pyx":94 * if ignore_index: @@ -61932,13 +63935,13 @@ static int __Pyx_InitCachedConstants(void) { */ #line 94 "root_numpy/src/tree.pyx" - __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_tree_index_in_chain_is_out_of_bo); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_tree_index_in_chain_is_out_of_bo); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 94 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GOTREF(__pyx_tuple__14); #line 94 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__14); /* "root_numpy/src/tree.pyx":96 * raise IndexError("tree index in chain is out of bounds") @@ -61949,13 +63952,13 @@ static int __Pyx_InitCachedConstants(void) { */ #line 96 "root_numpy/src/tree.pyx" - __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_cannot_open_current_file); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_cannot_open_current_file); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 96 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__13); + __Pyx_GOTREF(__pyx_tuple__15); #line 96 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__13); + __Pyx_GIVEREF(__pyx_tuple__15); /* "root_numpy/src/tree.pyx":98 * raise IOError("cannot open current file") @@ -61966,13 +63969,13 @@ static int __Pyx_InitCachedConstants(void) { */ #line 98 "root_numpy/src/tree.pyx" - __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_cannot_access_tree_in_current_fi); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_cannot_access_tree_in_current_fi); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 98 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GOTREF(__pyx_tuple__16); #line 98 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__16); /* "root_numpy/src/tree.pyx":99 * elif load == -4: @@ -61983,13 +63986,13 @@ static int __Pyx_InitCachedConstants(void) { */ #line 99 "root_numpy/src/tree.pyx" - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_the_chain_is_not_initialized); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_the_chain_is_not_initialized); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 99 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__15); + __Pyx_GOTREF(__pyx_tuple__17); #line 99 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__15); + __Pyx_GIVEREF(__pyx_tuple__17); /* "root_numpy/src/tree.pyx":107 * @@ -62000,13 +64003,13 @@ static int __Pyx_InitCachedConstants(void) { */ #line 107 "root_numpy/src/tree.pyx" - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_tree_has_no_branches); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_tree_has_no_branches); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 107 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__16); + __Pyx_GOTREF(__pyx_tuple__18); #line 107 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__16); + __Pyx_GIVEREF(__pyx_tuple__18); /* "root_numpy/src/tree.pyx":113 * num_requested_branches = len(branches) @@ -62017,15 +64020,15 @@ static int __Pyx_InitCachedConstants(void) { */ #line 113 "root_numpy/src/tree.pyx" - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_branches_is_an_empty_list); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_branches_is_an_empty_list); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #line 113 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GOTREF(__pyx_tuple__19); #line 113 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__19); - /* "root_numpy/src/tree.pyx":179 + /* "root_numpy/src/tree.pyx":182 * branch_dict = dict([(b, idx) for idx, b in enumerate(branches)]) * if len(branch_dict) != num_requested_branches: * raise ValueError("duplicate branches requested") # <<<<<<<<<<<<<< @@ -62033,16 +64036,16 @@ static int __Pyx_InitCachedConstants(void) { * # Build vector of Converters for branches */ -#line 179 "root_numpy/src/tree.pyx" - __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_duplicate_branches_requested); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 182 "root_numpy/src/tree.pyx" + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_duplicate_branches_requested); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 179 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__18); +#line 182 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_tuple__20); -#line 179 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__18); +#line 182 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_tuple__20); - /* "root_numpy/src/tree.pyx":255 + /* "root_numpy/src/tree.pyx":264 * if conv == NULL: * # Oops, this should never happen * raise AssertionError( # <<<<<<<<<<<<<< @@ -62050,16 +64053,16 @@ static int __Pyx_InitCachedConstants(void) { * */ -#line 255 "root_numpy/src/tree.pyx" - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_could_not_find_double_converter); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 264 "root_numpy/src/tree.pyx" + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_could_not_find_double_converter); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 255 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__20); +#line 264 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_tuple__22); -#line 255 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__20); +#line 264 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_tuple__22); - /* "root_numpy/src/tree.pyx":271 + /* "root_numpy/src/tree.pyx":280 * * elif columns.size() == 0: * raise RuntimeError("unable to convert any branches in this tree") # <<<<<<<<<<<<<< @@ -62067,16 +64070,16 @@ static int __Pyx_InitCachedConstants(void) { * # Activate branches used by formulae and columns */ -#line 271 "root_numpy/src/tree.pyx" - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_convert_any_branches_i); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 280 "root_numpy/src/tree.pyx" + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_unable_to_convert_any_branches_i); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 271 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__21); +#line 280 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_tuple__23); -#line 271 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__21); +#line 280 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_tuple__23); - /* "root_numpy/src/tree.pyx":285 + /* "root_numpy/src/tree.pyx":294 * dtype.append((this_col.name, this_conv.get_nptype())) * if include_weight: * dtype.append((weight_name, np.dtype('d'))) # <<<<<<<<<<<<<< @@ -62084,16 +64087,16 @@ static int __Pyx_InitCachedConstants(void) { * # Initialize the array */ -#line 285 "root_numpy/src/tree.pyx" - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_d); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 294 "root_numpy/src/tree.pyx" + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_d); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__22); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_tuple__24); -#line 285 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__22); +#line 294 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_tuple__24); - /* "root_numpy/src/tree.pyx":299 + /* "root_numpy/src/tree.pyx":308 * handle_load(entry_size) * if entry_size == 0: * raise IOError("read failure in current tree") # <<<<<<<<<<<<<< @@ -62101,31 +64104,14 @@ static int __Pyx_InitCachedConstants(void) { * # Determine if this entry passes the selection, */ -#line 299 "root_numpy/src/tree.pyx" - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_read_failure_in_current_tree); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - -#line 299 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__23); - -#line 299 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__23); - - /* "root_numpy/src/tree.pyx":396 - * else: - * # check type compatibility of existing branch - * existing_type = this.branch.GetTitle().rpartition('/')[-1] # <<<<<<<<<<<<<< - * if str(roottype) != existing_type: - * raise TypeError( - */ - -#line 396 "root_numpy/src/tree.pyx" - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__25); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 308 "root_numpy/src/tree.pyx" + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_read_failure_in_current_tree); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 396 "root_numpy/src/tree.pyx" - __Pyx_GOTREF(__pyx_tuple__26); +#line 308 "root_numpy/src/tree.pyx" + __Pyx_GOTREF(__pyx_tuple__25); -#line 396 "root_numpy/src/tree.pyx" - __Pyx_GIVEREF(__pyx_tuple__26); +#line 308 "root_numpy/src/tree.pyx" + __Pyx_GIVEREF(__pyx_tuple__25); /* "root_numpy/src/hist.pyx":10 * cdef TH1* _hist = PyCObject_AsVoidPtr(hist) @@ -62351,9 +64337,9 @@ static int __Pyx_InitCachedConstants(void) { /* "root_numpy/src/converters.pyx":23 * * TYPES_NUMPY2ROOT = { - * np.dtype(np.bool): (1, 'O'), # <<<<<<<<<<<<<< - * np.dtype(np.int8): (1, 'B'), - * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.bool): (1, 'O'), # <<<<<<<<<<<<<< + * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.int16): (2, 'S'), */ #line 23 "root_numpy/src/converters.pyx" @@ -62367,10 +64353,10 @@ static int __Pyx_InitCachedConstants(void) { /* "root_numpy/src/converters.pyx":24 * TYPES_NUMPY2ROOT = { - * np.dtype(np.bool): (1, 'O'), - * np.dtype(np.int8): (1, 'B'), # <<<<<<<<<<<<<< - * np.dtype(np.int16): (2, 'S'), - * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.bool): (1, 'O'), + * np.dtype(np.int8): (1, 'B'), # <<<<<<<<<<<<<< + * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.int32): (4, 'I'), */ #line 24 "root_numpy/src/converters.pyx" @@ -62383,11 +64369,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__42); /* "root_numpy/src/converters.pyx":25 - * np.dtype(np.bool): (1, 'O'), - * np.dtype(np.int8): (1, 'B'), - * np.dtype(np.int16): (2, 'S'), # <<<<<<<<<<<<<< - * np.dtype(np.int32): (4, 'I'), - * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.bool): (1, 'O'), + * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.int16): (2, 'S'), # <<<<<<<<<<<<<< + * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.int64): (8, 'L'), */ #line 25 "root_numpy/src/converters.pyx" @@ -62400,11 +64386,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__43); /* "root_numpy/src/converters.pyx":26 - * np.dtype(np.int8): (1, 'B'), - * np.dtype(np.int16): (2, 'S'), - * np.dtype(np.int32): (4, 'I'), # <<<<<<<<<<<<<< - * np.dtype(np.int64): (8, 'L'), - * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.int32): (4, 'I'), # <<<<<<<<<<<<<< + * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.uint8): (1, 'b'), */ #line 26 "root_numpy/src/converters.pyx" @@ -62417,11 +64403,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__44); /* "root_numpy/src/converters.pyx":27 - * np.dtype(np.int16): (2, 'S'), - * np.dtype(np.int32): (4, 'I'), - * np.dtype(np.int64): (8, 'L'), # <<<<<<<<<<<<<< - * np.dtype(np.uint8): (1, 'b'), - * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.int64): (8, 'L'), # <<<<<<<<<<<<<< + * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.uint16): (2, 's'), */ #line 27 "root_numpy/src/converters.pyx" @@ -62434,11 +64420,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__45); /* "root_numpy/src/converters.pyx":28 - * np.dtype(np.int32): (4, 'I'), - * np.dtype(np.int64): (8, 'L'), - * np.dtype(np.uint8): (1, 'b'), # <<<<<<<<<<<<<< - * np.dtype(np.uint16): (2, 's'), - * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.uint8): (1, 'b'), # <<<<<<<<<<<<<< + * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.uint32): (4, 'i'), */ #line 28 "root_numpy/src/converters.pyx" @@ -62451,11 +64437,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__46); /* "root_numpy/src/converters.pyx":29 - * np.dtype(np.int64): (8, 'L'), - * np.dtype(np.uint8): (1, 'b'), - * np.dtype(np.uint16): (2, 's'), # <<<<<<<<<<<<<< - * np.dtype(np.uint32): (4, 'i'), - * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.uint16): (2, 's'), # <<<<<<<<<<<<<< + * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.uint64): (8, 'l'), */ #line 29 "root_numpy/src/converters.pyx" @@ -62468,11 +64454,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__47); /* "root_numpy/src/converters.pyx":30 - * np.dtype(np.uint8): (1, 'b'), - * np.dtype(np.uint16): (2, 's'), - * np.dtype(np.uint32): (4, 'i'), # <<<<<<<<<<<<<< - * np.dtype(np.uint64): (8, 'l'), - * np.dtype(np.float): (8, 'D'), + * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.uint32): (4, 'i'), # <<<<<<<<<<<<<< + * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.float): (8, 'D'), */ #line 30 "root_numpy/src/converters.pyx" @@ -62485,11 +64471,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__48); /* "root_numpy/src/converters.pyx":31 - * np.dtype(np.uint16): (2, 's'), - * np.dtype(np.uint32): (4, 'i'), - * np.dtype(np.uint64): (8, 'l'), # <<<<<<<<<<<<<< - * np.dtype(np.float): (8, 'D'), - * np.dtype(np.float32): (4, 'F'), + * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.uint64): (8, 'l'), # <<<<<<<<<<<<<< + * np.dtype(np.float): (8, 'D'), + * np.dtype(np.float32): (4, 'F'), */ #line 31 "root_numpy/src/converters.pyx" @@ -62502,11 +64488,11 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__49); /* "root_numpy/src/converters.pyx":32 - * np.dtype(np.uint32): (4, 'i'), - * np.dtype(np.uint64): (8, 'l'), - * np.dtype(np.float): (8, 'D'), # <<<<<<<<<<<<<< - * np.dtype(np.float32): (4, 'F'), - * np.dtype(np.float64): (8, 'D'), + * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.float): (8, 'D'), # <<<<<<<<<<<<<< + * np.dtype(np.float32): (4, 'F'), + * np.dtype(np.float64): (8, 'D'), */ #line 32 "root_numpy/src/converters.pyx" @@ -62519,10 +64505,10 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__50); /* "root_numpy/src/converters.pyx":33 - * np.dtype(np.uint64): (8, 'l'), - * np.dtype(np.float): (8, 'D'), - * np.dtype(np.float32): (4, 'F'), # <<<<<<<<<<<<<< - * np.dtype(np.float64): (8, 'D'), + * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.float): (8, 'D'), + * np.dtype(np.float32): (4, 'F'), # <<<<<<<<<<<<<< + * np.dtype(np.float64): (8, 'D'), * } */ @@ -62536,9 +64522,9 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__51); /* "root_numpy/src/converters.pyx":34 - * np.dtype(np.float): (8, 'D'), - * np.dtype(np.float32): (4, 'F'), - * np.dtype(np.float64): (8, 'D'), # <<<<<<<<<<<<<< + * np.dtype(np.float): (8, 'D'), + * np.dtype(np.float32): (4, 'F'), + * np.dtype(np.float64): (8, 'D'), # <<<<<<<<<<<<<< * } * */ @@ -62552,7 +64538,7 @@ static int __Pyx_InitCachedConstants(void) { #line 34 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__52); - /* "root_numpy/src/converters.pyx":502 + /* "root_numpy/src/converters.pyx":536 * * @atexit.register * def cleanup(): # <<<<<<<<<<<<<< @@ -62560,17 +64546,17 @@ static int __Pyx_InitCachedConstants(void) { * it = CONVERTERS.begin() */ -#line 502 "root_numpy/src/converters.pyx" - __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_it); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_it); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_tuple__53); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_tuple__53); -#line 502 "root_numpy/src/converters.pyx" - __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy, __pyx_n_s_cleanup, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy, __pyx_n_s_cleanup, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "root_numpy/src/tree.pyx":4 * @@ -62632,7 +64618,7 @@ static int __Pyx_InitCachedConstants(void) { #line 43 "root_numpy/src/tree.pyx" __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_list_branches, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":335 + /* "root_numpy/src/tree.pyx":344 * * * def root2array_fromFname(fnames, string treename, branches, # <<<<<<<<<<<<<< @@ -62640,19 +64626,19 @@ static int __Pyx_InitCachedConstants(void) { * bool include_weight, string weight_name): */ -#line 335 "root_numpy/src/tree.pyx" - __pyx_tuple__61 = PyTuple_Pack(12, __pyx_n_s_fnames, __pyx_n_s_treename, __pyx_n_s_branches, __pyx_n_s_selection, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_include_weight, __pyx_n_s_weight_name, __pyx_n_s_ttree, __pyx_n_s_fn, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + __pyx_tuple__61 = PyTuple_Pack(12, __pyx_n_s_fnames, __pyx_n_s_treename, __pyx_n_s_branches, __pyx_n_s_selection, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_include_weight, __pyx_n_s_weight_name, __pyx_n_s_ttree, __pyx_n_s_fn, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 335 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_tuple__61); -#line 335 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_tuple__61); -#line 335 "root_numpy/src/tree.pyx" - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_root2array_fromFname, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_root2array_fromFname, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":354 + /* "root_numpy/src/tree.pyx":363 * * * def root2array_fromCObj(tree, branches, selection, # <<<<<<<<<<<<<< @@ -62660,19 +64646,19 @@ static int __Pyx_InitCachedConstants(void) { * bool include_weight, string weight_name): */ -#line 354 "root_numpy/src/tree.pyx" - __pyx_tuple__63 = PyTuple_Pack(9, __pyx_n_s_tree, __pyx_n_s_branches, __pyx_n_s_selection, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_include_weight, __pyx_n_s_weight_name, __pyx_n_s_chain); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __pyx_tuple__63 = PyTuple_Pack(9, __pyx_n_s_tree, __pyx_n_s_branches, __pyx_n_s_selection, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step, __pyx_n_s_include_weight, __pyx_n_s_weight_name, __pyx_n_s_chain); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 354 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_tuple__63); -#line 354 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_tuple__63); -#line 354 "root_numpy/src/tree.pyx" - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_root2array_fromCObj, 354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_root2array_fromCObj, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":479 + /* "root_numpy/src/tree.pyx":428 * * * def array2tree_toCObj(arr, name='tree', tree=None): # <<<<<<<<<<<<<< @@ -62680,19 +64666,19 @@ static int __Pyx_InitCachedConstants(void) { * cdef TTree* outtree = NULL */ -#line 479 "root_numpy/src/tree.pyx" - __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_name, __pyx_n_s_tree, __pyx_n_s_intree, __pyx_n_s_outtree); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 428 "root_numpy/src/tree.pyx" + __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_arr, __pyx_n_s_name, __pyx_n_s_tree, __pyx_n_s_intree, __pyx_n_s_outtree); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_tuple__65); -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_tuple__65); -#line 479 "root_numpy/src/tree.pyx" - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_array2tree_toCObj, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 428 "root_numpy/src/tree.pyx" + __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_array2tree_toCObj, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/tree.pyx":488 + /* "root_numpy/src/tree.pyx":437 * * * def array2root(arr, filename, treename='tree', mode='update'): # <<<<<<<<<<<<<< @@ -62700,17 +64686,17 @@ static int __Pyx_InitCachedConstants(void) { * if rfile == NULL: */ -#line 488 "root_numpy/src/tree.pyx" - __pyx_tuple__67 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_filename, __pyx_n_s_treename, __pyx_n_s_mode, __pyx_n_s_rfile, __pyx_n_s_tree); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 437 "root_numpy/src/tree.pyx" + __pyx_tuple__67 = PyTuple_Pack(6, __pyx_n_s_arr, __pyx_n_s_filename, __pyx_n_s_treename, __pyx_n_s_mode, __pyx_n_s_rfile, __pyx_n_s_tree); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_tuple__67); -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_GIVEREF(__pyx_tuple__67); -#line 488 "root_numpy/src/tree.pyx" - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_array2root, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 437 "root_numpy/src/tree.pyx" + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_endw_workspace_root_numpy_2, __pyx_n_s_array2root, 437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "root_numpy/src/array.pyx":10 * @@ -65640,8 +67626,8 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) * } * * TYPES_NUMPY2ROOT = { # <<<<<<<<<<<<<< - * np.dtype(np.bool): (1, 'O'), - * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.bool): (1, 'O'), + * np.dtype(np.int8): (1, 'B'), */ #line 22 "root_numpy/src/converters.pyx" @@ -65653,9 +67639,9 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) /* "root_numpy/src/converters.pyx":23 * * TYPES_NUMPY2ROOT = { - * np.dtype(np.bool): (1, 'O'), # <<<<<<<<<<<<<< - * np.dtype(np.int8): (1, 'B'), - * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.bool): (1, 'O'), # <<<<<<<<<<<<<< + * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.int16): (2, 'S'), */ #line 23 "root_numpy/src/converters.pyx" @@ -65705,10 +67691,10 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) /* "root_numpy/src/converters.pyx":24 * TYPES_NUMPY2ROOT = { - * np.dtype(np.bool): (1, 'O'), - * np.dtype(np.int8): (1, 'B'), # <<<<<<<<<<<<<< - * np.dtype(np.int16): (2, 'S'), - * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.bool): (1, 'O'), + * np.dtype(np.int8): (1, 'B'), # <<<<<<<<<<<<<< + * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.int32): (4, 'I'), */ #line 24 "root_numpy/src/converters.pyx" @@ -65757,11 +67743,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "root_numpy/src/converters.pyx":25 - * np.dtype(np.bool): (1, 'O'), - * np.dtype(np.int8): (1, 'B'), - * np.dtype(np.int16): (2, 'S'), # <<<<<<<<<<<<<< - * np.dtype(np.int32): (4, 'I'), - * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.bool): (1, 'O'), + * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.int16): (2, 'S'), # <<<<<<<<<<<<<< + * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.int64): (8, 'L'), */ #line 25 "root_numpy/src/converters.pyx" @@ -65810,11 +67796,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/converters.pyx":26 - * np.dtype(np.int8): (1, 'B'), - * np.dtype(np.int16): (2, 'S'), - * np.dtype(np.int32): (4, 'I'), # <<<<<<<<<<<<<< - * np.dtype(np.int64): (8, 'L'), - * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.int8): (1, 'B'), + * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.int32): (4, 'I'), # <<<<<<<<<<<<<< + * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.uint8): (1, 'b'), */ #line 26 "root_numpy/src/converters.pyx" @@ -65863,11 +67849,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "root_numpy/src/converters.pyx":27 - * np.dtype(np.int16): (2, 'S'), - * np.dtype(np.int32): (4, 'I'), - * np.dtype(np.int64): (8, 'L'), # <<<<<<<<<<<<<< - * np.dtype(np.uint8): (1, 'b'), - * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.int16): (2, 'S'), + * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.int64): (8, 'L'), # <<<<<<<<<<<<<< + * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.uint16): (2, 's'), */ #line 27 "root_numpy/src/converters.pyx" @@ -65916,11 +67902,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/converters.pyx":28 - * np.dtype(np.int32): (4, 'I'), - * np.dtype(np.int64): (8, 'L'), - * np.dtype(np.uint8): (1, 'b'), # <<<<<<<<<<<<<< - * np.dtype(np.uint16): (2, 's'), - * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.int32): (4, 'I'), + * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.uint8): (1, 'b'), # <<<<<<<<<<<<<< + * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.uint32): (4, 'i'), */ #line 28 "root_numpy/src/converters.pyx" @@ -65969,11 +67955,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "root_numpy/src/converters.pyx":29 - * np.dtype(np.int64): (8, 'L'), - * np.dtype(np.uint8): (1, 'b'), - * np.dtype(np.uint16): (2, 's'), # <<<<<<<<<<<<<< - * np.dtype(np.uint32): (4, 'i'), - * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.int64): (8, 'L'), + * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.uint16): (2, 's'), # <<<<<<<<<<<<<< + * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.uint64): (8, 'l'), */ #line 29 "root_numpy/src/converters.pyx" @@ -66022,11 +68008,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/converters.pyx":30 - * np.dtype(np.uint8): (1, 'b'), - * np.dtype(np.uint16): (2, 's'), - * np.dtype(np.uint32): (4, 'i'), # <<<<<<<<<<<<<< - * np.dtype(np.uint64): (8, 'l'), - * np.dtype(np.float): (8, 'D'), + * np.dtype(np.uint8): (1, 'b'), + * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.uint32): (4, 'i'), # <<<<<<<<<<<<<< + * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.float): (8, 'D'), */ #line 30 "root_numpy/src/converters.pyx" @@ -66075,11 +68061,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "root_numpy/src/converters.pyx":31 - * np.dtype(np.uint16): (2, 's'), - * np.dtype(np.uint32): (4, 'i'), - * np.dtype(np.uint64): (8, 'l'), # <<<<<<<<<<<<<< - * np.dtype(np.float): (8, 'D'), - * np.dtype(np.float32): (4, 'F'), + * np.dtype(np.uint16): (2, 's'), + * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.uint64): (8, 'l'), # <<<<<<<<<<<<<< + * np.dtype(np.float): (8, 'D'), + * np.dtype(np.float32): (4, 'F'), */ #line 31 "root_numpy/src/converters.pyx" @@ -66128,11 +68114,11 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/converters.pyx":32 - * np.dtype(np.uint32): (4, 'i'), - * np.dtype(np.uint64): (8, 'l'), - * np.dtype(np.float): (8, 'D'), # <<<<<<<<<<<<<< - * np.dtype(np.float32): (4, 'F'), - * np.dtype(np.float64): (8, 'D'), + * np.dtype(np.uint32): (4, 'i'), + * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.float): (8, 'D'), # <<<<<<<<<<<<<< + * np.dtype(np.float32): (4, 'F'), + * np.dtype(np.float64): (8, 'D'), */ #line 32 "root_numpy/src/converters.pyx" @@ -66181,10 +68167,10 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "root_numpy/src/converters.pyx":33 - * np.dtype(np.uint64): (8, 'l'), - * np.dtype(np.float): (8, 'D'), - * np.dtype(np.float32): (4, 'F'), # <<<<<<<<<<<<<< - * np.dtype(np.float64): (8, 'D'), + * np.dtype(np.uint64): (8, 'l'), + * np.dtype(np.float): (8, 'D'), + * np.dtype(np.float32): (4, 'F'), # <<<<<<<<<<<<<< + * np.dtype(np.float64): (8, 'D'), * } */ @@ -66234,9 +68220,9 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/converters.pyx":34 - * np.dtype(np.float): (8, 'D'), - * np.dtype(np.float32): (4, 'F'), - * np.dtype(np.float64): (8, 'D'), # <<<<<<<<<<<<<< + * np.dtype(np.float): (8, 'D'), + * np.dtype(np.float32): (4, 'F'), + * np.dtype(np.float64): (8, 'D'), # <<<<<<<<<<<<<< * } * */ @@ -66318,7 +68304,7 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) #line 37 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":355 + /* "root_numpy/src/converters.pyx":378 * * # basic type converters * for ctypename, (ctype, dtype, dtypecode) in TYPES.items(): # <<<<<<<<<<<<<< @@ -66326,535 +68312,535 @@ PyMODINIT_FUNC PyInit__librootnumpy(void) * ctype, new BasicConverter( */ -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_TYPES); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_8); -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_8 = NULL; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(__pyx_t_8)) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_8); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(function); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF_SET(__pyx_t_7, function); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (__pyx_t_8) { -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_11 = NULL; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { __pyx_t_10 = -1; -#line 355 "root_numpy/src/converters.pyx" -__pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" +__pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" for (;;) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(!__pyx_t_11)) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(PyList_CheckExact(__pyx_t_7))) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #else -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #endif -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #else -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #endif -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } } else -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_1 = __pyx_t_11(__pyx_t_7); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (unlikely(!__pyx_t_1)) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" PyObject* exc_type = PyErr_Occurred(); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (exc_type) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); -#line 355 "root_numpy/src/converters.pyx" - else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + else {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" break; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" PyObject* sequence = __pyx_t_1; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" Py_ssize_t size = Py_SIZE(sequence); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #else -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" Py_ssize_t size = PySequence_Size(sequence); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #endif -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (unlikely(size != 2)) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (size > 2) __Pyx_RaiseTooManyValuesError(2); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); -#line 355 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(PyTuple_CheckExact(sequence))) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_8 = PyList_GET_ITEM(sequence, 0); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_5 = PyList_GET_ITEM(sequence, 1); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_8); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_5); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #else -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_8); -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #endif -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" Py_ssize_t index = -1; -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_9); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext; index = 0; __pyx_t_8 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_8)) -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L14_unpacking_failed; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_8); index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_9); if (unlikely(!__pyx_t_5)) -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L14_unpacking_failed; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 355 "root_numpy/src/converters.pyx" - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_9), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_12 = NULL; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L15_unpacking_done; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_L14_unpacking_failed:; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_12 = NULL; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); -#line 355 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_L15_unpacking_done:; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypename, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypename, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" PyObject* sequence = __pyx_t_5; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" Py_ssize_t size = Py_SIZE(sequence); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #else -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" Py_ssize_t size = PySequence_Size(sequence); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #endif -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (unlikely(size != 3)) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (size > 3) __Pyx_RaiseTooManyValuesError(3); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); -#line 355 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #if CYTHON_COMPILING_IN_CPYTHON -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (likely(PyTuple_CheckExact(sequence))) { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_9 = PyList_GET_ITEM(sequence, 0); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_13 = PyList_GET_ITEM(sequence, 1); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_14 = PyList_GET_ITEM(sequence, 2); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_9); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_13); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_14); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #else -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_9); -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_13); -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_14); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" #endif -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } else { -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" Py_ssize_t index = -1; -#line 355 "root_numpy/src/converters.pyx" - __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_15); -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_12 = Py_TYPE(__pyx_t_15)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_15); if (unlikely(!__pyx_t_9)) -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L16_unpacking_failed; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_13 = __pyx_t_12(__pyx_t_15); if (unlikely(!__pyx_t_13)) -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L16_unpacking_failed; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_13); index = 2; __pyx_t_14 = __pyx_t_12(__pyx_t_15); if (unlikely(!__pyx_t_14)) -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L16_unpacking_failed; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_14); -#line 355 "root_numpy/src/converters.pyx" - if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_15), 3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_15), 3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_12 = NULL; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" goto __pyx_L17_unpacking_done; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_L16_unpacking_failed:; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_t_12 = NULL; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); -#line 355 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __pyx_L17_unpacking_done:; -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; -#line 355 "root_numpy/src/converters.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtype, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; -#line 355 "root_numpy/src/converters.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtypecode, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 378 "root_numpy/src/converters.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtypecode, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - /* "root_numpy/src/converters.pyx":357 + /* "root_numpy/src/converters.pyx":380 * for ctypename, (ctype, dtype, dtypecode) in TYPES.items(): * CONVERTERS.insert(CONVERTERS_ITEM( * ctype, new BasicConverter( # <<<<<<<<<<<<<< @@ -66862,19 +68848,19 @@ goto __pyx_L16_unpacking_failed; * */ -#line 357 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 380 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ctype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 357 "root_numpy/src/converters.pyx" +#line 380 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 357 "root_numpy/src/converters.pyx" - __pyx_t_16 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 380 "root_numpy/src/converters.pyx" + __pyx_t_16 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 357 "root_numpy/src/converters.pyx" +#line 380 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":358 + /* "root_numpy/src/converters.pyx":381 * CONVERTERS.insert(CONVERTERS_ITEM( * ctype, new BasicConverter( * dtype.itemsize, dtype.name, dtypecode))) # <<<<<<<<<<<<<< @@ -66882,61 +68868,61 @@ goto __pyx_L16_unpacking_failed; * # vector<> converters */ -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_t_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dtypecode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_dtypecode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 358 "root_numpy/src/converters.pyx" - __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 381 "root_numpy/src/converters.pyx" + __pyx_t_18 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_18 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 358 "root_numpy/src/converters.pyx" +#line 381 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":356 + /* "root_numpy/src/converters.pyx":379 * # basic type converters * for ctypename, (ctype, dtype, dtypecode) in TYPES.items(): * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -66944,28 +68930,28 @@ goto __pyx_L16_unpacking_failed; * dtype.itemsize, dtype.name, dtypecode))) */ -#line 356 "root_numpy/src/converters.pyx" +#line 379 "root_numpy/src/converters.pyx" try { -#line 356 "root_numpy/src/converters.pyx" +#line 379 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_16, new __pyx_t_13_librootnumpy_BasicConverter(__pyx_t_6, __pyx_t_17, __pyx_t_18)); -#line 356 "root_numpy/src/converters.pyx" +#line 379 "root_numpy/src/converters.pyx" } catch(...) { -#line 356 "root_numpy/src/converters.pyx" +#line 379 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 356 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 379 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 356 "root_numpy/src/converters.pyx" +#line 379 "root_numpy/src/converters.pyx" } -#line 356 "root_numpy/src/converters.pyx" +#line 379 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":355 + /* "root_numpy/src/converters.pyx":378 * * # basic type converters * for ctypename, (ctype, dtype, dtypecode) in TYPES.items(): # <<<<<<<<<<<<<< @@ -66973,13 +68959,13 @@ goto __pyx_L16_unpacking_failed; * ctype, new BasicConverter( */ -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" } -#line 355 "root_numpy/src/converters.pyx" +#line 378 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "root_numpy/src/converters.pyx":362 + /* "root_numpy/src/converters.pyx":385 * # vector<> converters * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorBoolConverter())) # <<<<<<<<<<<<<< @@ -66987,28 +68973,28 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[char]())) */ -#line 362 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_bool); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 385 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_bool); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 362 "root_numpy/src/converters.pyx" +#line 385 "root_numpy/src/converters.pyx" try { -#line 362 "root_numpy/src/converters.pyx" +#line 385 "root_numpy/src/converters.pyx" __pyx_t_20 = new __pyx_t_13_librootnumpy_VectorBoolConverter(); -#line 362 "root_numpy/src/converters.pyx" +#line 385 "root_numpy/src/converters.pyx" } catch(...) { -#line 362 "root_numpy/src/converters.pyx" +#line 385 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 362 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 385 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 362 "root_numpy/src/converters.pyx" +#line 385 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":361 + /* "root_numpy/src/converters.pyx":384 * * # vector<> converters * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67016,28 +69002,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 361 "root_numpy/src/converters.pyx" +#line 384 "root_numpy/src/converters.pyx" try { -#line 361 "root_numpy/src/converters.pyx" +#line 384 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, __pyx_t_20); -#line 361 "root_numpy/src/converters.pyx" +#line 384 "root_numpy/src/converters.pyx" } catch(...) { -#line 361 "root_numpy/src/converters.pyx" +#line 384 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 361 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 384 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 361 "root_numpy/src/converters.pyx" +#line 384 "root_numpy/src/converters.pyx" } -#line 361 "root_numpy/src/converters.pyx" +#line 384 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":364 + /* "root_numpy/src/converters.pyx":387 * 'vector', new VectorBoolConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[char]())) # <<<<<<<<<<<<<< @@ -67045,10 +69031,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[unsigned_char]())) */ -#line 364 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 387 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":363 + /* "root_numpy/src/converters.pyx":386 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorBoolConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67056,28 +69042,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 363 "root_numpy/src/converters.pyx" +#line 386 "root_numpy/src/converters.pyx" try { -#line 363 "root_numpy/src/converters.pyx" +#line 386 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter ()); -#line 363 "root_numpy/src/converters.pyx" +#line 386 "root_numpy/src/converters.pyx" } catch(...) { -#line 363 "root_numpy/src/converters.pyx" +#line 386 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 363 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 386 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 363 "root_numpy/src/converters.pyx" +#line 386 "root_numpy/src/converters.pyx" } -#line 363 "root_numpy/src/converters.pyx" +#line 386 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":366 + /* "root_numpy/src/converters.pyx":389 * 'vector', new VectorConverter[char]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_char]())) # <<<<<<<<<<<<<< @@ -67085,10 +69071,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[short]())) */ -#line 366 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 389 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":365 + /* "root_numpy/src/converters.pyx":388 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[char]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67096,28 +69082,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 365 "root_numpy/src/converters.pyx" +#line 388 "root_numpy/src/converters.pyx" try { -#line 365 "root_numpy/src/converters.pyx" +#line 388 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter<__pyx_t_13_librootnumpy_unsigned_char> ()); -#line 365 "root_numpy/src/converters.pyx" +#line 388 "root_numpy/src/converters.pyx" } catch(...) { -#line 365 "root_numpy/src/converters.pyx" +#line 388 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 365 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 388 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 365 "root_numpy/src/converters.pyx" +#line 388 "root_numpy/src/converters.pyx" } -#line 365 "root_numpy/src/converters.pyx" +#line 388 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":368 + /* "root_numpy/src/converters.pyx":391 * 'vector', new VectorConverter[unsigned_char]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[short]())) # <<<<<<<<<<<<<< @@ -67125,10 +69111,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[unsigned_short]())) */ -#line 368 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 391 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":367 + /* "root_numpy/src/converters.pyx":390 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_char]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67136,28 +69122,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 367 "root_numpy/src/converters.pyx" +#line 390 "root_numpy/src/converters.pyx" try { -#line 367 "root_numpy/src/converters.pyx" +#line 390 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter ()); -#line 367 "root_numpy/src/converters.pyx" +#line 390 "root_numpy/src/converters.pyx" } catch(...) { -#line 367 "root_numpy/src/converters.pyx" +#line 390 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 367 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 390 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 367 "root_numpy/src/converters.pyx" +#line 390 "root_numpy/src/converters.pyx" } -#line 367 "root_numpy/src/converters.pyx" +#line 390 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":370 + /* "root_numpy/src/converters.pyx":393 * 'vector', new VectorConverter[short]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_short]())) # <<<<<<<<<<<<<< @@ -67165,10 +69151,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[int]())) */ -#line 370 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 393 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":369 + /* "root_numpy/src/converters.pyx":392 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[short]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67176,28 +69162,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 369 "root_numpy/src/converters.pyx" +#line 392 "root_numpy/src/converters.pyx" try { -#line 369 "root_numpy/src/converters.pyx" +#line 392 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter<__pyx_t_13_librootnumpy_unsigned_short> ()); -#line 369 "root_numpy/src/converters.pyx" +#line 392 "root_numpy/src/converters.pyx" } catch(...) { -#line 369 "root_numpy/src/converters.pyx" +#line 392 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 369 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 392 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 369 "root_numpy/src/converters.pyx" +#line 392 "root_numpy/src/converters.pyx" } -#line 369 "root_numpy/src/converters.pyx" +#line 392 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":372 + /* "root_numpy/src/converters.pyx":395 * 'vector', new VectorConverter[unsigned_short]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[int]())) # <<<<<<<<<<<<<< @@ -67205,10 +69191,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[unsigned_int]())) */ -#line 372 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 395 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":371 + /* "root_numpy/src/converters.pyx":394 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_short]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67216,28 +69202,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 371 "root_numpy/src/converters.pyx" +#line 394 "root_numpy/src/converters.pyx" try { -#line 371 "root_numpy/src/converters.pyx" +#line 394 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter ()); -#line 371 "root_numpy/src/converters.pyx" +#line 394 "root_numpy/src/converters.pyx" } catch(...) { -#line 371 "root_numpy/src/converters.pyx" +#line 394 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 371 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 394 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 371 "root_numpy/src/converters.pyx" +#line 394 "root_numpy/src/converters.pyx" } -#line 371 "root_numpy/src/converters.pyx" +#line 394 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":374 + /* "root_numpy/src/converters.pyx":397 * 'vector', new VectorConverter[int]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_int]())) # <<<<<<<<<<<<<< @@ -67245,10 +69231,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[long]())) */ -#line 374 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 397 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":373 + /* "root_numpy/src/converters.pyx":396 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[int]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67256,28 +69242,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 373 "root_numpy/src/converters.pyx" +#line 396 "root_numpy/src/converters.pyx" try { -#line 373 "root_numpy/src/converters.pyx" +#line 396 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter<__pyx_t_13_librootnumpy_unsigned_int> ()); -#line 373 "root_numpy/src/converters.pyx" +#line 396 "root_numpy/src/converters.pyx" } catch(...) { -#line 373 "root_numpy/src/converters.pyx" +#line 396 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 373 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 396 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 373 "root_numpy/src/converters.pyx" +#line 396 "root_numpy/src/converters.pyx" } -#line 373 "root_numpy/src/converters.pyx" +#line 396 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":376 + /* "root_numpy/src/converters.pyx":399 * 'vector', new VectorConverter[unsigned_int]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[long]())) # <<<<<<<<<<<<<< @@ -67285,10 +69271,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[unsigned_long]())) */ -#line 376 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 399 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":375 + /* "root_numpy/src/converters.pyx":398 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_int]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67296,28 +69282,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 375 "root_numpy/src/converters.pyx" +#line 398 "root_numpy/src/converters.pyx" try { -#line 375 "root_numpy/src/converters.pyx" +#line 398 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter ()); -#line 375 "root_numpy/src/converters.pyx" +#line 398 "root_numpy/src/converters.pyx" } catch(...) { -#line 375 "root_numpy/src/converters.pyx" +#line 398 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 375 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 398 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 375 "root_numpy/src/converters.pyx" +#line 398 "root_numpy/src/converters.pyx" } -#line 375 "root_numpy/src/converters.pyx" +#line 398 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":378 + /* "root_numpy/src/converters.pyx":401 * 'vector', new VectorConverter[long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_long]())) # <<<<<<<<<<<<<< @@ -67325,10 +69311,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[long_long]())) */ -#line 378 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 401 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":377 + /* "root_numpy/src/converters.pyx":400 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67336,28 +69322,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 377 "root_numpy/src/converters.pyx" +#line 400 "root_numpy/src/converters.pyx" try { -#line 377 "root_numpy/src/converters.pyx" +#line 400 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter<__pyx_t_13_librootnumpy_unsigned_long> ()); -#line 377 "root_numpy/src/converters.pyx" +#line 400 "root_numpy/src/converters.pyx" } catch(...) { -#line 377 "root_numpy/src/converters.pyx" +#line 400 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 377 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 400 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 377 "root_numpy/src/converters.pyx" +#line 400 "root_numpy/src/converters.pyx" } -#line 377 "root_numpy/src/converters.pyx" +#line 400 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":380 + /* "root_numpy/src/converters.pyx":403 * 'vector', new VectorConverter[unsigned_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[long_long]())) # <<<<<<<<<<<<<< @@ -67365,10 +69351,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[unsigned_long_long]())) */ -#line 380 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 403 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":379 + /* "root_numpy/src/converters.pyx":402 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67376,28 +69362,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 379 "root_numpy/src/converters.pyx" +#line 402 "root_numpy/src/converters.pyx" try { -#line 379 "root_numpy/src/converters.pyx" +#line 402 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter<__pyx_t_13_librootnumpy_long_long> ()); -#line 379 "root_numpy/src/converters.pyx" +#line 402 "root_numpy/src/converters.pyx" } catch(...) { -#line 379 "root_numpy/src/converters.pyx" +#line 402 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 379 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 402 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 379 "root_numpy/src/converters.pyx" +#line 402 "root_numpy/src/converters.pyx" } -#line 379 "root_numpy/src/converters.pyx" +#line 402 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":382 + /* "root_numpy/src/converters.pyx":405 * 'vector', new VectorConverter[long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_long_long]())) # <<<<<<<<<<<<<< @@ -67405,10 +69391,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[float]())) */ -#line 382 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 405 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_unsigned_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":381 + /* "root_numpy/src/converters.pyx":404 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67416,28 +69402,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 381 "root_numpy/src/converters.pyx" +#line 404 "root_numpy/src/converters.pyx" try { -#line 381 "root_numpy/src/converters.pyx" +#line 404 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter<__pyx_t_13_librootnumpy_unsigned_long_long> ()); -#line 381 "root_numpy/src/converters.pyx" +#line 404 "root_numpy/src/converters.pyx" } catch(...) { -#line 381 "root_numpy/src/converters.pyx" +#line 404 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 381 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 404 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 381 "root_numpy/src/converters.pyx" +#line 404 "root_numpy/src/converters.pyx" } -#line 381 "root_numpy/src/converters.pyx" +#line 404 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":384 + /* "root_numpy/src/converters.pyx":407 * 'vector', new VectorConverter[unsigned_long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[float]())) # <<<<<<<<<<<<<< @@ -67445,10 +69431,10 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorConverter[double]())) */ -#line 384 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_float); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 407 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_float); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":383 + /* "root_numpy/src/converters.pyx":406 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[unsigned_long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67456,28 +69442,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 383 "root_numpy/src/converters.pyx" +#line 406 "root_numpy/src/converters.pyx" try { -#line 383 "root_numpy/src/converters.pyx" +#line 406 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter ()); -#line 383 "root_numpy/src/converters.pyx" +#line 406 "root_numpy/src/converters.pyx" } catch(...) { -#line 383 "root_numpy/src/converters.pyx" +#line 406 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 383 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 406 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 383 "root_numpy/src/converters.pyx" +#line 406 "root_numpy/src/converters.pyx" } -#line 383 "root_numpy/src/converters.pyx" +#line 406 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":386 + /* "root_numpy/src/converters.pyx":409 * 'vector', new VectorConverter[float]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[double]())) # <<<<<<<<<<<<<< @@ -67485,10 +69471,10 @@ goto __pyx_L16_unpacking_failed; * # vector > converters */ -#line 386 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_double); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 409 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_double); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":385 + /* "root_numpy/src/converters.pyx":408 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorConverter[float]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67496,28 +69482,28 @@ goto __pyx_L16_unpacking_failed; * */ -#line 385 "root_numpy/src/converters.pyx" +#line 408 "root_numpy/src/converters.pyx" try { -#line 385 "root_numpy/src/converters.pyx" +#line 408 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorConverter ()); -#line 385 "root_numpy/src/converters.pyx" +#line 408 "root_numpy/src/converters.pyx" } catch(...) { -#line 385 "root_numpy/src/converters.pyx" +#line 408 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 385 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 408 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 385 "root_numpy/src/converters.pyx" +#line 408 "root_numpy/src/converters.pyx" } -#line 385 "root_numpy/src/converters.pyx" +#line 408 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":390 + /* "root_numpy/src/converters.pyx":413 * # vector > converters * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorBoolConverter())) # <<<<<<<<<<<<<< @@ -67525,28 +69511,28 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[char]())) */ -#line 390 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_bool); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 413 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_bool); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 390 "root_numpy/src/converters.pyx" +#line 413 "root_numpy/src/converters.pyx" try { -#line 390 "root_numpy/src/converters.pyx" +#line 413 "root_numpy/src/converters.pyx" __pyx_t_21 = new __pyx_t_13_librootnumpy_VectorVectorBoolConverter(); -#line 390 "root_numpy/src/converters.pyx" +#line 413 "root_numpy/src/converters.pyx" } catch(...) { -#line 390 "root_numpy/src/converters.pyx" +#line 413 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 390 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 413 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 390 "root_numpy/src/converters.pyx" +#line 413 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":389 + /* "root_numpy/src/converters.pyx":412 * * # vector > converters * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67554,28 +69540,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 389 "root_numpy/src/converters.pyx" +#line 412 "root_numpy/src/converters.pyx" try { -#line 389 "root_numpy/src/converters.pyx" +#line 412 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, __pyx_t_21); -#line 389 "root_numpy/src/converters.pyx" +#line 412 "root_numpy/src/converters.pyx" } catch(...) { -#line 389 "root_numpy/src/converters.pyx" +#line 412 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 389 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 412 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 389 "root_numpy/src/converters.pyx" +#line 412 "root_numpy/src/converters.pyx" } -#line 389 "root_numpy/src/converters.pyx" +#line 412 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":392 + /* "root_numpy/src/converters.pyx":415 * 'vector >', new VectorVectorBoolConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[char]())) # <<<<<<<<<<<<<< @@ -67583,10 +69569,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[unsigned_char]())) */ -#line 392 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 415 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":391 + /* "root_numpy/src/converters.pyx":414 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorBoolConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67594,28 +69580,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 391 "root_numpy/src/converters.pyx" +#line 414 "root_numpy/src/converters.pyx" try { -#line 391 "root_numpy/src/converters.pyx" +#line 414 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter ()); -#line 391 "root_numpy/src/converters.pyx" +#line 414 "root_numpy/src/converters.pyx" } catch(...) { -#line 391 "root_numpy/src/converters.pyx" +#line 414 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 391 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 414 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 391 "root_numpy/src/converters.pyx" +#line 414 "root_numpy/src/converters.pyx" } -#line 391 "root_numpy/src/converters.pyx" +#line 414 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":394 + /* "root_numpy/src/converters.pyx":417 * 'vector >', new VectorVectorConverter[char]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_char]())) # <<<<<<<<<<<<<< @@ -67623,10 +69609,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[short]())) */ -#line 394 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 417 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_char); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":393 + /* "root_numpy/src/converters.pyx":416 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[char]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67634,28 +69620,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 393 "root_numpy/src/converters.pyx" +#line 416 "root_numpy/src/converters.pyx" try { -#line 393 "root_numpy/src/converters.pyx" +#line 416 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter<__pyx_t_13_librootnumpy_unsigned_char> ()); -#line 393 "root_numpy/src/converters.pyx" +#line 416 "root_numpy/src/converters.pyx" } catch(...) { -#line 393 "root_numpy/src/converters.pyx" +#line 416 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 393 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 416 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 393 "root_numpy/src/converters.pyx" +#line 416 "root_numpy/src/converters.pyx" } -#line 393 "root_numpy/src/converters.pyx" +#line 416 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":396 + /* "root_numpy/src/converters.pyx":419 * 'vector >', new VectorVectorConverter[unsigned_char]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[short]())) # <<<<<<<<<<<<<< @@ -67663,10 +69649,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[unsigned_short]())) */ -#line 396 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 419 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":395 + /* "root_numpy/src/converters.pyx":418 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_char]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67674,28 +69660,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 395 "root_numpy/src/converters.pyx" +#line 418 "root_numpy/src/converters.pyx" try { -#line 395 "root_numpy/src/converters.pyx" +#line 418 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter ()); -#line 395 "root_numpy/src/converters.pyx" +#line 418 "root_numpy/src/converters.pyx" } catch(...) { -#line 395 "root_numpy/src/converters.pyx" +#line 418 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 395 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 418 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 395 "root_numpy/src/converters.pyx" +#line 418 "root_numpy/src/converters.pyx" } -#line 395 "root_numpy/src/converters.pyx" +#line 418 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":398 + /* "root_numpy/src/converters.pyx":421 * 'vector >', new VectorVectorConverter[short]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_short]())) # <<<<<<<<<<<<<< @@ -67703,10 +69689,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[int]())) */ -#line 398 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 421 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_short); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":397 + /* "root_numpy/src/converters.pyx":420 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[short]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67714,28 +69700,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 397 "root_numpy/src/converters.pyx" +#line 420 "root_numpy/src/converters.pyx" try { -#line 397 "root_numpy/src/converters.pyx" +#line 420 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter<__pyx_t_13_librootnumpy_unsigned_short> ()); -#line 397 "root_numpy/src/converters.pyx" +#line 420 "root_numpy/src/converters.pyx" } catch(...) { -#line 397 "root_numpy/src/converters.pyx" +#line 420 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 397 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 420 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 397 "root_numpy/src/converters.pyx" +#line 420 "root_numpy/src/converters.pyx" } -#line 397 "root_numpy/src/converters.pyx" +#line 420 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":400 + /* "root_numpy/src/converters.pyx":423 * 'vector >', new VectorVectorConverter[unsigned_short]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[int]())) # <<<<<<<<<<<<<< @@ -67743,10 +69729,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[unsigned_int]())) */ -#line 400 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 423 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":399 + /* "root_numpy/src/converters.pyx":422 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_short]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67754,28 +69740,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 399 "root_numpy/src/converters.pyx" +#line 422 "root_numpy/src/converters.pyx" try { -#line 399 "root_numpy/src/converters.pyx" +#line 422 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter ()); -#line 399 "root_numpy/src/converters.pyx" +#line 422 "root_numpy/src/converters.pyx" } catch(...) { -#line 399 "root_numpy/src/converters.pyx" +#line 422 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 399 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 422 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 399 "root_numpy/src/converters.pyx" +#line 422 "root_numpy/src/converters.pyx" } -#line 399 "root_numpy/src/converters.pyx" +#line 422 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":402 + /* "root_numpy/src/converters.pyx":425 * 'vector >', new VectorVectorConverter[int]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_int]())) # <<<<<<<<<<<<<< @@ -67783,10 +69769,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[long]())) */ -#line 402 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 425 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":401 + /* "root_numpy/src/converters.pyx":424 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[int]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67794,28 +69780,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 401 "root_numpy/src/converters.pyx" +#line 424 "root_numpy/src/converters.pyx" try { -#line 401 "root_numpy/src/converters.pyx" +#line 424 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter<__pyx_t_13_librootnumpy_unsigned_int> ()); -#line 401 "root_numpy/src/converters.pyx" +#line 424 "root_numpy/src/converters.pyx" } catch(...) { -#line 401 "root_numpy/src/converters.pyx" +#line 424 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 401 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 424 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 401 "root_numpy/src/converters.pyx" +#line 424 "root_numpy/src/converters.pyx" } -#line 401 "root_numpy/src/converters.pyx" +#line 424 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":404 + /* "root_numpy/src/converters.pyx":427 * 'vector >', new VectorVectorConverter[unsigned_int]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[long]())) # <<<<<<<<<<<<<< @@ -67823,10 +69809,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[unsigned_long]())) */ -#line 404 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 427 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":403 + /* "root_numpy/src/converters.pyx":426 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_int]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67834,28 +69820,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 403 "root_numpy/src/converters.pyx" +#line 426 "root_numpy/src/converters.pyx" try { -#line 403 "root_numpy/src/converters.pyx" +#line 426 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter ()); -#line 403 "root_numpy/src/converters.pyx" +#line 426 "root_numpy/src/converters.pyx" } catch(...) { -#line 403 "root_numpy/src/converters.pyx" +#line 426 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 403 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 426 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 403 "root_numpy/src/converters.pyx" +#line 426 "root_numpy/src/converters.pyx" } -#line 403 "root_numpy/src/converters.pyx" +#line 426 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":406 + /* "root_numpy/src/converters.pyx":429 * 'vector >', new VectorVectorConverter[long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_long]())) # <<<<<<<<<<<<<< @@ -67863,10 +69849,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[long_long]())) */ -#line 406 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 429 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":405 + /* "root_numpy/src/converters.pyx":428 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67874,28 +69860,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 405 "root_numpy/src/converters.pyx" +#line 428 "root_numpy/src/converters.pyx" try { -#line 405 "root_numpy/src/converters.pyx" +#line 428 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter<__pyx_t_13_librootnumpy_unsigned_long> ()); -#line 405 "root_numpy/src/converters.pyx" +#line 428 "root_numpy/src/converters.pyx" } catch(...) { -#line 405 "root_numpy/src/converters.pyx" +#line 428 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 405 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 428 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 405 "root_numpy/src/converters.pyx" +#line 428 "root_numpy/src/converters.pyx" } -#line 405 "root_numpy/src/converters.pyx" +#line 428 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":408 + /* "root_numpy/src/converters.pyx":431 * 'vector >', new VectorVectorConverter[unsigned_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[long_long]())) # <<<<<<<<<<<<<< @@ -67903,10 +69889,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[unsigned_long_long]())) */ -#line 408 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 431 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":407 + /* "root_numpy/src/converters.pyx":430 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67914,28 +69900,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 407 "root_numpy/src/converters.pyx" +#line 430 "root_numpy/src/converters.pyx" try { -#line 407 "root_numpy/src/converters.pyx" +#line 430 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter<__pyx_t_13_librootnumpy_long_long> ()); -#line 407 "root_numpy/src/converters.pyx" +#line 430 "root_numpy/src/converters.pyx" } catch(...) { -#line 407 "root_numpy/src/converters.pyx" +#line 430 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 407 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 430 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 407 "root_numpy/src/converters.pyx" +#line 430 "root_numpy/src/converters.pyx" } -#line 407 "root_numpy/src/converters.pyx" +#line 430 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":410 + /* "root_numpy/src/converters.pyx":433 * 'vector >', new VectorVectorConverter[long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_long_long]())) # <<<<<<<<<<<<<< @@ -67943,10 +69929,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[float]())) */ -#line 410 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 433 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_unsigned_long_long); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":409 + /* "root_numpy/src/converters.pyx":432 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67954,28 +69940,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 409 "root_numpy/src/converters.pyx" +#line 432 "root_numpy/src/converters.pyx" try { -#line 409 "root_numpy/src/converters.pyx" +#line 432 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter<__pyx_t_13_librootnumpy_unsigned_long_long> ()); -#line 409 "root_numpy/src/converters.pyx" +#line 432 "root_numpy/src/converters.pyx" } catch(...) { -#line 409 "root_numpy/src/converters.pyx" +#line 432 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 409 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 432 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 409 "root_numpy/src/converters.pyx" +#line 432 "root_numpy/src/converters.pyx" } -#line 409 "root_numpy/src/converters.pyx" +#line 432 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":412 + /* "root_numpy/src/converters.pyx":435 * 'vector >', new VectorVectorConverter[unsigned_long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[float]())) # <<<<<<<<<<<<<< @@ -67983,10 +69969,10 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorConverter[double]())) */ -#line 412 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_float); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 435 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_float); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":411 + /* "root_numpy/src/converters.pyx":434 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[unsigned_long_long]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -67994,28 +69980,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 411 "root_numpy/src/converters.pyx" +#line 434 "root_numpy/src/converters.pyx" try { -#line 411 "root_numpy/src/converters.pyx" +#line 434 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter ()); -#line 411 "root_numpy/src/converters.pyx" +#line 434 "root_numpy/src/converters.pyx" } catch(...) { -#line 411 "root_numpy/src/converters.pyx" +#line 434 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 411 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 434 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 411 "root_numpy/src/converters.pyx" +#line 434 "root_numpy/src/converters.pyx" } -#line 411 "root_numpy/src/converters.pyx" +#line 434 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":414 + /* "root_numpy/src/converters.pyx":437 * 'vector >', new VectorVectorConverter[float]())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[double]())) # <<<<<<<<<<<<<< @@ -68023,10 +70009,10 @@ goto __pyx_L16_unpacking_failed; * # string converters */ -#line 414 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_double); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 437 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_double); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "root_numpy/src/converters.pyx":413 + /* "root_numpy/src/converters.pyx":436 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorConverter[float]())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -68034,28 +70020,28 @@ goto __pyx_L16_unpacking_failed; * */ -#line 413 "root_numpy/src/converters.pyx" +#line 436 "root_numpy/src/converters.pyx" try { -#line 413 "root_numpy/src/converters.pyx" +#line 436 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, new __pyx_t_13_librootnumpy_VectorVectorConverter ()); -#line 413 "root_numpy/src/converters.pyx" +#line 436 "root_numpy/src/converters.pyx" } catch(...) { -#line 413 "root_numpy/src/converters.pyx" +#line 436 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 413 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 436 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 413 "root_numpy/src/converters.pyx" +#line 436 "root_numpy/src/converters.pyx" } -#line 413 "root_numpy/src/converters.pyx" +#line 436 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":418 + /* "root_numpy/src/converters.pyx":441 * # string converters * CONVERTERS.insert(CONVERTERS_ITEM( * 'string', new StringConverter())) # <<<<<<<<<<<<<< @@ -68063,28 +70049,28 @@ goto __pyx_L16_unpacking_failed; * 'vector', new VectorStringConverter())) */ -#line 418 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_n_b_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 441 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_n_b_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 418 "root_numpy/src/converters.pyx" +#line 441 "root_numpy/src/converters.pyx" try { -#line 418 "root_numpy/src/converters.pyx" +#line 441 "root_numpy/src/converters.pyx" __pyx_t_22 = new __pyx_t_13_librootnumpy_StringConverter(); -#line 418 "root_numpy/src/converters.pyx" +#line 441 "root_numpy/src/converters.pyx" } catch(...) { -#line 418 "root_numpy/src/converters.pyx" +#line 441 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 418 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 441 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 418 "root_numpy/src/converters.pyx" +#line 441 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":417 + /* "root_numpy/src/converters.pyx":440 * * # string converters * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -68092,28 +70078,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 417 "root_numpy/src/converters.pyx" +#line 440 "root_numpy/src/converters.pyx" try { -#line 417 "root_numpy/src/converters.pyx" +#line 440 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, __pyx_t_22); -#line 417 "root_numpy/src/converters.pyx" +#line 440 "root_numpy/src/converters.pyx" } catch(...) { -#line 417 "root_numpy/src/converters.pyx" +#line 440 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 417 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 440 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 417 "root_numpy/src/converters.pyx" +#line 440 "root_numpy/src/converters.pyx" } -#line 417 "root_numpy/src/converters.pyx" +#line 440 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":420 + /* "root_numpy/src/converters.pyx":443 * 'string', new StringConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorStringConverter())) # <<<<<<<<<<<<<< @@ -68121,28 +70107,28 @@ goto __pyx_L16_unpacking_failed; * 'vector >', new VectorVectorStringConverter())) */ -#line 420 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 443 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 420 "root_numpy/src/converters.pyx" +#line 443 "root_numpy/src/converters.pyx" try { -#line 420 "root_numpy/src/converters.pyx" +#line 443 "root_numpy/src/converters.pyx" __pyx_t_23 = new __pyx_t_13_librootnumpy_VectorStringConverter(); -#line 420 "root_numpy/src/converters.pyx" +#line 443 "root_numpy/src/converters.pyx" } catch(...) { -#line 420 "root_numpy/src/converters.pyx" +#line 443 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 420 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 443 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 420 "root_numpy/src/converters.pyx" +#line 443 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":419 + /* "root_numpy/src/converters.pyx":442 * CONVERTERS.insert(CONVERTERS_ITEM( * 'string', new StringConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -68150,28 +70136,28 @@ goto __pyx_L16_unpacking_failed; * CONVERTERS.insert(CONVERTERS_ITEM( */ -#line 419 "root_numpy/src/converters.pyx" +#line 442 "root_numpy/src/converters.pyx" try { -#line 419 "root_numpy/src/converters.pyx" +#line 442 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, __pyx_t_23); -#line 419 "root_numpy/src/converters.pyx" +#line 442 "root_numpy/src/converters.pyx" } catch(...) { -#line 419 "root_numpy/src/converters.pyx" +#line 442 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 419 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 442 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 419 "root_numpy/src/converters.pyx" +#line 442 "root_numpy/src/converters.pyx" } -#line 419 "root_numpy/src/converters.pyx" +#line 442 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":422 + /* "root_numpy/src/converters.pyx":445 * 'vector', new VectorStringConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector >', new VectorVectorStringConverter())) # <<<<<<<<<<<<<< @@ -68179,28 +70165,28 @@ goto __pyx_L16_unpacking_failed; * */ -#line 422 "root_numpy/src/converters.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 445 "root_numpy/src/converters.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_kp_b_vector_vector_string); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 422 "root_numpy/src/converters.pyx" +#line 445 "root_numpy/src/converters.pyx" try { -#line 422 "root_numpy/src/converters.pyx" +#line 445 "root_numpy/src/converters.pyx" __pyx_t_24 = new __pyx_t_13_librootnumpy_VectorVectorStringConverter(); -#line 422 "root_numpy/src/converters.pyx" +#line 445 "root_numpy/src/converters.pyx" } catch(...) { -#line 422 "root_numpy/src/converters.pyx" +#line 445 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 422 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 445 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 422 "root_numpy/src/converters.pyx" +#line 445 "root_numpy/src/converters.pyx" } - /* "root_numpy/src/converters.pyx":421 + /* "root_numpy/src/converters.pyx":444 * CONVERTERS.insert(CONVERTERS_ITEM( * 'vector', new VectorStringConverter())) * CONVERTERS.insert(CONVERTERS_ITEM( # <<<<<<<<<<<<<< @@ -68208,28 +70194,28 @@ goto __pyx_L16_unpacking_failed; * */ -#line 421 "root_numpy/src/converters.pyx" +#line 444 "root_numpy/src/converters.pyx" try { -#line 421 "root_numpy/src/converters.pyx" +#line 444 "root_numpy/src/converters.pyx" __pyx_t_19 = __pyx_t_13_librootnumpy_CONVERTERS_ITEM(__pyx_t_17, __pyx_t_24); -#line 421 "root_numpy/src/converters.pyx" +#line 444 "root_numpy/src/converters.pyx" } catch(...) { -#line 421 "root_numpy/src/converters.pyx" +#line 444 "root_numpy/src/converters.pyx" __Pyx_CppExn2PyErr(); -#line 421 "root_numpy/src/converters.pyx" - {__pyx_filename = __pyx_f[1]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 444 "root_numpy/src/converters.pyx" + {__pyx_filename = __pyx_f[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 421 "root_numpy/src/converters.pyx" +#line 444 "root_numpy/src/converters.pyx" } -#line 421 "root_numpy/src/converters.pyx" +#line 444 "root_numpy/src/converters.pyx" __pyx_v_13_librootnumpy_CONVERTERS.insert(__pyx_t_19); - /* "root_numpy/src/converters.pyx":501 + /* "root_numpy/src/converters.pyx":535 * * * @atexit.register # <<<<<<<<<<<<<< @@ -68237,22 +70223,22 @@ goto __pyx_L16_unpacking_failed; * # Delete all converters when module is town down */ -#line 501 "root_numpy/src/converters.pyx" - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 535 "root_numpy/src/converters.pyx" + __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 501 "root_numpy/src/converters.pyx" +#line 535 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 501 "root_numpy/src/converters.pyx" - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 535 "root_numpy/src/converters.pyx" + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 501 "root_numpy/src/converters.pyx" +#line 535 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_5); -#line 501 "root_numpy/src/converters.pyx" +#line 535 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "root_numpy/src/converters.pyx":502 + /* "root_numpy/src/converters.pyx":536 * * @atexit.register * def cleanup(): # <<<<<<<<<<<<<< @@ -68260,94 +70246,94 @@ goto __pyx_L16_unpacking_failed; * it = CONVERTERS.begin() */ -#line 502 "root_numpy/src/converters.pyx" - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_1cleanup, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_1cleanup, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_1); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __pyx_t_8 = NULL; -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) { -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" if (likely(__pyx_t_8)) { -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_INCREF(__pyx_t_8); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_INCREF(function); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_DECREF_SET(__pyx_t_5, function); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" } -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" } -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" if (!__pyx_t_8) { -#line 502 "root_numpy/src/converters.pyx" - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" } else { -#line 502 "root_numpy/src/converters.pyx" - __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_14); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL; -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_1); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GIVEREF(__pyx_t_1); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __pyx_t_1 = 0; -#line 502 "root_numpy/src/converters.pyx" - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" } -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; -#line 502 "root_numpy/src/converters.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 536 "root_numpy/src/converters.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 502 "root_numpy/src/converters.pyx" +#line 536 "root_numpy/src/converters.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/tree.pyx":4 @@ -68410,7 +70396,7 @@ goto __pyx_L16_unpacking_failed; #line 43 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "root_numpy/src/tree.pyx":335 + /* "root_numpy/src/tree.pyx":344 * * * def root2array_fromFname(fnames, string treename, branches, # <<<<<<<<<<<<<< @@ -68418,19 +70404,19 @@ goto __pyx_L16_unpacking_failed; * bool include_weight, string weight_name): */ -#line 335 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_9root2array_fromFname, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_9root2array_fromFname, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 335 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 335 "root_numpy/src/tree.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_root2array_fromFname, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 344 "root_numpy/src/tree.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_root2array_fromFname, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 335 "root_numpy/src/tree.pyx" +#line 344 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "root_numpy/src/tree.pyx":354 + /* "root_numpy/src/tree.pyx":363 * * * def root2array_fromCObj(tree, branches, selection, # <<<<<<<<<<<<<< @@ -68438,33 +70424,33 @@ goto __pyx_L16_unpacking_failed; * bool include_weight, string weight_name): */ -#line 354 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_11root2array_fromCObj, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_11root2array_fromCObj, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 354 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 354 "root_numpy/src/tree.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_root2array_fromCObj, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 363 "root_numpy/src/tree.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_root2array_fromCObj, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 354 "root_numpy/src/tree.pyx" +#line 363 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "root_numpy/src/tree.pyx":424 + /* "root_numpy/src/tree.pyx":373 * * * cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) except *: # <<<<<<<<<<<<<< - * cdef vector[NP2CConverter*] converters + * cdef vector[NP2ROOTConverter*] converters * cdef vector[int] posarray */ -#line 424 "root_numpy/src/tree.pyx" - __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_n_b_tree); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 373 "root_numpy/src/tree.pyx" + __pyx_t_17 = __pyx_convert_string_from_py_std__string(__pyx_n_b_tree); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 424 "root_numpy/src/tree.pyx" +#line 373 "root_numpy/src/tree.pyx" __pyx_k__27 = __pyx_t_17; - /* "root_numpy/src/tree.pyx":479 + /* "root_numpy/src/tree.pyx":428 * * * def array2tree_toCObj(arr, name='tree', tree=None): # <<<<<<<<<<<<<< @@ -68472,19 +70458,19 @@ goto __pyx_L16_unpacking_failed; * cdef TTree* outtree = NULL */ -#line 479 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_13array2tree_toCObj, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 428 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_13array2tree_toCObj, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 479 "root_numpy/src/tree.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_array2tree_toCObj, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 428 "root_numpy/src/tree.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array2tree_toCObj, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 479 "root_numpy/src/tree.pyx" +#line 428 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "root_numpy/src/tree.pyx":488 + /* "root_numpy/src/tree.pyx":437 * * * def array2root(arr, filename, treename='tree', mode='update'): # <<<<<<<<<<<<<< @@ -68492,16 +70478,16 @@ goto __pyx_L16_unpacking_failed; * if rfile == NULL: */ -#line 488 "root_numpy/src/tree.pyx" - __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_15array2root, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 437 "root_numpy/src/tree.pyx" + __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_13_librootnumpy_15array2root, NULL, __pyx_n_s_librootnumpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_GOTREF(__pyx_t_7); -#line 488 "root_numpy/src/tree.pyx" - if (PyDict_SetItem(__pyx_d, __pyx_n_s_array2root, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +#line 437 "root_numpy/src/tree.pyx" + if (PyDict_SetItem(__pyx_d, __pyx_n_s_array2root, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} -#line 488 "root_numpy/src/tree.pyx" +#line 437 "root_numpy/src/tree.pyx" __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "root_numpy/src/array.pyx":10 @@ -69863,6 +71849,55 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v); } +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; + cfunc = PyCFunction_GET_FUNCTION(func); + self = PyCFunction_GET_SELF(func); + if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) + return NULL; + result = cfunc(self, arg); + Py_LeaveRecursiveCall(); + if (unlikely(!result) && unlikely(!PyErr_Occurred())) { + PyErr_SetString( + PyExc_SystemError, + "NULL result without error in PyObject_Call"); + } + return result; +} +#endif + +#if CYTHON_COMPILING_IN_CPYTHON +static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); + if (unlikely(!args)) return NULL; + Py_INCREF(arg); + PyTuple_SET_ITEM(args, 0, arg); + result = __Pyx_PyObject_Call(func, args, NULL); + Py_DECREF(args); + return result; +} +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +#ifdef __Pyx_CyFunction_USED + if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +#else + if (likely(PyCFunction_Check(func))) { +#endif + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +} +#else +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject* args = PyTuple_Pack(1, arg); + return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; +} +#endif + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; @@ -69941,55 +71976,6 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); -} -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject* args = PyTuple_Pack(1, arg); - return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL; -} -#endif - static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result = NULL; method = __Pyx_PyObject_GetAttrStr(obj, method_name); @@ -70209,6 +72195,62 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } #endif +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +static CYTHON_INLINE int __Pyx_IterFinish(void) { +#if CYTHON_COMPILING_IN_CPYTHON + PyThreadState *tstate = PyThreadState_GET(); + PyObject* exc_type = tstate->curexc_type; + if (unlikely(exc_type)) { + if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { + PyObject *exc_value, *exc_tb; + exc_value = tstate->curexc_value; + exc_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + Py_DECREF(exc_type); + Py_XDECREF(exc_value); + Py_XDECREF(exc_tb); + return 0; + } else { + return -1; + } + } + return 0; +#else + if (unlikely(PyErr_Occurred())) { + if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { + PyErr_Clear(); + return 0; + } else { + return -1; + } + } + return 0; +#endif +} + +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } else { + return __Pyx_IterFinish(); + } + return 0; +} + static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { #if CYTHON_COMPILING_IN_PYPY return PyObject_RichCompareBool(s1, s2, equals); @@ -70603,62 +72645,6 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) #endif } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", @@ -71848,6 +73834,32 @@ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) { return (unsigned long) -1; } +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { + if (sizeof(int) < sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); + } else if (sizeof(int) <= sizeof(unsigned long long)) { + return PyLong_FromUnsignedLongLong((unsigned long long) value); + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(long long)) { + return PyLong_FromLongLong((long long) value); + } + } + { + int one = 1; int little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&value; + return _PyLong_FromByteArray(bytes, sizeof(int), + little, !is_unsigned); + } +} + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -71969,28 +73981,28 @@ static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) { return (Py_intptr_t) -1; } -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = 0; +static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) { + const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { + if (sizeof(Py_intptr_t) < sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned long long)) { + } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long long)) { return PyLong_FromUnsignedLongLong((unsigned long long) value); } } else { - if (sizeof(int) <= sizeof(long)) { + if (sizeof(Py_intptr_t) <= sizeof(long)) { return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(long long)) { + } else if (sizeof(Py_intptr_t) <= sizeof(long long)) { return PyLong_FromLongLong((long long) value); } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), + return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t), little, !is_unsigned); } } diff --git a/root_numpy/src/converters.pyx b/root_numpy/src/converters.pyx index c816344..0ef2387 100644 --- a/root_numpy/src/converters.pyx +++ b/root_numpy/src/converters.pyx @@ -20,18 +20,18 @@ TYPES = { } TYPES_NUMPY2ROOT = { - np.dtype(np.bool): (1, 'O'), - np.dtype(np.int8): (1, 'B'), - np.dtype(np.int16): (2, 'S'), - np.dtype(np.int32): (4, 'I'), - np.dtype(np.int64): (8, 'L'), - np.dtype(np.uint8): (1, 'b'), - np.dtype(np.uint16): (2, 's'), - np.dtype(np.uint32): (4, 'i'), - np.dtype(np.uint64): (8, 'l'), - np.dtype(np.float): (8, 'D'), - np.dtype(np.float32): (4, 'F'), - np.dtype(np.float64): (8, 'D'), + np.dtype(np.bool): (1, 'O'), + np.dtype(np.int8): (1, 'B'), + np.dtype(np.int16): (2, 'S'), + np.dtype(np.int32): (4, 'I'), + np.dtype(np.int64): (8, 'L'), + np.dtype(np.uint8): (1, 'b'), + np.dtype(np.uint16): (2, 's'), + np.dtype(np.uint32): (4, 'i'), + np.dtype(np.uint64): (8, 'l'), + np.dtype(np.float): (8, 'D'), + np.dtype(np.float32): (4, 'F'), + np.dtype(np.float64): (8, 'D'), } SPECIAL_TYPEDEFS = { @@ -52,9 +52,9 @@ cdef inline unicode resolve_type(const char* typename): # and write it to buffer cdef inline int create_numpyarray(void* buffer, void* src, int typecode, unsigned long numele, int elesize, - int ndim = 1, np.npy_intp* dims = NULL): - cdef np.npy_intp* _dims = dims - cdef np.npy_intp default_dims[1] + int ndim=1, SIZE_t* dims=NULL): + cdef SIZE_t* _dims = dims + cdef SIZE_t default_dims[1] if dims == NULL: _dims = default_dims _dims[0] = numele; @@ -73,7 +73,7 @@ cdef inline int create_numpyarray(void* buffer, void* src, int typecode, # special treatment for vector cdef inline int create_numpyarray_vectorbool(void* buffer, vector[bool]* src): cdef unsigned long numele = src.size() - cdef np.npy_intp dims[1] + cdef SIZE_t dims[1] dims[0] = numele; cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_BOOL, 0) cdef PyObject* tmpobj = tmp # borrow ref @@ -90,7 +90,7 @@ cdef inline int create_numpyarray_vectorbool(void* buffer, vector[bool]* src): cdef inline int create_numpyarray_vectorstring(void* buffer, vector[string]* src): cdef unsigned long numele = src.size() - cdef np.npy_intp dims[1] + cdef SIZE_t dims[1] dims[0] = numele; cdef int objsize = np.dtype('O').itemsize cdef np.ndarray tmp = np.PyArray_EMPTY(1, dims, np.NPY_OBJECT, 0) @@ -153,12 +153,12 @@ cdef cppclass ObjectConverterBase(Converter): cdef cppclass VaryArrayConverter(ObjectConverterBase): BasicConverter* conv # converter for single element - np.npy_intp* dims + SIZE_t* dims int ndim int typecode int elesize - __init__(BasicConverter* conv, int ndim, np.npy_intp* dims): + __init__(BasicConverter* conv, int ndim, SIZE_t* dims): this.conv = conv this.dims = dims this.ndim = ndim @@ -199,6 +199,29 @@ cdef cppclass FixedArrayConverter(Converter): return this.conv.nptypecode +cdef cppclass CharArrayConverter(Converter): + BasicConverter* conv # converter for single element + int size + + __init__(int size): + this.conv = CONVERTERS['char'] + this.size = size + + int write(Column* col, void* buffer): + cdef int nbytes = col.GetSize() - sizeof(char) # exclude null-termination + cdef int length = strlen( col.GetValuePointer()) + memcpy(buffer, col.GetValuePointer(), nbytes) + if length < nbytes: + memset(( buffer) + length, '\0', nbytes - length) + return nbytes + + object get_nptype(): + return 'S{0:d}'.format(this.size) + + int get_nptypecode(): + return this.conv.nptypecode + + cdef cppclass VectorConverter[T](ObjectConverterBase): int elesize int nptypecode @@ -242,7 +265,7 @@ cdef cppclass VectorVectorConverter[T](ObjectConverterBase): # create an outer array container that dataptr points to, # containing pointers from create_numpyarray(). # define an (numele)-dimensional outer array to hold our subvectors fa - cdef np.npy_intp dims[1] + cdef SIZE_t dims[1] dims[0] = numele cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) cdef PyObject* outerobj = outer # borrow ref @@ -282,7 +305,7 @@ cdef cppclass VectorVectorBoolConverter(ObjectConverterBase): # create an outer array container that dataptr points to, # containing pointers from create_numpyarray(). # define an (numele)-dimensional outer array to hold our subvectors fa - cdef np.npy_intp dims[1] + cdef SIZE_t dims[1] dims[0] = numele cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) cdef PyObject* outerobj = outer # borrow ref @@ -330,7 +353,7 @@ cdef cppclass VectorVectorStringConverter(ObjectConverterBase): # create an outer array container that dataptr points to, # containing pointers from create_numpyarray(). # define an (numele)-dimensional outer array to hold our subvectors fa - cdef np.npy_intp dims[1] + cdef SIZE_t dims[1] dims[0] = numele cdef np.ndarray outer = np.PyArray_EMPTY(1, dims, objtypecode, 0) cdef PyObject* outerobj = outer # borrow ref @@ -435,21 +458,30 @@ cdef enum LeafShapeType: FIXED_LENGTH_ARRAY = 3 -cdef Converter* get_converter(TLeaf* leaf): +cdef Converter* get_converter(TLeaf* leaf, char type_code): # Find existing converter or attempt to create a new one cdef Converter* conv cdef Converter* basic_conv cdef TLeaf* leaf_count = leaf.GetLeafCount() cdef LeafShapeType leaf_shape_type = SINGLE_VALUE cdef SIZE_t* dims - cdef int ndim, idim + cdef int ndim, idim, leaf_length leaf_name = leaf.GetName() leaf_title = leaf.GetTitle() leaf_type = resolve_type(leaf.GetTypeName()) - leaf_shape = () + + # Special case for null-terminated char array string + if type_code == 'C': + leaf_length = leaf.GetLenStatic() + conv = find_converter_by_typename(leaf_type + '[{0:d}]/C'.format(leaf_length)) + if conv == NULL: + conv = new CharArrayConverter(leaf_length - 1) # exclude null-termination + CONVERTERS.insert(CONVERTERS_ITEM(leaf_type + '[{0:d}]/C'.format(leaf_length), conv)) + return conv # Determine shape of this leaf + leaf_shape = () match = re.match(LEAF_PATTERN, leaf_title) if match is not None: arraydef = match.group(1) @@ -478,6 +510,8 @@ cdef Converter* get_converter(TLeaf* leaf): return NULL ndim = len(leaf_shape) + 1 dims = malloc(ndim * sizeof(SIZE_t)) + if dims == NULL: + raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) for idim from 1 <= idim < ndim: dims[idim] = leaf_shape[idim - 1] conv = new VaryArrayConverter( @@ -505,3 +539,96 @@ def cleanup(): while it != CONVERTERS.end(): del deref(it).second inc(it) + + +#################################### +# array -> TTree conversion follows: +#################################### + +cdef cppclass NP2ROOTConverter: + + void fill_from(void* source): + pass + + __dealloc__(): + pass + + +cdef cppclass FixedNP2ROOTConverter(NP2ROOTConverter): + int nbytes + void* value + TBranch* branch + + __init__(TTree* tree, string name, string roottype, + int length, int elembytes, + int ndim=0, SIZE_t* dims=NULL): + cdef string leaflist + cdef int axis + this.nbytes = length * elembytes + if roottype.compare('C') == 0: + # include null-termination + this.value = malloc(nbytes + 1) + if this.value == NULL: + raise MemoryError("could not allocate %d bytes" % (nbytes + 1)) + ( this.value)[nbytes] = '\0' + else: + this.value = malloc(nbytes) + if this.value == NULL: + raise MemoryError("could not allocate %d bytes" % nbytes) + # Construct leaflist name + leaflist = name + if ndim > 0 and roottype.compare('C') != 0: + for axis in range(ndim): + token = ('[{0:d}]'.format(dims[axis])).encode('utf-8') + leaflist.append( token) + leaflist.append(b'/') + leaflist.append(roottype) + this.branch = tree.GetBranch(name.c_str()) + if this.branch == NULL: + this.branch = tree.Branch(name.c_str(), this.value, leaflist.c_str()) + else: + # check type compatibility of existing branch + if leaflist.compare(string(this.branch.GetTitle())) != 0: + raise TypeError( + "field '{0}' of type '{1}' is not compatible " + "with existing branch of type '{2}'".format( + name, leaflist, str(this.branch.GetTitle()))) + this.branch.SetAddress(this.value) + this.branch.SetStatus(1) + + __del__(self): + free(this.value) + + void fill_from(void* source): + memcpy(this.value, source, this.nbytes) + this.branch.Fill() + + +cdef NP2ROOTConverter* find_np2root_converter(TTree* tree, name, dtype): + # TODO: + # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. + # Handle np.object (array) columns + cdef NP2ROOTConverter* conv = NULL + cdef int axis, ndim = 0 + cdef int length = 1 + cdef SIZE_t* dims = NULL + subdtype = dtype.subdtype + if subdtype is not None: + # Fixed-size subarray type + dtype, shape = subdtype + ndim = len(shape) + dims = malloc(ndim * sizeof(SIZE_t)) + if dims == NULL: + raise MemoryError("could not allocate %d bytes" % (ndim * sizeof(SIZE_t))) + for axis in range(ndim): + dims[axis] = shape[axis] + length *= dims[axis] + if dtype in TYPES_NUMPY2ROOT: + elembytes, roottype = TYPES_NUMPY2ROOT[dtype] + conv = new FixedNP2ROOTConverter(tree, name, roottype, length, elembytes, ndim, dims) + elif dtype.kind == 'S': + conv = new FixedNP2ROOTConverter(tree, name, 'C', dtype.itemsize, 1) + else: + warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) + free(dims) + return conv diff --git a/root_numpy/src/setup.pxi b/root_numpy/src/setup.pxi index c5eeabf..40b9fb1 100644 --- a/root_numpy/src/setup.pxi +++ b/root_numpy/src/setup.pxi @@ -21,7 +21,7 @@ from libcpp.vector cimport vector from libcpp.map cimport map as cpp_map from libcpp.pair cimport pair from libcpp.string cimport string, const_char -from libc.string cimport memcpy +from libc.string cimport memcpy, memset, strlen from libc.stdlib cimport malloc, free, realloc try: diff --git a/root_numpy/src/tree.pyx b/root_numpy/src/tree.pyx index 83a2485..cabce98 100644 --- a/root_numpy/src/tree.pyx +++ b/root_numpy/src/tree.pyx @@ -150,6 +150,9 @@ cdef object tree2array(TTree* tree, branches, string selection, cdef string column_name cdef const_char* branch_name cdef const_char* leaf_name + cdef string branch_title + cdef int branch_title_size + cdef char type_code if num_requested_branches > 0: columns.reserve(num_requested_branches) @@ -191,13 +194,19 @@ cdef object tree2array(TTree* tree, branches, string selection, # This branch was not selected by the user continue + branch_title = string(tbranch.GetTitle()) + branch_title_size = branch_title.size() + if branch_title_size > 2 and branch_title[branch_title_size - 2] == '/': + type_code = branch_title[branch_title_size - 1] + else: + type_code = '\0' leaf_array = tbranch.GetListOfLeaves() shortname = leaf_array.GetEntries() == 1 for ileaf in range(leaf_array.GetEntries()): tleaf = leaf_array.At(ileaf) leaf_name = tleaf.GetName() - conv = get_converter(tleaf) + conv = get_converter(tleaf, type_code) if conv != NULL: # A converter exists for this leaf column_name = string(branch_name) @@ -361,68 +370,8 @@ def root2array_fromCObj(tree, branches, selection, include_weight, weight_name) -#################################### -# array -> TTree conversion follows: -#################################### - -cdef cppclass NP2CConverter: - - void fill_from(void* source): - pass - - __dealloc__(): - pass - - -cdef cppclass ScalarNP2CConverter(NP2CConverter): - int nbytes - string roottype - string name - void* value - TBranch* branch - - __init__(TTree* tree, string name, string roottype, int nbytes): - cdef string leaflist - this.nbytes = nbytes - this.roottype = roottype - this.name = name - this.value = malloc(nbytes) - this.branch = tree.GetBranch(this.name.c_str()) - if this.branch == NULL: - leaflist = this.name + '/' + this.roottype - this.branch = tree.Branch(this.name.c_str(), this.value, leaflist.c_str()) - else: - # check type compatibility of existing branch - existing_type = this.branch.GetTitle().rpartition('/')[-1] - if str(roottype) != existing_type: - raise TypeError( - "field '{0}' of type '{1}' is not compatible " - "with existing branch of type '{2}'".format( - name, roottype, existing_type)) - this.branch.SetAddress(this.value) - this.branch.SetStatus(1) - - __del__(self): # does this do what I want? - free(this.value) - - void fill_from(void* source): - memcpy(this.value, source, this.nbytes) - this.branch.Fill() - - -cdef NP2CConverter* find_np2c_converter(TTree* tree, name, dtype): - # TODO: - # np.float16 needs special treatment. ROOT doesn't support 16-bit floats. - # Handle np.object (array) columns - if dtype in TYPES_NUMPY2ROOT: - nbytes, roottype = TYPES_NUMPY2ROOT[dtype] - return new ScalarNP2CConverter(tree, name, roottype, nbytes) - warnings.warn("converter for {!r} is not implemented (skipping)".format(dtype)) - return NULL - - cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) except *: - cdef vector[NP2CConverter*] converters + cdef vector[NP2ROOTConverter*] converters cdef vector[int] posarray cdef vector[int] roffsetarray cdef unsigned int icv @@ -441,18 +390,18 @@ cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) exc fieldnames = arr.dtype.names fields = arr.dtype.fields - # determine the structure + # Determine the structure for icol in range(len(fieldnames)): fieldname = fieldnames[icol] # roffset is an offset of particular field in each record dtype, roffset = fields[fieldname] - cvt = find_np2c_converter(tree, fieldname, dtype) + cvt = find_np2root_converter(tree, fieldname, dtype) if cvt != NULL: roffsetarray.push_back(roffset) converters.push_back(cvt) posarray.push_back(icol) - # fill in data + # Fill the data pos_len = posarray.size() for idata in range(arr_len): thisrow = np.PyArray_GETPTR1(arr, idata) @@ -461,7 +410,7 @@ cdef TTree* array2tree(np.ndarray arr, string name='tree', TTree* tree=NULL) exc source = shift(thisrow, roffset) converters[ipos].fill_from(source) - # need to update the number of entries in the tree to match + # Need to update the number of entries in the tree to match # the number in the branches since each branch is filled separately. tree.SetEntries(-1) diff --git a/root_numpy/src/util.h b/root_numpy/src/util.h index 6550355..366d4a7 100644 --- a/root_numpy/src/util.h +++ b/root_numpy/src/util.h @@ -20,7 +20,8 @@ inline std::string format(const char* fmt, ...) if(size<=nsize) { // Delete buffer and try again - delete buffer; buffer = 0; + delete buffer; + buffer = 0; buffer = new char[nsize + 1]; // +1 for /0 nsize = vsnprintf(buffer, size, fmt, vl); } @@ -44,21 +45,23 @@ inline void printaddr(void* v) template class TypeName { public: - TypeName(): - name(typeid(T).name()) - {} - const char* name; + TypeName(): + name(typeid(T).name()) + {} + + const char* name; }; // Workaround Cython's lack of template and pointer deref template class Vector2Array { public: - inline T* convert(std::vector* v) - { - return v->size() > 0 ? &((*v)[0]) : NULL; - } + + inline T* convert(std::vector* v) + { + return v->size() > 0 ? &((*v)[0]) : NULL; + } }; #endif diff --git a/root_numpy/tests.py b/root_numpy/tests.py index 2b5bd3f..a485456 100644 --- a/root_numpy/tests.py +++ b/root_numpy/tests.py @@ -2,6 +2,7 @@ from os.path import dirname, join import tempfile import warnings +from contextlib import contextmanager import numpy as np from numpy.lib import recfunctions @@ -42,6 +43,16 @@ def load(data): return get_filepath(data) +@contextmanager +def temp(): + tmp_fd, tmp_path = tempfile.mkstemp(suffix='.root') + tmp_root = ROOT.TFile.Open(tmp_path, 'recreate') + yield tmp_root + tmp_root.Close() + os.close(tmp_fd) + os.remove(tmp_path) + + def check_single(single, n=100, offset=1): assert_equal( single.dtype, @@ -95,7 +106,7 @@ def test_single(): @raises(IOError) def test_single_pattern_not_exist(): - f = load(['single1.root','does_not_exist.root']) + f = load(['single1.root', 'does_not_exist.root']) a = rnp.root2array(f) @@ -105,10 +116,9 @@ def test_no_filename(): def test_no_trees_in_file(): - f = ROOT.TFile.Open('temp_file.root', 'recreate') - f.Close() - assert_raises(IOError, rnp.root2array, ['temp_file.root'], treename=None) - os.remove('temp_file.root') + with temp() as tmp: + tmp.Close() + assert_raises(IOError, rnp.root2array, [tmp.GetName()], treename=None) @raises(IOError) @@ -703,20 +713,39 @@ def test_array2tree(): ('y', np.float32), ('z', np.float64), ('w', np.bool)]) - tmp = ROOT.TFile.Open('test_array2tree_temp_file.root', 'recreate') - tree = rnp.array2tree(a) - a_conv = rnp.tree2array(tree) - assert_array_equal(a, a_conv) - # extend the tree - tree2 = rnp.array2tree(a, tree=tree) - assert_equal(tree2.GetEntries(), len(a) * 2) - a_conv2 = rnp.tree2array(tree2) - assert_array_equal(np.hstack([a, a]), a_conv2) - tmp.Close() - os.remove(tmp.GetName()) + + with temp() as tmp: + tree = rnp.array2tree(a) + a_conv = rnp.tree2array(tree) + assert_array_equal(a, a_conv) + # extend the tree + tree2 = rnp.array2tree(a, tree=tree) + assert_equal(tree2.GetEntries(), len(a) * 2) + a_conv2 = rnp.tree2array(tree2) + assert_array_equal(np.hstack([a, a]), a_conv2) + assert_raises(TypeError, rnp.array2tree, a, tree=object) +def test_array2tree_charstar(): + a = np.array([b'', b'a', b'ab', b'abc', b'xyz', b''], + dtype=[('string', 'S3')]) + + with temp() as tmp: + rnp.array2root(a, tmp.GetName(), mode='recreate') + a_conv = rnp.root2array(tmp.GetName()) + assert_array_equal(a, a_conv) + + +def test_array2tree_fixed_length_arrays(): + f = load(['fixed1.root', 'fixed2.root']) + a = rnp.root2array(f) + with temp() as tmp: + rnp.array2root(a, tmp.GetName(), mode='recreate') + a_conv = rnp.root2array(tmp.GetName()) + assert_array_equal(a, a_conv) + + def test_array2root(): a = np.array([ (12345, 2., 2.1, True), @@ -726,16 +755,14 @@ def test_array2root(): ('y', np.float32), ('z', np.float64), ('w', np.bool)]) - tmp_fd, tmp_path = tempfile.mkstemp(suffix='.root') - rnp.array2root(a, tmp_path, mode='recreate') - a_conv = rnp.root2array(tmp_path) - assert_array_equal(a, a_conv) - # extend the tree - rnp.array2root(a, tmp_path, mode='update') - a_conv2 = rnp.root2array(tmp_path) - assert_array_equal(np.hstack([a, a]), a_conv2) - os.close(tmp_fd) - os.remove(tmp_path) + with temp() as tmp: + rnp.array2root(a, tmp.GetName(), mode='recreate') + a_conv = rnp.root2array(tmp.GetName()) + assert_array_equal(a, a_conv) + # extend the tree + rnp.array2root(a, tmp.GetName(), mode='update') + a_conv2 = rnp.root2array(tmp.GetName()) + assert_array_equal(np.hstack([a, a]), a_conv2) def check_random_sample(obj):