Changeset 11432:4bc3d242eb5f in orange
 Timestamp:
 04/02/13 12:25:54 (13 months ago)
 Branch:
 default
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/OrangeWidgets/Data/OWEditDomain.py
r11430 r11432 157 157 self.labels_edit.setModel(self.labels_model) 158 158 159 self.labels_edit.selectionModel().selectionChanged.connect( \160 159 self.labels_edit.selectionModel().selectionChanged.connect( 160 self.on_label_selection_changed) 161 161 162 162 # Necessary signals to know when the labels change … … 461 461 if data is not None: 462 462 input_domain = data.domain 463 all_vars = list(input_domain.variables) + \ 464 input_domain.getmetas().values() 463 all_vars = (list(input_domain.variables) + 464 list(input_domain.class_vars) + 465 input_domain.getmetas().values()) 465 466 466 467 self.openContext("", data) … … 638 639 new_data = None 639 640 if self.data is not None: 640 new_vars = list(self.domain_model) 641 variables = new_vars[: len(self.input_domain.variables)] 641 n_vars = len(self.input_domain.variables) 642 n_class_vars = len(self.input_domain.class_vars) 643 all_new_vars = list(self.domain_model) 644 variables = all_new_vars[: n_vars] 642 645 class_var = None 643 646 if self.input_domain.class_var: 644 647 class_var = variables[1] 645 variables = variables[:1] 646 647 new_metas = new_vars[len(self.input_domain.variables):] 648 new_domain = Orange.data.Domain(variables, class_var) 648 attributes = variables[:1] 649 else: 650 attributes = variables 651 652 class_vars = all_new_vars[n_vars: n_vars + n_class_vars] 653 new_metas = all_new_vars[n_vars + n_class_vars:] 654 new_domain = Orange.data.Domain(attributes, class_var, 655 class_vars=class_vars) 649 656 650 657 # Assumes getmetas().items() order has not changed. 651 658 # TODO: store metaids in set_data method 652 659 for (mid, _), new in zip(self.input_domain.getmetas().items(), 653 660 new_metas): 654 661 new_domain.addmeta(mid, new) 655 662
Note: See TracChangeset
for help on using the changeset viewer.