From 4e2743d84520bbf14416a8deb3cf5db5a0e65cf4 Mon Sep 17 00:00:00 2001 From: Vanya Belyaev Date: Fri, 29 Mar 2024 08:48:30 +0100 Subject: [PATCH] fix for 6.20 --- ostap/stats/moment.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ostap/stats/moment.py b/ostap/stats/moment.py index 2729c500..4f1b2cb6 100644 --- a/ostap/stats/moment.py +++ b/ostap/stats/moment.py @@ -218,10 +218,11 @@ def _om_cm2 ( obj , order ) : def _om_cm2 ( obj , order ) : assert isinstance ( order , integer_types ) and order <= obj.order ,\ 'central_moment: invalid order %s/%d' % ( order , obj.order ) - if 2 <= order and obj.empty() : return neg_infinity - T = Ostap.Math.Moments._central_moment_2 [ order , obj.order ] - M = Ostap.Math.Moments() - return T ( M , obj ) + if 2 <= order and obj.empty() : return neg_infinity + return obj.moment ( order ) + ## T = Ostap.Math.Moments._central_moment_2 [ order , obj.order ] + ## M = Ostap.Math.Moments() + ## return T ( M , obj ) ## elif ( 6 , 18 ) <= root_info : ## @@ -314,10 +315,11 @@ def _om_cm3 ( obj , order ) : assert isinstance ( order , integer_types ) and order <= obj.order ,\ 'central_moment: invalid order %s/%d' % ( order , obj.order ) if 2 <= order and not obj.ok () : return neg_infinity + return obj.moment ( order ) ## - T = Ostap.Math.Moments._central_moment_3 [ order , obj.order ] - M = Ostap.Math.Moments () - return T ( M , obj ) + ## T = Ostap.Math.Moments._central_moment_3 [ order , obj.order ] + ## M = Ostap.Math.Moments () + ## return T ( M , obj ) ## elif ( 6 , 18 ) <= root_info : ##