Changeset 3a473ef in sasview for test/sasdataloader/test/utest_averaging.py
- Timestamp:
- Aug 31, 2018 5:13:23 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- c1cfa80
- Parents:
- aa1db44
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_averaging.py
r2a52b0e r3a473ef 13 13 SlabY, get_q, 14 14 reader2D_converter) 15 16 17 def find(filename): 18 return os.path.join(os.path.dirname(__file__), filename) 15 19 16 20 … … 102 106 103 107 def setUp(self): 104 filepath = os.path.join(os.path.dirname(105 os.path.realpath(__file__)), 'MAR07232_rest.h5')106 self.data = Loader().load(filepath)[0]108 filepath = find('MAR07232_rest.h5') 109 self.data_list = Loader().load(filepath) 110 self.data = self.data_list[0] 107 111 108 112 def test_ring(self): … … 117 121 118 122 o = r(self.data) 119 filepath = os.path.join(os.path.dirname( 120 os.path.realpath(__file__)), 'ring_testdata.txt') 121 answer = Loader().load(filepath)[0] 122 123 filepath = find('ring_testdata.txt') 124 answer_list = Loader().load(filepath) 125 answer = answer_list[0] 126 127 self.assertEqual(len(answer_list), 1) 123 128 for i in range(r.nbins_phi - 1): 124 129 self.assertAlmostEqual(o.x[i + 1], answer.x[i], 4) … … 137 142 o = r(self.data) 138 143 139 filepath = os.path.join(os.path.dirname( 140 os.path.realpath(__file__)), 'avg_testdata.txt') 144 filepath = find('avg_testdata.txt') 141 145 answer = Loader().load(filepath)[0] 142 146 for i in range(r.nbins_phi): … … 173 177 o = r(self.data) 174 178 175 filepath = os.path.join(os.path.dirname( 176 os.path.realpath(__file__)), 'slabx_testdata.txt') 179 filepath = find('slabx_testdata.txt') 177 180 answer = Loader().load(filepath)[0] 178 181 for i in range(len(o.x)): … … 192 195 o = r(self.data) 193 196 194 filepath = os.path.join(os.path.dirname( 195 os.path.realpath(__file__)), 'slaby_testdata.txt') 197 filepath = find('slaby_testdata.txt') 196 198 answer = Loader().load(filepath)[0] 197 199 for i in range(len(o.x)): … … 219 221 o = r(self.data) 220 222 221 filepath = os.path.join(os.path.dirname( 222 os.path.realpath(__file__)), 'ring_testdata.txt') 223 filepath = find('ring_testdata.txt') 223 224 answer = Loader().load(filepath)[0] 224 225 for i in range(len(o.x)): … … 237 238 o = r(self.data) 238 239 239 filepath = os.path.join(os.path.dirname( 240 os.path.realpath(__file__)), 'sectorphi_testdata.txt') 240 filepath = find('sectorphi_testdata.txt') 241 241 answer = Loader().load(filepath)[0] 242 242 for i in range(len(o.x)): … … 255 255 o = r(self.data) 256 256 257 filepath = os.path.join(os.path.dirname( 258 os.path.realpath(__file__)), 'sectorq_testdata.txt') 257 filepath = find('sectorq_testdata.txt') 259 258 answer = Loader().load(filepath)[0] 260 259 for i in range(len(o.x)):
Note: See TracChangeset
for help on using the changeset viewer.