Passed
Pull Request — master (#101)
by Simon
01:18
created

search_space_optional.SearchSpace.__call__()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
import numpy as np
2
from hyperactive import BaseSearchSpace
3
4
5
"""
6
Optional:
7
8
It might make sense to use a class instead of a dictionary for the search-space.
9
The search-space can have specifc properties, that can be computed from the params (previously called search-space-dictionary).
10
The search-space can have a certain size, has n dimensions, some of which are numeric, some of which are categorical.
11
"""
12
13
14
class SearchSpace:
15
    search_space: dict = None
16
17
    def __init__(self, **params):
18
        super().__init__()
19
20
        for key, value in params.items():
21
            setattr(self, key, value)
22
            self.search_space[key] = value
23
24
    def __call__(self):
25
        return self.search_space
26