Passed
Push — master ( b8f359...927840 )
by Simon
03:10
created

hyperactive.dashboard.dashboard   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 24
dl 0
loc 44
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A Dashboard.__init__() 0 3 1
A Dashboard.open() 0 24 1
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import os
6
7
# from ..ltm_data_path import ltm_data_path
8
9
10
class Dashboard:
11
    def __init__(self, path):
12
        self.path = path
13
        """
14
        if path is None:
15
            self.ltm_data_dir = ltm_data_path()
16
        else:
17
            self.ltm_data_dir = path + "/ltm_data/"
18
        """
19
20
    def open(
21
        self,
22
        plots=[
23
            "score_statistics",
24
            "1d_scatter",
25
            "2d_scatter",
26
            "3d_scatter",
27
            "parallel_coordinates",
28
        ],
29
    ):
30
        abspath = os.path.abspath(__file__)
31
        dname = os.path.dirname(abspath)
32
33
        streamlit_plot_args = " ".join(plots)
34
35
        command = (
36
            "streamlit run "
37
            + dname
38
            + "/st_script.py "
39
            + self.path
40
            + " "
41
            + streamlit_plot_args
42
        )
43
        os.system(command)
44