Ignore:
Timestamp:
Apr 9, 2017 5:46:10 AM (7 years ago)
Author:
andyfaff
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:
ac07a3a
Parents:
5b2b04d
Message:

MAINT: replace '== None' by 'is None'

File:
1 edited

Legend:

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

    r63d773c r235f514  
    807807        :param data1d: presumably a Data1D object 
    808808        """ 
    809         if self.current_dataset == None: 
     809        if self.current_dataset is None: 
    810810            x_vals = np.empty(0) 
    811811            y_vals = np.empty(0) 
     
    895895        # Write the file 
    896896        file_ref = open(filename, 'w') 
    897         if self.encoding == None: 
     897        if self.encoding is None: 
    898898            self.encoding = "UTF-8" 
    899899        doc.write(file_ref, encoding=self.encoding, 
     
    10151015        :param entry_node: lxml node ElementTree object to be appended to 
    10161016        """ 
    1017         if datainfo.run == None or datainfo.run == []: 
     1017        if datainfo.run is None or datainfo.run == []: 
    10181018            datainfo.run.append(RUN_NAME_DEFAULT) 
    10191019            datainfo.run_name[RUN_NAME_DEFAULT] = RUN_NAME_DEFAULT 
     
    12131213                                 str(datainfo.source.name)) 
    12141214        self.append(source, instr) 
    1215         if datainfo.source.radiation == None or datainfo.source.radiation == '': 
     1215        if datainfo.source.radiation is None or datainfo.source.radiation == '': 
    12161216            datainfo.source.radiation = "neutron" 
    12171217        self.write_node(source, "radiation", datainfo.source.radiation) 
     
    12541254        :param instr: lxml node ElementTree object to be appended to 
    12551255        """ 
    1256         if datainfo.collimation == [] or datainfo.collimation == None: 
     1256        if datainfo.collimation == [] or datainfo.collimation is None: 
    12571257            coll = Collimation() 
    12581258            datainfo.collimation.append(coll) 
     
    12991299        :param inst: lxml instrument node to be appended to 
    13001300        """ 
    1301         if datainfo.detector == None or datainfo.detector == []: 
     1301        if datainfo.detector is None or datainfo.detector == []: 
    13021302            det = Detector() 
    13031303            det.name = "" 
Note: See TracChangeset for help on using the changeset viewer.