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

hyperactive.dashboard.dashboard.Dashboard.open()   A

Complexity

Conditions 1

Size

Total Lines 24
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 19
nop 2
dl 0
loc 24
rs 9.45
c 0
b 0
f 0
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