From 0aeb1517eff4d31cbab38d23b926dfbc49b288dc Mon Sep 17 00:00:00 2001 From: Vanya Belyaev Date: Wed, 18 Sep 2024 10:30:05 +0200 Subject: [PATCH] fix ? --- ostap/stats/gof1d.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ostap/stats/gof1d.py b/ostap/stats/gof1d.py index c444188a..92ca2162 100644 --- a/ostap/stats/gof1d.py +++ b/ostap/stats/gof1d.py @@ -41,6 +41,9 @@ # ============================================================================= logger.debug ( 'Simple utilities for goodness-of-1D-fit studies' ) # ============================================================================= +if ( 6 , 32 ) <= root_info : data2vct = lambda s : s +else : data2vct = lambda s : doubles ( s ) +# ============================================================================= ## Get Kolmogorov-Smirnov statistis KS # @code # cdf_data =... @@ -189,9 +192,9 @@ def __init__ ( self , ## sorted data self.__data = np.sort ( data ) - + ## empirical CDF function - self.__ecdf = Ostap.Math.ECDF ( self.__data ) + self.__ecdf = Ostap.Math.ECDF ( data2vct ( self.__data ) ) ## evalute CDF for sorted data self.__cdf_data = vct_cdf ( self.__data ) @@ -474,7 +477,7 @@ def run ( self , nToys = 1000 , silent = False ) : data = results [ key ] if not data : continue if not key in self.__ecdfs : self.__ecdfs [ key ] = ECDF ( data , True ) ## complementary ECDF! - else : self.__ecdfs [ key ] .add ( doubles ( data ) ) + else : self.__ecdfs [ key ] .add ( data2vct ( data ) ) del results