From 45fdf3e619311c067386667616ac9679de02f70f Mon Sep 17 00:00:00 2001 From: Vanya Belyaev Date: Tue, 14 Jan 2025 10:24:54 +0100 Subject: [PATCH] remove priints --- ostap/fitting/fithelpers.py | 8 ++------ ostap/fitting/pdfbasic.py | 4 ---- ostap/utils/memory.py | 6 +++--- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ostap/fitting/fithelpers.py b/ostap/fitting/fithelpers.py index fcc04260..98ec1f44 100644 --- a/ostap/fitting/fithelpers.py +++ b/ostap/fitting/fithelpers.py @@ -2254,22 +2254,18 @@ def gen_sample ( self , nEvents , sample = True ) : >>> n = pdf.gen_sample ( VE ( 10 , 3 ) ) ## get gaussian stuff """ - print ( 'gen-sample/0' , nEvents, sample ) if isinstance ( nEvents , integer_types ) and 0 < nEvents and not sample : - print ( 'gen-sample/1' , nEvents, sample ) return nEvents elif isinstance ( nEvents , num_types ) and 0 < nEvents : - print ( 'gen-sample/2' , nEvents, sample ) nn = -1 while nn <= 0 : nn = poisson ( float ( nEvents ) ) return nn - elif isinstance ( nEvents , VE ) and 0 < nEvents.cov2 () and 0 < nEvents.value() + 3 * nEvents.error () : - print ( 'gen-sample/3' , nEvents, sample ) + elif isinstance ( nEvents , VE ) and 0 < nEvents.cov2 () : nn = -1 while nn <= 0 : mu = ve_gauss ( nEvents ) if 0 < mu : nn = poisson ( mu ) - return max ( 1 , int ( nn ) ) + return nn raise TypeError ( "Can't generate positive number from %s/%s" % ( nEvents , typename ( nEvents ) ) ) diff --git a/ostap/fitting/pdfbasic.py b/ostap/fitting/pdfbasic.py index 0743db42..a297cdfe 100644 --- a/ostap/fitting/pdfbasic.py +++ b/ostap/fitting/pdfbasic.py @@ -1961,14 +1961,10 @@ def generate ( self , >>> data = model.generate ( 100000 , varset , sample = True ) """ - print ( 'GENERATE/0:' , nEvents ) - ## sample number of events in dataset ? nEvents = self.gen_sample ( nEvents , sample ) assert 0 <= nEvents , 'Invalid number of Events %s' % nEvents - print ( 'GENERATE/1:' , nEvents ) - args = args + ( ROOT.RooFit.Name ( dsID() ) , ROOT.RooFit.NumEvents ( nEvents ) ) if silent : args = args + ( ROOT.RooFit.Verbose ( False ) , ) diff --git a/ostap/utils/memory.py b/ostap/utils/memory.py index a3f56d37..0e4fdb0d 100755 --- a/ostap/utils/memory.py +++ b/ostap/utils/memory.py @@ -36,7 +36,7 @@ if 2 < python_version.major : LONG = int else : LONG = long # ============================================================================= -try : +try : # ======================================================================= # ========================================================================= import psutil # ========================================================================= @@ -57,12 +57,12 @@ def memory_usage ( *args ): mem += p.memory_info()[0] / float( 2 ** 20 ) return mem # ========================================================================= -except ImportError : +except ImportError : # ======================================================== # ========================================================================= psutil = None # ========================================================================= ## report current memory usage (in MB) - # @attention it is ps-based version, slow... :-( + # @attention it is ps-based version, it can be slow... :-( # @code # print memory_usage() # @endcode