From 5f6f961c031285a3c5c408afcfec5a0eca8f176b Mon Sep 17 00:00:00 2001 From: Vanya Belyaev Date: Wed, 24 Apr 2024 15:50:57 +0200 Subject: [PATCH] fix ? --- ostap/parallel/parallel_statvar.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ostap/parallel/parallel_statvar.py b/ostap/parallel/parallel_statvar.py index 393b8418..d0758acd 100644 --- a/ostap/parallel/parallel_statvar.py +++ b/ostap/parallel/parallel_statvar.py @@ -18,6 +18,7 @@ # ============================================================================= from ostap.parallel.parallel import Task, WorkManager from ostap.core.core import VE +from ostap.core.meta_info import root_info, python_info import ROOT # ============================================================================= # logging @@ -126,16 +127,20 @@ def pStatVar ( chain , """ ## few special/trivial cases - last = min ( n_large , first + nevents if 0 < nevents else n_large ) + from ostap.trees.trees import _stat_vars_ + last = min ( n_large , first + nevents if 0 < nevents else n_large ) + if 0 <= first and 0 < nevents < chunk_size : return chain.statVar ( what , cuts , first , last ) elif isinstance ( chain , ROOT.TChain ) : if 1 == chain.nFiles() and len ( chain ) < chunk_size : return chain.statVar ( what , cuts , first , last ) elif isinstance ( chain , ROOT.TTree ) and len ( chain ) < chunk_size : - return chain.statVar ( what , cuts , first , last ) - + return chain.statVar ( what , cuts , first , last ) + elif ( 6 , 18 ) <= root_info < ( 6 , 19 ) and python_info < ( 3 , 0 ) : + return chain.statVar ( what , cuts , first , last ) + from ostap.trees.trees import Chain ch = Chain ( chain , first = first , nevents = nevents )