1515
1616import numpy as np
1717from collections .abc import Iterable
18+ from smodels .statistics .basicStats import observed , apriori , aposteriori , NllEvalType
1819from functools import lru_cache , wraps
1920
2021def roundObj (obj , digits : int ):
@@ -63,13 +64,13 @@ class TestCase:
6364 def __init__ ( self ):
6465 self .bla = 0
6566 @roundCache (argname = 'mu' ,argpos = 1 ,digits = 5 )
66- def myfunc ( self , mu : float = 0. , expected : Union [ Text , bool ] = False ,
67+ def myfunc ( self , mu : float = 0. , expected : NllEvalType = observed ,
6768 asimov : Union [None ,float ] = None ):
6869 print ( "calling myfunc" )
6970 ret = mu
70- if expected == True :
71+ if expected == apriori :
7172 ret += 10.
72- if expected == "posteriori" :
73+ if expected == aposteriori :
7374 ret += 20.
7475 if asimov != None :
7576 ret += 1000. * (asimov + 1000. )
@@ -83,7 +84,7 @@ def myfunc ( self, mu : float = 0., expected : Union[Text,bool] = False,
8384 print ( test .myfunc ( 1. ) )
8485 print ( test .myfunc ( mu = 1. ) )
8586 print ( test .myfunc ( mu = 1. ) )
86- print ( test .myfunc ( 1. ,expected = True , asimov = 0. ) )
87- print ( test .myfunc ( 1. ,expected = True , asimov = 0. ) )
88- print ( test .myfunc ( 1. ,True , asimov = 0. ) )
89- print ( test .myfunc ( 1. ,True , asimov = 0. ) )
87+ print ( test .myfunc ( 1. ,expected = apriori , asimov = 0. ) )
88+ print ( test .myfunc ( 1. ,expected = apriori , asimov = 0. ) )
89+ print ( test .myfunc ( 1. ,apriori , asimov = 0. ) )
90+ print ( test .myfunc ( 1. ,apriori , asimov = 0. ) )
0 commit comments