diff --git a/ReleaseNotes/release_notes.md b/ReleaseNotes/release_notes.md index 5393e905..d648a655 100644 --- a/ReleaseNotes/release_notes.md +++ b/ReleaseNotes/release_notes.md @@ -5,6 +5,7 @@ 1. add possibility to add separator line to `summary_graphs` 1. fix for new ROOT>6.31 few issues with std::string <--> const char* 1. imporve a bit BLUE + 1. add "fix" for new pyROOT/cppyy for failure with ickling of enums ## Backward incompatible diff --git a/ostap/tools/chopping.py b/ostap/tools/chopping.py index cb5e530e..a8b1bbab 100644 --- a/ostap/tools/chopping.py +++ b/ostap/tools/chopping.py @@ -582,6 +582,17 @@ def __init__ ( self , from ostap.trees.trees import Chain if isinstance ( self.__signal , ROOT.TTree ) : self.__signal = Chain ( self.__signal ) if isinstance ( self.__background , ROOT.TTree ) : self.__background = Chain ( self.__background ) + + ## trick to pleas Kisa for ROTO 6.31/01 (enum TMVA.Types.ETMVA is not pickable... + if ( 6, 31 ) <= root_info : + ms = list ( self.__methods ) + for i, e in enumerate ( ms ) : + e = list ( e ) + e = tuple ( [ int ( e[0] ) ] + e[1:]) + ms [ i ] = e + self.__methods = ms + + ## book the trainers self.__trainers = () diff --git a/ostap/tools/tests/test_tools_chopping.py b/ostap/tools/tests/test_tools_chopping.py index 70bda0c8..ee26c6a6 100755 --- a/ostap/tools/tests/test_tools_chopping.py +++ b/ostap/tools/tests/test_tools_chopping.py @@ -171,6 +171,7 @@ ## parallel_conf = { 'ncpus' : 0 , 'ppservers' : 'auto' } ) + # train it! with timing ( 'for TMVA/Chopping training' , logger ) : trainer.train () @@ -344,7 +345,7 @@ table = T.table ( rows , title = title , prefix = '# ' , alignment = 'cc' ) logger.info ( '%s\n%s' % ( title , table ) ) - + # ============================================================================= ## The END diff --git a/ostap/tools/tmva.py b/ostap/tools/tmva.py index 7fdf68fe..d9c1aa62 100755 --- a/ostap/tools/tmva.py +++ b/ostap/tools/tmva.py @@ -373,6 +373,13 @@ def __init__( self , if isinstance ( logging , string_types ) : self.__logging = logging else : self.__logging = "%s.log" % self.name + + + for i , e in enumerate ( methods ) : + t = e [ 0 ] + assert ROOT.TMVA.Types.kVariable <= t < ROOT.TMVA.Types.kMaxMethod, \ + 'Invalid TMVA.Types.EMVA %s' % t + self.__methods = tuple ( methods ) variables = list ( variables )