in bayesmark/space.py [0:0]
def __init__(self, meta):
"""Build Real space class.
Parameters
----------
meta : dict(str, dict)
Configuration of variables in joint space. See API description.
"""
assert len(meta) > 0 # Unclear what to do with empty space
# Lock in an order if not ordered dict, sorted helps reproducibility
self.param_list = sorted(meta.keys())
# Might as well pre-validate a bit here
for param, config in meta.items():
assert config["type"] in SPACE_DICT, "invalid input type %s" % config["type"]
spaces = {
param: SPACE_DICT[config["type"]](
config.get("space", None), config.get("values", None), config.get("range", None)
)
for param, config in meta.items()
}
self.spaces = spaces
self.blocks = np.cumsum([len(spaces[param].get_bounds()) for param in self.param_list])