Ignore:
Timestamp:
Nov 20, 2017 1:15:52 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b6b81a3
Parents:
0fc5a03
Message:

lint: update 'if x==True/False?' to 'if x/not x:'

File:
1 edited

Legend:

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

    r61f329f0 r2469df7  
    8282 
    8383    def read(self, xml_file, schema_path="", invalid=True): 
    84         if schema_path != "" or invalid != True: 
     84        if schema_path != "" or not invalid: 
    8585            # read has been called from self.get_file_contents because xml file doens't conform to schema 
    8686            _, self.extension = os.path.splitext(os.path.basename(xml_file)) 
     
    942942            pos, "z", datainfo.sample.position.z, 
    943943            {"unit": datainfo.sample.position_unit}) 
    944         if written == True: 
     944        if written: 
    945945            self.append(pos, sample) 
    946946 
     
    955955            ori, "yaw", datainfo.sample.orientation.z, 
    956956            {"unit": datainfo.sample.orientation_unit}) 
    957         if written == True: 
     957        if written: 
    958958            self.append(ori, sample) 
    959959 
     
    10021002            size, "z", datainfo.source.beam_size.z, 
    10031003            {"unit": datainfo.source.beam_size_unit}) 
    1004         if written == True: 
     1004        if written: 
    10051005            self.append(size, source) 
    10061006 
     
    10581058                    size, "z", aperture.size.z, 
    10591059                    {"unit": aperture.size_unit}) 
    1060                 if written == True: 
     1060                if written: 
    10611061                    self.append(size, apert) 
    10621062 
     
    10811081            written = written | self.write_node(det, "SDD", item.distance, 
    10821082                                                {"unit": item.distance_unit}) 
    1083             if written == True: 
     1083            if written: 
    10841084                self.append(det, instr) 
    10851085 
     
    10911091            written = written | self.write_node(off, "z", item.offset.z, 
    10921092                                                {"unit": item.offset_unit}) 
    1093             if written == True: 
     1093            if written: 
    10941094                self.append(off, det) 
    10951095 
     
    11031103                                                item.orientation.z, 
    11041104                                                {"unit": item.orientation_unit}) 
    1105             if written == True: 
     1105            if written: 
    11061106                self.append(ori, det) 
    11071107 
     
    11151115                                                item.beam_center.z, 
    11161116                                                {"unit": item.beam_center_unit}) 
    1117             if written == True: 
     1117            if written: 
    11181118                self.append(center, det) 
    11191119 
     
    11251125            written = written | self.write_node(pix, "z", item.pixel_size.z, 
    11261126                                                {"unit": item.pixel_size_unit}) 
    1127             if written == True: 
     1127            if written: 
    11281128                self.append(pix, det) 
    11291129            self.write_node(det, "slit_length", item.slit_length, 
Note: See TracChangeset for help on using the changeset viewer.