Exemple #1
0
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        self.info_text = "select "

        titles_panel = tk.Frame(self)
        info = tk.Button(titles_panel,
                         text=" help ",
                         command=lambda: gui.show_info_box(self.info_text))
        title = tk.Label(titles_panel,
                         text="Select Actions",
                         font=controller.title_font)

        self.working_dir_el = self._create_working_dir_el(self)

        actions_panel = tk.LabelFrame(self, text="Actions")
        self.g = tk.BooleanVar()
        g_box = tk.Checkbutton(actions_panel,
                               text="(1) Generate Graph",
                               variable=self.g)
        self.s = tk.BooleanVar()
        s_box = tk.Checkbutton(actions_panel,
                               text="(2) Generate Train Test Split",
                               variable=self.s)
        self.e = tk.BooleanVar()
        e_box = tk.Checkbutton(actions_panel,
                               text="(3) Apply Testing and Evaluation",
                               variable=self.e)

        buttons_panel = tk.Frame(self)
        next_button = tk.Button(buttons_panel,
                                text="Next",
                                command=lambda: self.next_page(),
                                height=1,
                                width=15)

        titles_panel.pack(side="top", fill="x", pady=10)
        title.pack(side="left", pady=10, padx=15)
        info.pack(side="right", fill="x", pady=10, padx=15)
        self.working_dir_el.pack(side="top",
                                 fill="both",
                                 padx=15,
                                 pady=10,
                                 expand=True)
        actions_panel.pack(side="top",
                           fill="both",
                           expand=True,
                           anchor="w",
                           padx=15,
                           pady=10)
        g_box.pack(side="top", anchor="w", padx=20, pady=(20, 0))
        s_box.pack(side="top", anchor="w", padx=20, pady=(20, 0))
        e_box.pack(side="top", anchor="w", padx=20, pady=(20, 0))
        ttk.Separator(self, orient="horizontal").pack(side="top",
                                                      fill="x",
                                                      pady=(15, 0),
                                                      padx=10,
                                                      anchor="s")
        buttons_panel.pack(side="bottom", padx=15, fill="x")
        next_button.pack(side="right", anchor="e", pady=(5, 10))
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        self.info_text = ""
        self.db_cls_list = [x for x in utils.get_leaf_subclasses(DbMetadata)]
        self.edge_metadata_cls_list = [x for x in utils.get_leaf_subclasses(EdgeRegularMetadata)] + [
            x for x in utils.get_leaf_subclasses(EdgeOntoMetadata)
        ]
        self.db_cls_list.sort(key=lambda x: x.NAME)
        self.edge_metadata_cls_list.sort(key=lambda x: x.NAME)
        self.selected_dbs = None
        self.selected_meta_edges = None

        titles_panel = tk.Frame(self)
        self.info = tk.Button(titles_panel, text=" help ", command=lambda: gui.show_info_box(self.info_text))
        self.title = tk.Label(titles_panel, text="(1) Graph Creation", font=controller.title_font)

        self.actions_el = self._create_action_el(self)
        select_panel = tk.Frame(self)
        self.select_el = self._create_select_db_meta_edges_el(select_panel)

        options_panel = tk.Frame(self)
        self.graph_prop_el = self._create_graph_prop_el(options_panel)
        self.output_format_el = self._create_output_format_el(options_panel)

        buttons_panel = tk.Frame(self)
        next_button = tk.Button(buttons_panel, text="Next", command=lambda: self.next_page(), height=1, width=15)
        prev_button = tk.Button(
            buttons_panel, text="Back", command=lambda: self.controller.show_previous_frame(), height=1, width=15
        )

        titles_panel.pack(side="top", fill="x", pady=10)
        self.title.pack(side="left", pady=10, padx=15)
        self.info.pack(side="right", fill="x", pady=5, padx=15)
        self.actions_el.pack(side="top", fill="both", padx=15, pady=5, expand=True)
        select_panel.pack(side="top", fill="both", padx=10, pady=5, expand=True)
        self.select_el.pack(side="top", fill="both", padx=5, pady=10, expand=True)
        options_panel.pack(side="top", fill="both", padx=5, pady=5, expand=True)
        self.graph_prop_el.pack(side="left", fill="both", padx=10, expand=True)
        self.output_format_el.pack(side="left", fill="both", padx=10, expand=True)

        ttk.Separator(self, orient="horizontal").pack(side="top", fill="x", pady=(15, 0), padx=10, anchor="s")
        buttons_panel.pack(side="bottom", padx=15, fill="x")
        prev_button.pack(side="left", anchor="w", pady=(5, 10))
        next_button.pack(side="right", anchor="e", pady=(5, 10))
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        self.info_text = ""

        # title
        titles_panel = tk.Frame(self)
        self.info = tk.Button(titles_panel, text=" help ", command=lambda: gui.show_info_box(self.info_text))
        self.title = tk.Label(titles_panel, text="(3) Testing and Evaluation", font=controller.title_font)

        self.actions_el = self._create_action_el(self)

        threshold_metrics = [
            ThresholdMetricType[item] for item in dir(ThresholdMetricType) if not item.startswith("__")
        ]

        options_panel = tk.Frame(self)
        paths_box = tk.LabelFrame(options_panel, text="file paths")
        self.config_path_el = self._create_config_path_el(paths_box)
        self.train_file_el = self._create_train_path_el(paths_box)
        self.test_file_el = self._create_test_path_el(paths_box)
        self.trained_model_file_el = self._create_trained_model_path_el(paths_box)
        self.node_or_corrupted_file_el = self._create_nodes_or_corrupted_path_el(paths_box)

        self.metrics_box = tk.LabelFrame(options_panel, text="choose metrics")
        self.metrics_frame = tk.Frame(self.metrics_box)
        self.rank_metrics_dict = {}
        self.threshold_metrics_dict = {}

        self.hits_at_k_el = self._create_hits_at_k_el(self.metrics_frame)
        self.mrr_el = self._create_mrr_el(self.metrics_frame)
        self.hits_at_k_el.pack(side="top", fill="x", pady=(10, 5))
        self.mrr_el.pack(side="top", fill="x", pady=5)
        ttk.Separator(self.metrics_frame, orient="horizontal").pack(side="top", fill="x", pady=10, padx=10, anchor="s")
        for metric in threshold_metrics:
            self.threshold_metrics_dict[metric] = tk.BooleanVar(value=True)
            cb = tk.Checkbutton(self.metrics_frame, text=metric.value, variable=self.threshold_metrics_dict[metric])
            cb.pack(anchor="w", padx=5, pady=5)

        self.buttons_panel = tk.Frame(self)
        self.next_button = tk.Button(
            self.buttons_panel, text="Next", command=lambda: self.next_page(), height=1, width=15
        )
        self.prev_button = tk.Button(
            self.buttons_panel, text="Back", command=lambda: self.controller.show_previous_frame(), height=1, width=15
        )

        # packing
        titles_panel.pack(side="top", fill="x", pady=10)
        self.title.pack(side="left", pady=10, padx=15)
        self.info.pack(side="right", fill="x", pady=5, padx=15)
        self.actions_el.pack(side="top", fill="both", padx=15, pady=5, expand=True)

        options_panel.pack(side="top", fill="both", padx=15, pady=5, expand=True)
        self.metrics_box.pack(side="left", fill="both", expand=True, padx=(0, 5))
        self.metrics_frame.pack(side="top", fill="both", expand=True)
        paths_box.pack(side="left", fill="both", expand=True, padx=(5, 0))
        self.config_path_el.pack(side="top", fill="x")
        self.pack_file_paths()
        self.node_or_corrupted_file_el.pack(side="top", fill="x")

        ttk.Separator(self, orient="horizontal").pack(side="top", fill="x", pady=(15, 1), padx=10, anchor="s")
        self.buttons_panel.pack(side="bottom", padx=15, fill="x")
        self.prev_button.pack(side="left", anchor="w", pady=(5, 10))
        self.next_button.pack(side="right", anchor="e", pady=(5, 10))
Exemple #4
0
    def __init__(self, parent, controller):
        tk.Frame.__init__(self, parent)
        self.controller = controller
        self.info_text = ""
        titles_panel = tk.Frame(self)
        self.info = tk.Button(
            titles_panel,
            text=" help ",
            command=lambda: gui.show_info_box(self.info_text))
        self.title = tk.Label(titles_panel,
                              text="(2) Split Creation",
                              font=controller.title_font)

        self.mode_panel = self._create_mode_element(self)

        self.option_panel = tk.Frame(self)
        self.left_box = tk.LabelFrame(self.option_panel, text="graph files")
        self.file_edge_el = self._create_edge_path_el(self.left_box)
        self.file_tn_el = self._create_tn_path_el(self.left_box)
        self.file_nodes_el = self._create_nodes_path_el(self.left_box)
        self.right_box = tk.Frame(self.option_panel)
        self.right_rand_box = tk.LabelFrame(self.right_box,
                                            text="parameter for random split")
        self.rand_box_el = self._create_rand_options_el(self.right_rand_box)
        self.right_time_box = tk.LabelFrame(self.right_box,
                                            text="parameter for time slice")
        self.time_box_el = self._create_time_options_el(self.right_time_box)

        self.buttons_panel = tk.Frame(self)
        self.next_button = tk.Button(self.buttons_panel,
                                     text="Next",
                                     command=lambda: self.next_page(),
                                     height=1,
                                     width=15)
        self.prev_button = tk.Button(
            self.buttons_panel,
            text="Back",
            command=lambda: self.controller.show_previous_frame(),
            height=1,
            width=15)

        # packing
        titles_panel.pack(side="top", fill="x", pady=10)
        self.title.pack(side="left", pady=10, padx=15)
        self.info.pack(side="right", fill="x", pady=5, padx=15)
        self.mode_panel.pack(side="top", fill="both", padx=15, expand=True)
        self.option_panel.pack(side="top",
                               fill="both",
                               padx=15,
                               pady=10,
                               expand=True)
        self.left_box.pack(side="left", fill="both", expand=True)
        self.file_edge_el.pack(side="top",
                               fill="both",
                               padx=15,
                               pady=10,
                               expand=True)
        self.file_tn_el.pack(side="top",
                             fill="both",
                             padx=15,
                             pady=10,
                             expand=True)
        self.file_nodes_el.pack(side="top",
                                fill="both",
                                padx=15,
                                pady=10,
                                expand=True)
        self.right_box.pack(side="left", fill="both", expand=True)
        self.right_rand_box.pack(fill="both", expand=True, padx=(10, 0))
        self.rand_box_el.pack(fill="both", expand=True)

        ttk.Separator(self, orient="horizontal").pack(side="top",
                                                      fill="x",
                                                      pady=(15, 0),
                                                      padx=10,
                                                      anchor="s")
        self.buttons_panel.pack(side="bottom", padx=15, fill="x")
        self.prev_button.pack(side="left", anchor="w", pady=(5, 10))
        self.next_button.pack(side="right", anchor="e", pady=(5, 10))