Changes in test/pr_inversion/test/utest_invertor.py [ac07a3a:aaf5e49] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pr_inversion/test/utest_invertor.py
rac07a3a raaf5e49 6 6 # Disable "too many methods" complaint 7 7 # pylint: disable-msg=R0904 8 9 10 import unittest, math, numpy 8 from __future__ import print_function 9 10 11 import os 12 import unittest 13 import math 14 import numpy 11 15 from sas.sascalc.pr.invertor import Invertor 12 16 17 13 18 class TestFiguresOfMerit(unittest.TestCase): 14 19 … … 235 240 self.assertTrue(chi2/51.0<10.0) 236 241 except: 237 print "chi2 =", chi2/51.0242 print("chi2 =", chi2/51.0) 238 243 raise 239 244 … … 263 268 self.assertTrue(self.invertor.chi2/len(x)<200.00) 264 269 except: 265 print "Chi2(I(q)) =", self.invertor.chi2/len(x)270 print("Chi2(I(q)) =", self.invertor.chi2/len(x)) 266 271 raise 267 272 … … 297 302 self.assertTrue(chi2/51.0<50.0) 298 303 except: 299 print "chi2(P(r)) =", chi2/51.0304 print("chi2(P(r)) =", chi2/51.0) 300 305 raise 301 306 … … 341 346 self.assertTrue(self.invertor.chi2>0) 342 347 except: 343 print "Chi2 =", self.invertor.chi2348 print("Chi2 =", self.invertor.chi2) 344 349 raise 345 350 … … 365 370 self.assertTrue(self.invertor.chi2>0) 366 371 except: 367 print "Chi2 =", self.invertor.chi2372 print("Chi2 =", self.invertor.chi2) 368 373 raise 369 374 … … 416 421 417 422 # Save 418 self.invertor.to_file("test_output.txt") 423 f_name = "test_output.txt" 424 self.invertor.to_file(f_name) 419 425 420 426 # Load 421 self.invertor.from_file( "test_output.txt")427 self.invertor.from_file(f_name) 422 428 self.assertEqual(self.invertor.d_max, 160.0) 423 429 self.assertEqual(self.invertor.alpha, 0.0007) 424 430 self.assertEqual(self.invertor.chi2, 836.797) 425 431 self.assertAlmostEqual(self.invertor.pr(self.invertor.out, 10.0), 903.31577041, 4) 432 if os.path.isfile(f_name): 433 os.remove(f_name) 426 434 427 435 def test_qmin(self):
Note: See TracChangeset
for help on using the changeset viewer.