Ignore:
Timestamp:
Aug 29, 2018 10:01:23 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
9463ca2
Parents:
ce30949
git-author:
Piotr Rozyczko <rozyczko@…> (08/29/18 09:59:56)
git-committer:
Piotr Rozyczko <rozyczko@…> (08/29/18 10:01:23)
Message:

cherry picking sascalc changes from master SASVIEW-996
minor unit test fixes

File:
1 edited

Legend:

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

    r2b538cd rb8080e1  
    6868        data files do not appear a second time 
    6969        """ 
    70         self.current_datainfo = None 
    71         self.current_dataset = None 
    72         self.current_data1d = None 
     70        super(Reader, self).reset_state() 
    7371        self.data = [] 
    7472        self.process = Process() 
     
    7977        self.names = [] 
    8078        self.cansas_defaults = {} 
    81         self.output = [] 
    8279        self.ns_list = None 
    8380        self.logging = [] 
     
    8582 
    8683    def read(self, xml_file, schema_path="", invalid=True): 
    87         if schema_path != "" or invalid != True: 
     84        if schema_path != "" or not invalid: 
    8885            # read has been called from self.get_file_contents because xml file doens't conform to schema 
    8986            _, self.extension = os.path.splitext(os.path.basename(xml_file)) 
     
    945942            pos, "z", datainfo.sample.position.z, 
    946943            {"unit": datainfo.sample.position_unit}) 
    947         if written == True: 
     944        if written: 
    948945            self.append(pos, sample) 
    949946 
     
    958955            ori, "yaw", datainfo.sample.orientation.z, 
    959956            {"unit": datainfo.sample.orientation_unit}) 
    960         if written == True: 
     957        if written: 
    961958            self.append(ori, sample) 
    962959 
     
    10051002            size, "z", datainfo.source.beam_size.z, 
    10061003            {"unit": datainfo.source.beam_size_unit}) 
    1007         if written == True: 
     1004        if written: 
    10081005            self.append(size, source) 
    10091006 
     
    10611058                    size, "z", aperture.size.z, 
    10621059                    {"unit": aperture.size_unit}) 
    1063                 if written == True: 
     1060                if written: 
    10641061                    self.append(size, apert) 
    10651062 
     
    10841081            written = written | self.write_node(det, "SDD", item.distance, 
    10851082                                                {"unit": item.distance_unit}) 
    1086             if written == True: 
     1083            if written: 
    10871084                self.append(det, instr) 
    10881085 
     
    10941091            written = written | self.write_node(off, "z", item.offset.z, 
    10951092                                                {"unit": item.offset_unit}) 
    1096             if written == True: 
     1093            if written: 
    10971094                self.append(off, det) 
    10981095 
     
    11061103                                                item.orientation.z, 
    11071104                                                {"unit": item.orientation_unit}) 
    1108             if written == True: 
     1105            if written: 
    11091106                self.append(ori, det) 
    11101107 
     
    11181115                                                item.beam_center.z, 
    11191116                                                {"unit": item.beam_center_unit}) 
    1120             if written == True: 
     1117            if written: 
    11211118                self.append(center, det) 
    11221119 
     
    11281125            written = written | self.write_node(pix, "z", item.pixel_size.z, 
    11291126                                                {"unit": item.pixel_size_unit}) 
    1130             if written == True: 
     1127            if written: 
    11311128                self.append(pix, det) 
    11321129            self.write_node(det, "slit_length", item.slit_length, 
Note: See TracChangeset for help on using the changeset viewer.