Changeset 2ab812d in sasview
- Timestamp:
- Apr 9, 2017 5:41:56 AM (8 years ago)
- Parents:
- 527a190 (diff), ed28d8c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Adam Washington <rprospero@…> (04/09/17 05:41:56)
- git-committer:
- GitHub <noreply@…> (04/09/17 05:41:56)
- Location:
- src/sas
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
rd85f1d8a r6ad9c1a 1239 1239 mod_cat = self.categorybox.GetStringSelection() 1240 1240 if mod_cat == custom_model: 1241 temp_id = self.model.id 1241 1242 temp = self.parent.update_model_list() 1243 for v in self.parent.model_dictionary.values(): 1244 if v.id == temp_id: 1245 self.model = v() 1242 1246 if temp: 1243 1247 self.model_list_box = temp -
src/sas/sasgui/perspectives/fitting/models.py
r11b094f red28d8c 319 319 """ 320 320 new_plugins = self.findModels() 321 if len(new_plugins) > 0: 322 for name, plug in new_plugins.iteritems(): 323 if name not in self.stored_plugins.keys(): 324 self.stored_plugins[name] = plug 325 self.plugins.append(plug) 326 self.model_dictionary[name] = plug 321 if new_plugins: 322 for name, plug in new_plugins.items(): 323 self.stored_plugins[name] = plug 324 self.plugins.append(plug) 325 self.model_dictionary[name] = plug 327 326 self.model_combobox.set_list("Plugin Models", self.plugins) 328 327 return self.model_combobox.get_list() -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r8434365 r527a190 156 156 # If the file does not match the schema, raise this error 157 157 invalid_xml = self.find_invalid_xml() 158 invalid_xml = INVALID_XML.format(basename + extension) + invalid_xml 159 self.errors.add(invalid_xml) 158 if invalid_xml != "": 159 invalid_xml = INVALID_XML.format(basename + extension) + invalid_xml 160 self.errors.add(invalid_xml) 160 161 # Try again with an invalid CanSAS schema, that requires only a data set in each 161 162 base_name = xml_reader.__file__ … … 261 262 # I and Q - 1D data 262 263 elif tagname == 'I' and isinstance(self.current_dataset, plottable_1D): 263 unit_list = unit.split("|") 264 if len(unit_list) > 1: 265 self.current_dataset.yaxis(unit_list[0].strip(), 266 unit_list[1].strip()) 267 else: 268 self.current_dataset.yaxis("Intensity", unit) 264 self.current_dataset.yaxis("Intensity", unit) 269 265 self.current_dataset.y = np.append(self.current_dataset.y, data_point) 270 266 elif tagname == 'Idev' and isinstance(self.current_dataset, plottable_1D): 271 267 self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 272 268 elif tagname == 'Q': 273 unit_list = unit.split("|") 274 if len(unit_list) > 1: 275 self.current_dataset.xaxis(unit_list[0].strip(), 276 unit_list[1].strip()) 277 else: 278 self.current_dataset.xaxis("Q", unit) 269 self.current_dataset.xaxis("Q", unit) 279 270 self.current_dataset.x = np.append(self.current_dataset.x, data_point) 280 271 elif tagname == 'Qdev': … … 290 281 elif tagname == 'Sesans': 291 282 self.current_datainfo.isSesans = bool(data_point) 283 self.current_dataset.xaxis(attr.get('x_axis'), 284 attr.get('x_unit')) 285 self.current_dataset.yaxis(attr.get('y_axis'), 286 attr.get('y_unit')) 292 287 elif tagname == 'zacceptance': 293 288 self.current_datainfo.sample.zacceptance = (data_point, unit) … … 781 776 value_unit = local_unit 782 777 except KeyError: 783 err_msg = "CanSAS reader: unexpected " 784 err_msg += "\"{0}\" unit [{1}]; " 785 err_msg = err_msg.format(tagname, local_unit) 786 err_msg += "expecting [{0}]".format(default_unit) 778 # Do not throw an error for loading Sesans data in cansas xml 779 # This is a temporary fix. 780 if local_unit != "A" and local_unit != 'pol': 781 err_msg = "CanSAS reader: unexpected " 782 err_msg += "\"{0}\" unit [{1}]; " 783 err_msg = err_msg.format(tagname, local_unit) 784 err_msg += "expecting [{0}]".format(default_unit) 787 785 value_unit = local_unit 788 786 except: … … 1035 1033 node.append(point) 1036 1034 self.write_node(point, "Q", datainfo.x[i], 1037 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1035 {'unit': datainfo.x_unit}) 1038 1036 if len(datainfo.y) >= i: 1039 1037 self.write_node(point, "I", datainfo.y[i], 1040 {'unit': datainfo. _yaxis + " | " + datainfo._yunit})1038 {'unit': datainfo.y_unit}) 1041 1039 if datainfo.dy is not None and len(datainfo.dy) > i: 1042 1040 self.write_node(point, "Idev", datainfo.dy[i], 1043 {'unit': datainfo. _yaxis + " | " + datainfo._yunit})1041 {'unit': datainfo.y_unit}) 1044 1042 if datainfo.dx is not None and len(datainfo.dx) > i: 1045 1043 self.write_node(point, "Qdev", datainfo.dx[i], 1046 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1044 {'unit': datainfo.x_unit}) 1047 1045 if datainfo.dxw is not None and len(datainfo.dxw) > i: 1048 1046 self.write_node(point, "dQw", datainfo.dxw[i], 1049 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1047 {'unit': datainfo.x_unit}) 1050 1048 if datainfo.dxl is not None and len(datainfo.dxl) > i: 1051 1049 self.write_node(point, "dQl", datainfo.dxl[i], 1052 {'unit': datainfo. _xaxis + " | " + datainfo._xunit})1050 {'unit': datainfo.x_unit}) 1053 1051 if datainfo.isSesans: 1054 sesans = self.create_element("Sesans") 1052 sesans_attrib = {'x_axis': datainfo._xaxis, 1053 'y_axis': datainfo._yaxis, 1054 'x_unit': datainfo.x_unit, 1055 'y_unit': datainfo.y_unit} 1056 sesans = self.create_element("Sesans", attrib=sesans_attrib) 1055 1057 sesans.text = str(datainfo.isSesans) 1056 node.append(sesans)1057 self.write_node( node, "zacceptance", datainfo.sample.zacceptance[0],1058 entry_node.append(sesans) 1059 self.write_node(entry_node, "zacceptance", datainfo.sample.zacceptance[0], 1058 1060 {'unit': datainfo.sample.zacceptance[1]}) 1059 1061 -
src/sas/sascalc/dataloader/readers/xml_reader.py
ra235f715 r527a190 128 128 first_error = schema.assertValid(self.xmldoc) 129 129 except etree.DocumentInvalid as err: 130 # Suppress errors for <'any'> elements 131 if "##other" in str(err): 132 return first_error 130 133 first_error = str(err) 131 134 return first_error
Note: See TracChangeset
for help on using the changeset viewer.