Completed
Push — master ( 77ef8d...d45822 )
by Simon
02:00
created

hyperactive.memory.paths   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 5

5 Functions

Rating   Name   Duplication   Size   Complexity  
A get_meta_path() 0 3 1
A get_date_path() 0 2 1
A get_meta_data_name() 0 5 1
A get_model_path() 0 2 1
A get_datetime() 0 2 1
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import os
6
import datetime
7
8
from .util import get_hash
9
10
11
def get_meta_path():
12
    current_path = os.path.realpath(__file__)
13
    return current_path.rsplit("/", 1)[0] + "/meta_data/"
14
15
16
def get_model_path(model_id):
17
    return "model_id:" + model_id + "/"
18
19
20
def get_date_path(datetime):
21
    return "run_data/" + datetime + "/"
22
23
24
def get_datetime():
25
    return datetime.datetime.now().strftime("%d.%m.%Y - %H:%M:%S")
26
27
28
def get_meta_data_name(X, y):
29
    feature_hash = get_hash(X)
30
    label_hash = get_hash(y)
31
32
    return "dataset_id:" + feature_hash + "_" + label_hash + "_.csv"
33