Changeset fc51d06 in sasview


Ignore:
Timestamp:
Jul 9, 2018 4:51:03 PM (6 years ago)
Author:
krzywon
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
Children:
b799f09
Parents:
b011ecb
Message:

Fix broken unit tests and general cleanup.

Files:
4 edited

Legend:

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

    r3bab401 rfc51d06  
    180180        detector.beam_center.y = center_y * pixel 
    181181 
    182  
    183         self.current_dataset.xaxis("\\rm{Q_{x}}", '1/A') 
    184         self.current_dataset.yaxis("\\rm{Q_{y}}", '1/A') 
    185         self.current_dataset.zaxis("\\rm{Intensity}", "1/cm") 
    186  
     182        self.current_dataset = self.set_default_2d_units(self.current_dataset) 
    187183        self.current_dataset.x_bins = x_vals 
    188184        self.current_dataset.y_bins = y_vals 
  • src/sas/sascalc/file_converter/nxcansas_writer.py

    r369ed11d rfc51d06  
    297297 
    298298        intensity = np.reshape(data.data, (n_rows, n_cols)) 
    299         d_i = None 
    300         if not all(data.err_data == [None]): 
    301             d_i = np.reshape(data.err_data, (n_rows, n_cols)) 
    302299        qx = np.reshape(data.qx_data, (n_rows, n_cols)) 
    303300        qy = np.reshape(data.qy_data, (n_rows, n_cols)) 
     
    309306        qy_entry = data_entry.create_dataset('Qy', data=qy) 
    310307        qy_entry.attrs['units'] = data.Q_unit 
    311         if d_i: 
     308        if data.err_data is not None and not all(data.err_data == [None]): 
     309            d_i = np.reshape(data.err_data, (n_rows, n_cols)) 
    312310            i_entry.attrs['uncertainties'] = 'Idev' 
    313311            i_dev_entry = data_entry.create_dataset('Idev', data=d_i) 
    314312            i_dev_entry.attrs['units'] = data.I_unit 
    315         if not all(data.dqx_data == [None]): 
     313        if data.dqx_data is not None and not all(data.dqx_data == [None]): 
    316314            qx_entry.attrs['resolutions'] = 'dQx' 
    317315            dqx_entry = data_entry.create_dataset('dQx', data=data.dqx_data) 
    318316            dqx_entry.attrs['units'] = data.Q_unit 
    319         if not all(data.dqy_data == [None]): 
     317        if data.dqy_data is not None and not all(data.dqy_data == [None]): 
    320318            qy_entry.attrs['resolutions'] = 'dQy' 
    321319            dqy_entry = data_entry.create_dataset('dQy', data=data.dqy_data) 
  • test/sasdataloader/test/utest_abs_reader.py

    rfa749b7 rfc51d06  
    118118        self.assertEqual(self.data.detector[0].beam_center.y, center_y) 
    119119 
    120         self.assertEqual(self.data.I_unit, '1/cm') 
     120        self.assertEqual(self.data.I_unit, 'cm^{-1}') 
    121121        self.assertEqual(self.data.data[0], 1.57831) 
    122122        self.assertEqual(self.data.data[1], 2.70983) 
  • test/sasdataloader/test/utest_red2d_reader.py

    rf53d684 rfc51d06  
    3131        self.assertEqual(f.qx_data[0],-0.03573497) 
    3232        self.assertEqual(f.qx_data[36863],0.2908819) 
    33         self.assertEqual(f.Q_unit, '1/A') 
    34         self.assertEqual(f.I_unit, '1/cm') 
     33        self.assertEqual(f.Q_unit, 'A^{-1}') 
     34        self.assertEqual(f.I_unit, 'cm^{-1}') 
    3535 
    3636        self.assertEqual(f.meta_data['loader'],"IGOR/DAT 2D Q_map") 
Note: See TracChangeset for help on using the changeset viewer.