(self, selection: QItemSelection)
Commit the selected tree to output.
Commit the selected tree to output.
Commit the selected tree to output .
def commit(self, selection: QItemSelection) -> None:
        """Commit the selected tree to output."""
        selected_indices = selection.indexes()

        if not len(selected_indices):
            self.selected_index = None
            self.Outputs.tree.send(None)
            return

        # We only allow selecting a single tree so there will always be one index
        self.selected_index = selected_indices[0].row()

        tree = self.rf_model.trees[self.selected_index]
        tree.instances = self.instances
        tree.meta_target_class_index = self.target_class_index
        tree.meta_size_calc_idx = self.size_calc_idx
        tree.meta_depth_limit = self.depth_limit

        self.Outputs.tree.send(tree)
def commit ( self , selection : QItemSelection ) -> None : selected_indices = selection . indexes ( ) if not len ( selected_indices ) : self . selected_index = None self . Outputs . tree . send ( None ) return # We only allow selecting a single tree so there will always be one index self . selected_index = selected_indices [ 0 ] . row ( ) tree = self . rf_model . trees [ self . selected_index ] tree . instances = self . instances tree . meta_target_class_index = self . target_class_index tree . meta_size_calc_idx = self . size_calc_idx tree . meta_depth_limit = self . depth_limit self . Outputs . tree . send ( tree )