Skip to content

Commit

Permalink
1. add more methods to Ostap::Math::ECDF got get the ranking
Browse files Browse the repository at this point in the history
  1. optimise `Ostap::Math::ECDF` and skip sorting when possible
  1. add `ostap.stats.twosamples.py` to make Two Sampel Tests
  1. add the test for Two Sample Test
  1. reduce code duplication between  GoF-1D and Two-Sample Tests
  • Loading branch information
VanyaBelyaev committed Oct 18, 2024
1 parent f8ff69c commit e40efb7
Show file tree
Hide file tree
Showing 9 changed files with 1,144 additions and 356 deletions.
8 changes: 7 additions & 1 deletion ReleaseNotes/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## New features


1. add more methods to `Ostap::Math::ECDF` got get the ranking
1. optimise `Ostap::Math::ECDF` and skip sorting when possible
1. add `ostap.stats.twosamples.py` to make Two Sampel Tests
1. add the test for Two Sample Test
1. reduce code duplication between GoF-1D and Two-Sample Tests

## Backward incompatible

## Bug fixes
Expand Down
12 changes: 8 additions & 4 deletions ostap/core/ostap_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,26 @@
if hasattr ( std , 'string' ) : string_types += ( std.string , )
if hasattr ( std , 'string_view' ) : string_types += ( std.string_view , )
# =============================================================================
try :
try : # =======================================================================
# =========================================================================
import numpy as np
listlike_types = listlike_types + ( np.ndarray , )
except ImportError :
listlike_types = listlike_types + ( np.ndarray , )
# =========================================================================
except ImportError : # ========================================================
# =========================================================================
pass
# =============================================================================
dict_types = dict ,
dictlike_types = dict , C.Mapping
sequence_types = listlike_types + ( Sequence , Collection , Iterable , Generator )
sized_types = Sized ,
path_types = string_types
# =============================================================================
if ( 3 , 6 ) <= python_version :
path_types = string_types + ( os.PathLike , )
# =============================================================================
## sometimes we need to ensure that dictionary is ordered
ordered_dict = dict
ordered_dict = dict
if python_version < ( 3 , 7 ) :
from collections import OrderedDict as ordered_dict
dictlike_types += ( ordered_dict, )
Expand Down
9 changes: 2 additions & 7 deletions ostap/fitting/fithelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def binning ( self , axis , name = '' ) :
args_timer = 'timer' , 'timing'
args_warnings = 'warnings' , 'warning'
args_sumw2 = 'sumw2' , 'sumw2err' , 'sumw2errs' , 'sumw2error' , 'sumw2errors'
args_asymptotic = ( 'asymptotic' , 'asymptorocerr' , 'asymptoticerrs' ,
args_asymptotic = ( 'asymptotic' , 'asymptoticcerr' , 'asymptoticerrs' ,
'asymptoticerror , asymptoticerrors' )
args_batch = 'batch' , 'batchmode' , 'modebatch'
args_backend = 'evalbackend' , 'backendeval' , 'backend'
Expand Down Expand Up @@ -777,12 +777,7 @@ def parse_args ( self , dataset = None , *args , **kwargs ) :

_args.append ( ROOT.RooFit.Extended ( a ) )

elif key in ( 'cpu' ,
'cpus' ,
'ncpu' ,
'ncpus' ,
'numcpu' ,
'numcpus' ) and isinstance ( a , int ) and 1<= a :
elif key in args_numcpu and isinstance ( a , int ) and 1<= a :

_args.append ( ROOT.RooFit.NumCPU( a ) )

Expand Down
Loading

0 comments on commit e40efb7

Please sign in to comment.