def __init__(self): super().__init__() self.data = None # type: Optional[Table] self.template_data = None # type: Optional[Table] self.transformed_info = describe_data(None) # type: OrderedDict info_box = gui.widgetBox(self.controlArea, "Info") self.input_label = gui.widgetLabel(info_box, "") self.template_label = gui.widgetLabel(info_box, "") self.output_label = gui.widgetLabel(info_box, "") self.set_input_label_text() self.set_template_label_text()
def __init__(self): super().__init__() self.data = None # type: Optional[Table] self.template_domain = None # type: Optional[Domain] self.transformed_info = describe_data(None) # type: OrderedDict info_box = gui.widgetBox(self.controlArea, "Info") self.input_label = gui.widgetLabel(info_box, "") self.template_label = gui.widgetLabel(info_box, "") self.output_label = gui.widgetLabel(info_box, "") self.set_input_label_text() self.set_template_label_text()
def apply(self): self.clear_messages() transformed_data = None if self.data and self.template_domain is not None: try: transformed_data = self.data.transform(self.template_domain) except Exception as ex: # pylint: disable=broad-except self.Error.error(ex) data = transformed_data self.transformed_info = describe_data(data) self.Outputs.transformed_data.send(data) self.set_template_label_text() self.set_output_label_text(data)
def __init__(self): super().__init__() self.data = None # type: Optional[Table] self.template_domain = None # type: Optional[Domain] self.transformed_info = describe_data(None) # type: OrderedDict info_box = gui.widgetBox(self.controlArea, "Info") self.input_label = gui.widgetLabel(info_box, "") self.template_label = gui.widgetLabel(info_box, "") self.output_label = gui.widgetLabel(info_box, "") self.set_input_label_text() self.set_template_label_text() box = gui.widgetBox(self.controlArea, "Output") gui.checkBox(box, self, "retain_all_data", "Retain all data", callback=self.apply)
def apply(self): self.clear_messages() transformed_data = None if self.data and self.template_data: try: transformed_data = self.data.transform(self.template_data.domain) except Exception as ex: # pylint: disable=broad-except self.Error.error(ex) data = transformed_data summary = len(data) if data else self.info.NoOutput details = format_summary_details(data) if data else "" self.info.set_output_summary(summary, details) self.transformed_info = describe_data(data) self.Outputs.transformed_data.send(data) self.set_template_label_text() self.set_output_label_text(data)