Ignore:
Timestamp:
Jul 24, 2017 10:27:05 AM (7 years ago)
Author:
krzywon
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.
Message:

Merge branch 'master' into 4_1_issues

# Conflicts:
# docs/sphinx-docs/source/conf.py
# src/sas/sascalc/dataloader/readers/cansas_reader.py
# src/sas/sasgui/guiframe/documentation_window.py
# src/sas/sasgui/perspectives/fitting/models.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r527a190 r6a455cd3  
    3333import xml.dom.minidom 
    3434from xml.dom.minidom import parseString 
     35 
     36logger = logging.getLogger(__name__) 
    3537 
    3638PREPROCESS = "xmlpreprocess" 
     
    285287                    self.current_dataset.yaxis(attr.get('y_axis'), 
    286288                                                attr.get('y_unit')) 
     289                elif tagname == 'yacceptance': 
     290                    self.current_datainfo.sample.yacceptance = (data_point, unit) 
    287291                elif tagname == 'zacceptance': 
    288292                    self.current_datainfo.sample.zacceptance = (data_point, unit) 
     
    801805        :param data1d: presumably a Data1D object 
    802806        """ 
    803         if self.current_dataset == None: 
     807        if self.current_dataset is None: 
    804808            x_vals = np.empty(0) 
    805809            y_vals = np.empty(0) 
     
    889893        # Write the file 
    890894        file_ref = open(filename, 'w') 
    891         if self.encoding == None: 
     895        if self.encoding is None: 
    892896            self.encoding = "UTF-8" 
    893897        doc.write(file_ref, encoding=self.encoding, 
     
    10091013        :param entry_node: lxml node ElementTree object to be appended to 
    10101014        """ 
    1011         if datainfo.run == None or datainfo.run == []: 
     1015        if datainfo.run is None or datainfo.run == []: 
    10121016            datainfo.run.append(RUN_NAME_DEFAULT) 
    10131017            datainfo.run_name[RUN_NAME_DEFAULT] = RUN_NAME_DEFAULT 
     
    10571061            sesans.text = str(datainfo.isSesans) 
    10581062            entry_node.append(sesans) 
     1063            self.write_node(entry_node, "yacceptance", datainfo.sample.yacceptance[0], 
     1064                             {'unit': datainfo.sample.yacceptance[1]}) 
    10591065            self.write_node(entry_node, "zacceptance", datainfo.sample.zacceptance[0], 
    10601066                             {'unit': datainfo.sample.zacceptance[1]}) 
     
    11291135                self.write_node(point, "T", spectrum.transmission[i], 
    11301136                                {'unit': spectrum.transmission_unit}) 
    1131                 if spectrum.transmission_deviation != None \ 
     1137                if spectrum.transmission_deviation is not None \ 
    11321138                and len(spectrum.transmission_deviation) >= i: 
    11331139                    self.write_node(point, "Tdev", 
     
    12091215                                 str(datainfo.source.name)) 
    12101216        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 == '': 
    12121218            datainfo.source.radiation = "neutron" 
    12131219        self.write_node(source, "radiation", datainfo.source.radiation) 
     
    12501256        :param instr: lxml node ElementTree object to be appended to 
    12511257        """ 
    1252         if datainfo.collimation == [] or datainfo.collimation == None: 
     1258        if datainfo.collimation == [] or datainfo.collimation is None: 
    12531259            coll = Collimation() 
    12541260            datainfo.collimation.append(coll) 
     
    12951301        :param inst: lxml instrument node to be appended to 
    12961302        """ 
    1297         if datainfo.detector == None or datainfo.detector == []: 
     1303        if datainfo.detector is None or datainfo.detector == []: 
    12981304            det = Detector() 
    12991305            det.name = "" 
     
    14601466                local_unit = None 
    14611467                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(): 
    14631469                    if HAS_CONVERTER == True: 
    14641470                        try: 
     
    14731479                            self.errors.add(err_mess) 
    14741480                            if optional: 
    1475                                 logging.info(err_mess) 
     1481                                logger.info(err_mess) 
    14761482                            else: 
    14771483                                raise ValueError, err_mess 
     
    14821488                        self.errors.add(err_mess) 
    14831489                        if optional: 
    1484                             logging.info(err_mess) 
     1490                            logger.info(err_mess) 
    14851491                        else: 
    14861492                            raise ValueError, err_mess 
Note: See TracChangeset for help on using the changeset viewer.