Changeset db5196d in sasview for test


Ignore:
Timestamp:
Jan 3, 2018 9:50:17 AM (7 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, ticket885, unittest-saveload
Children:
6fd7b20
Parents:
f02a0c6
Message:

Add unit tests for removal of nans from 2D data. Change test file names for consistency and clarity.

Location:
test/sasdataloader/test
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • test/sasdataloader/test/utest_ascii.py

    rcc62607 rdb5196d  
    115115        Test loading an ascii data file with nan values saved in x, y, or dy. 
    116116        """ 
    117         f = self.loader.load(find("test_data_nan_values.dat"))[0] 
    118         for i in range(0, len(f.x) - 1): 
    119             self.assertFalse(math.isnan(f.x[i])) 
    120             self.assertFalse(math.isnan(f.y[i])) 
    121             self.assertFalse(math.isnan(f.dy[i])) 
     117        f_1d = self.loader.load(find("nans_in_1d_data.dat"))[0] 
     118        f_2d = self.loader.load(find("nans_in_2d_data.DAT"))[0] 
     119        for i in range(0, len(f_1d.x) - 1): 
     120            self.assertFalse(math.isnan(f_1d.x[i])) 
     121            self.assertFalse(math.isnan(f_1d.y[i])) 
     122            self.assertFalse(math.isnan(f_1d.dy[i])) 
     123        f_2d.data = f_2d.data.flatten() 
     124        f_2d.qx_data = f_2d.qx_data.flatten() 
     125        f_2d.qy_data = f_2d.qy_data.flatten() 
     126        for i in range(0, len(f_2d.data) - 1): 
     127            self.assertFalse(math.isnan(f_2d.data[i])) 
     128            self.assertFalse(math.isnan(f_2d.qx_data[i])) 
     129            self.assertFalse(math.isnan(f_2d.qy_data[i])) 
    122130 
    123131 
Note: See TracChangeset for help on using the changeset viewer.