Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Dec 5, 2023
1 parent 5f7e72f commit 5900819
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions ostap/fitting/ds2numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@


# =============================================================================
if np and ( 6 , 26 ) <= root_info : ## 6.26 <= ROOT
if np and ( 6 , 28 ) <= root_info : ## 6.26 <= ROOT
# =============================================================================

# =========================================================================
Expand Down Expand Up @@ -98,14 +98,15 @@ def ds2numpy ( dataset , var_lst , silent = True ) :

## 5) convert to VectorStore again...
# batches are not (yet) implemented for Tree & Composite stores
store = dataset.store()
source = dataset
twoargs = False
store = dataset.store()
source = dataset
twoargs = False
delsource = False
if not isinstance ( store , ROOT.RooVectorDataStore ) :
source = ROOT.RooVectorDataStore ( store , dataset.get() , store.name + '_vct' )
twoargs = True


source = ROOT.RooVectorDataStore ( store , dataset.get() , store.name + '_vct' )
twoargs = True
delsource = True
vars = source.get()
vars = [ v for v in vars if v.name in vnames ]
doubles = [ v.name for v in vars if isinstance ( v , ROOT.RooAbsReal ) ]
Expand Down Expand Up @@ -166,7 +167,7 @@ def ds2numpy ( dataset , var_lst , silent = True ) :
data = np.concatenate ( [ data , part ] )
del part

if not source is dataset :
if delsource :
source.reset()
del source

Expand Down

0 comments on commit 5900819

Please sign in to comment.