Changeset fc51d06 in sasview for src/sas/sascalc/file_converter


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.