Skip to content

Commit

Permalink
1. add a kind of replacement of ROOT.RooAbsCollection.assign for o…
Browse files Browse the repository at this point in the history
…ld versions of ROOT
  • Loading branch information
VanyaBelyaev committed Oct 8, 2024
1 parent 4f256fc commit 21f3d5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions ReleaseNotes/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
1. add parallelisaiton for GoF permutations and toys
1. implement tests for USTAT & DNN
1. prepend the default progress-bar for trees/datasets/frames with `Entries:`
1. add a kind of replacement of `ROOT.RooAbsCollection.assign` for old versions of ROOT

## Backward incompatible

Expand Down
10 changes: 7 additions & 3 deletions ostap/fitting/roocollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,11 @@ def __exit__ ( self , *_ ) :
##
self.__old_list = None


# =============================================================================
## attention
if root_info < (6,26) and not hasattr ( ROOT.RooAbsCollection , 'assign' ) :
## attention !!!
ROOT.RooAbsCollection.assign = ROOT.RooAbsCollection.assignValueOnly

# =============================================================================
__item_store = set()
Expand All @@ -663,13 +667,13 @@ def _rac_factory ( klass , *args ) :
# =============================================================================
## reduce `RooArgList`
def _ral_reduce_ ( rac ) :
"""Reduce `RooArgList` instances"""
""" Reduce `RooArgList` instances"""
return _rac_factory, ( ROOT.RooArgList, ) + tuple ( a for a in rac )

# =============================================================================
## reduce `RooArgSet`
def _ras_reduce_ ( rac ) :
"""Reduce `RooArgSet` instances"""
""" Reduce `RooArgSet` instances"""
return _rac_factory, ( ROOT.RooArgSet, ) + tuple ( a for a in rac )

ROOT.RooArgSet .__reduce__ = _ras_reduce_
Expand Down

0 comments on commit 21f3d5f

Please sign in to comment.