Changeset 248ff73 in sasview for src/sas/sascalc/dataloader/readers


Ignore:
Timestamp:
Aug 1, 2017 11:36:38 AM (7 years ago)
Author:
lewis
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:
5a8cdbb
Parents:
b2c28a5
Message:

Ensure unit tests pass

utest_averaging still fails as it relies on loading in an Igor 2D file,
which is no longer possible

Location:
src/sas/sascalc/dataloader/readers
Files:
2 edited

Legend:

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

    r371b9e2 r248ff73  
    3737    Read the specified settings file to associate 
    3838    default readers to file extension. 
    39      
     39 
    4040    :param loader: Loader object 
    4141    :param settings: path to the json settings file [string] 
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r0615d54 r248ff73  
    130130                self.current_datainfo.meta_data[PREPROCESS] = self.processing_instructions 
    131131                self._parse_entry(entry) 
    132                 self.send_to_output() # Combune datasets with DataInfo 
     132                has_error_dx = self.current_dataset.dx is not None 
     133                has_error_dy = self.current_dataset.dy is not None 
     134                self.remove_empty_q_values(has_error_dx=has_error_dx, 
     135                    has_error_dy=has_error_dy) 
     136                self.send_to_output() # Combine datasets with DataInfo 
     137                self.current_datainfo = DataInfo() # Reset DataInfo 
    133138        except FileContentsException as fc_exc: 
    134139            # File doesn't meet schema - try loading with a less strict schema 
     
    215220            self.current_dataset = plottable_1D(np.empty(0), np.empty(0), 
    216221                np.empty(0), np.empty(0)) 
    217             self.current_dataset.dxl = np.empty(0) 
    218             self.current_dataset.dxw = np.empty(0) 
    219222        self.base_ns = "{" + CANSAS_NS.get(self.cansas_version).get("ns") + "}" 
    220223 
     
    295298                    self.current_dataset.dx = np.append(self.current_dataset.dx, data_point) 
    296299                elif tagname == 'dQw': 
     300                    if self.current_dataset.dqw is None: self.current_dataset.dqw = np.empty(0) 
    297301                    self.current_dataset.dxw = np.append(self.current_dataset.dxw, data_point) 
    298302                elif tagname == 'dQl': 
     303                    if self.current_dataset.dxl is None: self.current_dataset.dxl = np.empty(0) 
    299304                    self.current_dataset.dxl = np.append(self.current_dataset.dxl, data_point) 
    300305                elif tagname == 'Qmean': 
Note: See TracChangeset for help on using the changeset viewer.