Changeset f71287f4 in sasview for pr_inversion/test
- Timestamp:
- May 9, 2008 6:09:10 PM (17 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 634f1cf
- Parents:
- 32dffae4
- Location:
- pr_inversion/test
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pr_inversion/test/utest_invertor.py
r2d06beb rf71287f4 333 333 for i in range(len(self.x_in)): 334 334 self.assertEqual(self.x_in[i], clone.x[i]) 335 336 def test_save(self): 337 x, y, err = load("sphere_80.txt") 338 339 # Choose the right d_max... 340 self.invertor.d_max = 160.0 341 # Set a small alpha 342 self.invertor.alpha = .0007 343 # Set data 344 self.invertor.x = x 345 self.invertor.y = y 346 self.invertor.err = err 347 # Perform inversion 348 349 out, cov = self.invertor.lstsq(10) 350 351 # Save 352 self.invertor.to_file("test_output.txt") 353 354 def test_load(self): 355 self.invertor.from_file("test_output.txt") 356 self.assertEqual(self.invertor.d_max, 160.0) 357 self.assertEqual(self.invertor.alpha, 0.0007) 358 self.assertEqual(self.invertor.chi2, 16654.1) 359 self.assertAlmostEqual(self.invertor.pr(self.invertor.out, 10.0), 8948.22689927, 4) 360 361 def test_qmin(self): 362 self.invertor.q_min = 1.0 363 print self.invertor.q_min 364 self.assertEqual(self.invertor.q_min, 1.0) 365 366 self.invertor.q_min = None 367 self.assertEqual(self.invertor.q_min, None) 368 369 370 def test_qmax(self): 371 self.invertor.q_max = 1.0 372 self.assertEqual(self.invertor.q_max, 1.0) 373 374 self.invertor.q_max = None 375 self.assertEqual(self.invertor.q_max, None) 376 335 377 336 378 def pr_theory(r, R):
Note: See TracChangeset
for help on using the changeset viewer.