Passed
Push — master ( d5b48a...5a31d8 )
by Simon
01:07
created

MemoryIO.__init__()   A

Complexity

Conditions 2

Size

Total Lines 24
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 24
rs 9.55
c 0
b 0
f 0
cc 2
nop 3
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import os
6
7
from .utils import get_datetime, model_id, _hash2obj
8
from .utils import (
9
    model_path,
10
    date_path,
11
    meta_data_name,
12
)
13
14
from .paths import _paths_
15
16
17
class MemoryIO:
18
    def __init__(self, *args, **kwargs):
19
        self.X = X
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable X does not seem to be defined.
Loading history...
20
        self.y = y
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable y does not seem to be defined.
Loading history...
21
        self.model = model
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable model does not seem to be defined.
Loading history...
22
        self.search_space = search_space
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable search_space does not seem to be defined.
Loading history...
23
24
        self.para_names = list(self.search_space.keys())
25
26
        self.meta_data_name = meta_data_name(X, y)
27
        self.score_col_name = ["score", "eval_time"]
28
29
        model_id_ = model_id(model)
30
        self.datetime = get_datetime()
31
32
        self.meta_path = _paths_["default"]
33
        self.model_path = self.meta_path + model_path(model_id_)
34
        self.date_path = self.model_path + date_path(self.datetime)
35
36
        self.dataset_info_path = self.model_path + "dataset_info/"
37
38
        if not os.path.exists(self.date_path):
39
            os.makedirs(self.date_path, exist_ok=True)
40
41
        self.hash2obj = _hash2obj(search_space, self.model_path)
42