Changeset 278ddee in sasview for src/sas/sascalc/dataloader/readers/cansas_reader.py
- Timestamp:
- Apr 11, 2017 9:51:05 AM (8 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, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- beba407
- Parents:
- 7f75a3f (diff), 97c60f8 (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:
- Jeff Krzywon <krzywon@…> (04/11/17 09:51:05)
- git-committer:
- krzywon <krzywon@…> (04/11/17 09:51:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/cansas_reader.py
r7f75a3f r278ddee 34 34 import xml.dom.minidom 35 35 from xml.dom.minidom import parseString 36 37 logger = logging.getLogger(__name__) 36 38 37 39 PREPROCESS = "xmlpreprocess" … … 291 293 elif tagname == 'Sesans': 292 294 self.current_datainfo.isSesans = bool(data_point) 295 elif tagname == 'yacceptance': 296 self.current_datainfo.sample.yacceptance = (data_point, unit) 293 297 elif tagname == 'zacceptance': 294 298 self.current_datainfo.sample.zacceptance = (data_point, unit) … … 809 813 :param data1d: presumably a Data1D object 810 814 """ 811 if self.current_dataset ==None:815 if self.current_dataset is None: 812 816 x_vals = np.empty(0) 813 817 y_vals = np.empty(0) … … 897 901 # Write the file 898 902 file_ref = open(filename, 'w') 899 if self.encoding ==None:903 if self.encoding is None: 900 904 self.encoding = "UTF-8" 901 905 doc.write(file_ref, encoding=self.encoding, … … 1017 1021 :param entry_node: lxml node ElementTree object to be appended to 1018 1022 """ 1019 if datainfo.run ==None or datainfo.run == []:1023 if datainfo.run is None or datainfo.run == []: 1020 1024 datainfo.run.append(RUN_NAME_DEFAULT) 1021 1025 datainfo.run_name[RUN_NAME_DEFAULT] = RUN_NAME_DEFAULT … … 1061 1065 sesans.text = str(datainfo.isSesans) 1062 1066 node.append(sesans) 1067 self.write_node(node, "yacceptance", datainfo.sample.yacceptance[0], 1068 {'unit': datainfo.sample.yacceptance[1]}) 1063 1069 self.write_node(node, "zacceptance", datainfo.sample.zacceptance[0], 1064 1070 {'unit': datainfo.sample.zacceptance[1]}) … … 1133 1139 self.write_node(point, "T", spectrum.transmission[i], 1134 1140 {'unit': spectrum.transmission_unit}) 1135 if spectrum.transmission_deviation !=None \1141 if spectrum.transmission_deviation is not None \ 1136 1142 and len(spectrum.transmission_deviation) >= i: 1137 1143 self.write_node(point, "Tdev", … … 1213 1219 str(datainfo.source.name)) 1214 1220 self.append(source, instr) 1215 if datainfo.source.radiation ==None or datainfo.source.radiation == '':1221 if datainfo.source.radiation is None or datainfo.source.radiation == '': 1216 1222 datainfo.source.radiation = "neutron" 1217 1223 self.write_node(source, "radiation", datainfo.source.radiation) … … 1254 1260 :param instr: lxml node ElementTree object to be appended to 1255 1261 """ 1256 if datainfo.collimation == [] or datainfo.collimation ==None:1262 if datainfo.collimation == [] or datainfo.collimation is None: 1257 1263 coll = Collimation() 1258 1264 datainfo.collimation.append(coll) … … 1299 1305 :param inst: lxml instrument node to be appended to 1300 1306 """ 1301 if datainfo.detector ==None or datainfo.detector == []:1307 if datainfo.detector is None or datainfo.detector == []: 1302 1308 det = Detector() 1303 1309 det.name = "" … … 1464 1470 local_unit = None 1465 1471 exec "local_unit = storage.%s_unit" % toks[0] 1466 if local_unit !=None and units.lower() != local_unit.lower():1472 if local_unit is not None and units.lower() != local_unit.lower(): 1467 1473 if HAS_CONVERTER == True: 1468 1474 try: … … 1477 1483 self.errors.add(err_mess) 1478 1484 if optional: 1479 logg ing.info(err_mess)1485 logger.info(err_mess) 1480 1486 else: 1481 1487 raise ValueError, err_mess … … 1486 1492 self.errors.add(err_mess) 1487 1493 if optional: 1488 logg ing.info(err_mess)1494 logger.info(err_mess) 1489 1495 else: 1490 1496 raise ValueError, err_mess
Note: See TracChangeset
for help on using the changeset viewer.