File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,6 +480,9 @@ class PowerLaw(Univariate):
480480 """
481481
482482 def __init__ (self , a : float = 0.0 , b : float = 1.0 , n : float = 0. ):
483+ if a >= b :
484+ raise ValueError (
485+ "Lower bound of sampling interval must be less than upper bound." )
483486 self .a = a
484487 self .b = b
485488 self .n = n
@@ -494,6 +497,9 @@ def a(self):
494497 @a .setter
495498 def a (self , a ):
496499 cv .check_type ('interval lower bound' , a , Real )
500+ if a < 0 :
501+ raise ValueError (
502+ "PowerLaw sampling is restricted to positive-valued intervals." )
497503 self ._a = a
498504
499505 @property
@@ -503,6 +509,9 @@ def b(self):
503509 @b .setter
504510 def b (self , b ):
505511 cv .check_type ('interval upper bound' , b , Real )
512+ if b < 0 :
513+ raise ValueError (
514+ "PowerLaw sampling is restricted to positive-valued intervals." )
506515 self ._b = b
507516
508517 @property
You can’t perform that action at this time.
0 commit comments