@@ -19,22 +19,32 @@ class BaseDomain(DomainInterface, metaclass=ABCMeta):
1919 # Define available sampling modes
2020 __AVAILABLE_MODES = ("random" , "grid" , "lh" , "chebyshev" , "latin" )
2121
22- def __init__ (self , domain_dict ):
22+ def __init__ (self , domain_dict = None ):
2323 """
2424 Initialization of the :class:`BaseDomain` class.
2525
26- :param dict domain_dict: A dictionary where the keys are the variable
26+ :param domain_dict: A dictionary where the keys are the variable
2727 names and the values are the domain extrema. The domain extrema can
2828 be either a list or tuple with two elements or a single number. If
2929 the domain extrema is a single number, the variable is fixed to that
3030 value.
31+ :type domain_dict: dict | None
3132 :raises TypeError: If the domain dictionary is not a dictionary.
3233 :raises ValueError: If the domain dictionary is empty.
3334 :raises ValueError: If the domain dictionary contains variables with
3435 invalid ranges.
3536 :raises ValueError: If the domain dictionary contains values that are
3637 neither numbers nor lists/tuples of numbers of length 2.
3738 """
39+ # Initialize fixed and ranged variables
40+ self ._fixed = {}
41+ self ._range = {}
42+ invalid = []
43+
44+ # Skip checks if domain_dict is None -- SimplexDomain case
45+ if domain_dict is None :
46+ return
47+
3848 # Check domain_dict is a dictionary
3949 if not isinstance (domain_dict , dict ):
4050 raise TypeError (
@@ -51,11 +61,6 @@ def __init__(self, domain_dict):
5161 for v in domain_dict .values ():
5262 check_consistency (v , (int , float ))
5363
54- # Store
55- self ._fixed = {}
56- self ._range = {}
57- invalid = []
58-
5964 # Iterate over domain_dict items
6065 for k , v in domain_dict .items ():
6166
0 commit comments