Changeset 3a473ef in sasview for test/pr_inversion
- 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
- Location:
- test/pr_inversion/test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/pr_inversion/test/utest_explorer.py
r959eb01 r3a473ef 3 3 """ 4 4 5 import os.path 5 6 import unittest, math, numpy 6 7 from utest_invertor import load 7 8 from sas.sascalc.pr.invertor import Invertor 8 9 from sas.sascalc.pr.distance_explorer import DistExplorer 9 10 11 12 def find(filename): 13 return os.path.join(os.path.dirname(__file__), filename) 14 15 10 16 class TestExplorer(unittest.TestCase): 11 17 12 18 def setUp(self): 13 19 self.invertor = Invertor() 14 x, y, err = load( 'sphere_80.txt')20 x, y, err = load(find('sphere_80.txt')) 15 21 16 22 # Choose the right d_max... -
test/pr_inversion/test/utest_invertor.py
rcb62bd5 r3a473ef 10 10 11 11 import os 12 import os.path 12 13 import unittest 13 14 import math 14 15 import numpy 15 16 from sas.sascalc.pr.invertor import Invertor 17 18 19 def find(filename): 20 return os.path.join(os.path.dirname(__file__), filename) 16 21 17 22 … … 28 33 self.x_in[i] = 1.0*(i+1) 29 34 30 x, y, err = load( "sphere_80.txt")35 x, y, err = load(find("sphere_80.txt")) 31 36 32 37 # Choose the right d_max... … … 192 197 Test an inversion for which we know the answer 193 198 """ 194 x, y, err = load( "sphere_80.txt")199 x, y, err = load(find("sphere_80.txt")) 195 200 196 201 # Choose the right d_max... … … 247 252 Test an inversion for which we know the answer 248 253 """ 249 x, y, err = load( "sphere_80.txt")254 x, y, err = load(find("sphere_80.txt")) 250 255 251 256 # Choose the right d_max... … … 312 317 Test error condition where a point has q=0 313 318 """ 314 x, y, err = load( "sphere_80.txt")319 x, y, err = load(find("sphere_80.txt")) 315 320 x[0] = 0.0 316 321 … … 329 334 Test error condition where a point has q<0 330 335 """ 331 x, y, err = load( "sphere_80.txt")336 x, y, err = load(find("sphere_80.txt")) 332 337 x[0] = -0.2 333 338 … … 353 358 Test error condition where a point has q<0 354 359 """ 355 x, y, err = load( "sphere_80.txt")360 x, y, err = load(find("sphere_80.txt")) 356 361 y[0] = 0.0 357 362 … … 374 379 375 380 def no_test_time(self): 376 x, y, err = load( "sphere_80.txt")381 x, y, err = load(find("sphere_80.txt")) 377 382 378 383 # Choose the right d_max... … … 406 411 407 412 def test_save(self): 408 x, y, err = load( "sphere_80.txt")413 x, y, err = load(find("sphere_80.txt")) 409 414 410 415 # Choose the right d_max... … … 464 469 Test an inversion for which we know the answer 465 470 """ 466 x, y, err = load( "data_error_1.txt")471 x, y, err = load(find("data_error_1.txt")) 467 472 468 473 # Choose the right d_max... … … 482 487 Have zero as an error should raise an exception 483 488 """ 484 x, y, err = load( "data_error_2.txt")489 x, y, err = load(find("data_error_2.txt")) 485 490 486 491 # Set data … … 495 500 Test an inversion for which we know the answer 496 501 """ 497 x, y, err = load( "data_error_1.txt")502 x, y, err = load(find("data_error_1.txt")) 498 503 499 504 # Set data … … 511 516 An exception should be raised. 512 517 """ 513 x, y, err = load( "data_error_3.txt")518 x, y, err = load(find("data_error_3.txt")) 514 519 515 520 # Set data … … 521 526 Should not complain or crash. 522 527 """ 523 x, y, err = load( "data_error_4.txt")528 x, y, err = load(find("data_error_4.txt")) 524 529 525 530 # Set data … … 535 540 Makes not sense, but should not complain or crash. 536 541 """ 537 x, y, err = load( "data_error_5.txt")542 x, y, err = load(find("data_error_5.txt")) 538 543 539 544 # Set data … … 549 554 Makes not sense, but should not complain or crash. 550 555 """ 551 x, y, err = load( "data_error_6.txt")556 x, y, err = load(find("data_error_6.txt")) 552 557 553 558 # Set data
Note: See TracChangeset
for help on using the changeset viewer.