- Timestamp:
- Sep 13, 2018 11:33:22 AM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, unittest-saveload
- Children:
- feec1cb
- Parents:
- 4fdcc65
- Location:
- test/sasdataloader/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/sasdataloader/test/utest_cansas.py
r7fd5e2a r2ca5d57b 256 256 self.datafile_basic = find("simpleexamplefile.h5") 257 257 self.datafile_multiplesasentry = find( 258 "test_data//nxcansas_1Dand2D_multisasentry.h5") 259 self.datafile_multiplesasdata = find( 258 260 "test_data//nxcansas_1Dand2D_multisasdata.h5") 259 self.datafile_multiplesasdata = find(260 "test_data//nxcansas_1Dand2D_multisasentry.h5")261 261 self.datafile_multiplesasdata_multiplesasentry = find( 262 262 "test_data//nxcansas_1Dand2D_multisasentry_multisasdata.h5") … … 277 277 self._check_1d_data(self.data[1]) 278 278 self._check_2d_data(self.data[0]) 279 280 def test_multiple_sasdatas(self): 281 self.data = self.loader.load(self.datafile_multiplesasdata) 282 self.assertTrue(len(self.data) == 2) 283 self._check_multiple_data(self.data[0]) 284 self._check_multiple_data(self.data[1]) 285 if isinstance(self.data[0], Data1D): 286 self._check_1d_data(self.data[0]) 287 self._check_2d_data(self.data[1]) 288 else: 289 self._check_1d_data(self.data[1]) 290 self._check_2d_data(self.data[0]) 291 292 def test_multiple_sasentries_multiplesasdatas(self): 293 self.data = self.loader.load( 294 self.datafile_multiplesasdata_multiplesasentry) 295 self.assertTrue(len(self.data) == 4) 296 self._check_multiple_data(self.data[0]) 297 self._check_multiple_data(self.data[1]) 298 self._check_multiple_data(self.data[2]) 299 self._check_multiple_data(self.data[3]) 300 for data in self.data: 301 if isinstance(data, Data1D): 302 self._check_1d_data(data) 303 else: 304 self._check_2d_data(data) 279 305 280 306 def _check_multiple_data(self, data): … … 305 331 self.assertTrue(len(data.q_data) == 150*150) 306 332 self.assertTrue(len(data.q_data) == len(data.data)) 307 print(data.err_data[10])308 333 self.assertAlmostEqual(data.err_data[10], 0.186723989418) 309 self.assertAlmostEqual(data.data[10], 0.465181 425808)334 self.assertAlmostEqual(data.data[10], 0.465181) 310 335 self.assertAlmostEqual(data.qx_data[10], -0.129) 311 336 self.assertAlmostEqual(data.qy_data[10], -0.149)
Note: See TracChangeset
for help on using the changeset viewer.