Changeset 6a455cd3 in sasview for src/sas/sascalc/dataloader/readers/cansas_reader.py
- Timestamp:
- Jul 24, 2017 10:27:05 AM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 146c669
- Parents:
- b61bd57 (diff), bc04647 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
r527a190 r6a455cd3 33 33 import xml.dom.minidom 34 34 from xml.dom.minidom import parseString 35 36 logger = logging.getLogger(__name__) 35 37 36 38 PREPROCESS = "xmlpreprocess" … … 285 287 self.current_dataset.yaxis(attr.get('y_axis'), 286 288 attr.get('y_unit')) 289 elif tagname == 'yacceptance': 290 self.current_datainfo.sample.yacceptance = (data_point, unit) 287 291 elif tagname == 'zacceptance': 288 292 self.current_datainfo.sample.zacceptance = (data_point, unit) … … 801 805 :param data1d: presumably a Data1D object 802 806 """ 803 if self.current_dataset ==None:807 if self.current_dataset is None: 804 808 x_vals = np.empty(0) 805 809 y_vals = np.empty(0) … … 889 893 # Write the file 890 894 file_ref = open(filename, 'w') 891 if self.encoding ==None:895 if self.encoding is None: 892 896 self.encoding = "UTF-8" 893 897 doc.write(file_ref, encoding=self.encoding, … … 1009 1013 :param entry_node: lxml node ElementTree object to be appended to 1010 1014 """ 1011 if datainfo.run ==None or datainfo.run == []:1015 if datainfo.run is None or datainfo.run == []: 1012 1016 datainfo.run.append(RUN_NAME_DEFAULT) 1013 1017 datainfo.run_name[RUN_NAME_DEFAULT] = RUN_NAME_DEFAULT … … 1057 1061 sesans.text = str(datainfo.isSesans) 1058 1062 entry_node.append(sesans) 1063 self.write_node(entry_node, "yacceptance", datainfo.sample.yacceptance[0], 1064 {'unit': datainfo.sample.yacceptance[1]}) 1059 1065 self.write_node(entry_node, "zacceptance", datainfo.sample.zacceptance[0], 1060 1066 {'unit': datainfo.sample.zacceptance[1]}) … … 1129 1135 self.write_node(point, "T", spectrum.transmission[i], 1130 1136 {'unit': spectrum.transmission_unit}) 1131 if spectrum.transmission_deviation !=None \1137 if spectrum.transmission_deviation is not None \ 1132 1138 and len(spectrum.transmission_deviation) >= i: 1133 1139 self.write_node(point, "Tdev", … … 1209 1215 str(datainfo.source.name)) 1210 1216 self.append(source, instr) 1211 if datainfo.source.radiation ==None or datainfo.source.radiation == '':1217 if datainfo.source.radiation is None or datainfo.source.radiation == '': 1212 1218 datainfo.source.radiation = "neutron" 1213 1219 self.write_node(source, "radiation", datainfo.source.radiation) … … 1250 1256 :param instr: lxml node ElementTree object to be appended to 1251 1257 """ 1252 if datainfo.collimation == [] or datainfo.collimation ==None:1258 if datainfo.collimation == [] or datainfo.collimation is None: 1253 1259 coll = Collimation() 1254 1260 datainfo.collimation.append(coll) … … 1295 1301 :param inst: lxml instrument node to be appended to 1296 1302 """ 1297 if datainfo.detector ==None or datainfo.detector == []:1303 if datainfo.detector is None or datainfo.detector == []: 1298 1304 det = Detector() 1299 1305 det.name = "" … … 1460 1466 local_unit = None 1461 1467 exec "local_unit = storage.%s_unit" % toks[0] 1462 if local_unit !=None and units.lower() != local_unit.lower():1468 if local_unit is not None and units.lower() != local_unit.lower(): 1463 1469 if HAS_CONVERTER == True: 1464 1470 try: … … 1473 1479 self.errors.add(err_mess) 1474 1480 if optional: 1475 logg ing.info(err_mess)1481 logger.info(err_mess) 1476 1482 else: 1477 1483 raise ValueError, err_mess … … 1482 1488 self.errors.add(err_mess) 1483 1489 if optional: 1484 logg ing.info(err_mess)1490 logger.info(err_mess) 1485 1491 else: 1486 1492 raise ValueError, err_mess
Note: See TracChangeset
for help on using the changeset viewer.