Changeset 282bc3f in sasview


Ignore:
Timestamp:
Nov 1, 2018 4:35:01 PM (6 years ago)
Author:
Jeff Krzywon <jkrzywon@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249
Children:
9b08354
Parents:
dfcdbf8
Message:

Change errors in NXcanSAS reader to a list to match the rest of the readers and update unit test.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/file_reader_base_class.py

    rdfcdbf8 r282bc3f  
    151151        """ 
    152152        if len(self.output) > 0: 
    153             self.output[-1].errors.add(msg) 
     153            self.output[-1].errors.append(msg) 
    154154        elif isinstance(self.current_datainfo, DataInfo): 
    155             self.current_datainfo.errors.add(msg) 
     155            self.output[-1].errors.append(msg) 
    156156        else: 
    157157            logger.warning(msg) 
     
    360360                message = "Unable to convert Q units from {0} to 1/A." 
    361361                message.format(default_q_unit) 
    362                 data.errors.add(message) 
     362                data.errors.append(message) 
    363363            new_output.append(data) 
    364364        self.output = new_output 
  • src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py

    rdfcdbf8 r282bc3f  
    102102        self.data2d = [] 
    103103        self.raw_data = None 
    104         self.errors = set() 
     104        self.errors = [] 
    105105        self.logging = [] 
    106106        self.q_names = [] 
     
    231231            else: 
    232232                # I don't know if this reachable code 
    233                 self.errors.add("ShouldNeverHappenException") 
     233                self.errors.append("ShouldNeverHappenException") 
    234234 
    235235    def process_1d_data_object(self, data_set, key, unit): 
     
    528528        # Append errors to dataset and reset class errors 
    529529        self.current_datainfo.errors = self.errors 
    530         self.errors.clear() 
     530        self.errors = [] 
    531531 
    532532        # Combine all plottables with datainfo and append each to output 
     
    538538                    zeros[i] = dataset.mask[i] 
    539539            except: 
    540                 self.errors.add(sys.exc_value) 
     540                self.errors.append(sys.exc_value) 
    541541            dataset.mask = zeros 
    542542            # Calculate the actual Q matrix 
  • test/sasdataloader/test/utest_generic_file_reader_class.py

    rf4e2f22 r282bc3f  
    7171        # Be sure the deprecation warning is passed with the file 
    7272        self.assertEqual(len(asc_load[0].errors), 1) 
    73         self.assertEqual(len(nxs_load[0].errors), 1) 
     73        self.assertEqual(len(nxs_load[0].errors), 0) 
    7474 
    7575    def check_unknown_extension(self, data): 
Note: See TracChangeset for help on using the changeset viewer.