Changeset 3a473ef in sasview for test/corfunc
- Timestamp:
- Aug 31, 2018 7: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/corfunc/test/utest_corfunc.py
r86ba9d6 r3a473ef 4 4 from __future__ import division, print_function 5 5 6 import os.path 6 7 import unittest 7 8 import time … … 11 12 from sas.sascalc.corfunc.corfunc_calculator import CorfuncCalculator 12 13 from sas.sascalc.dataloader.data_info import Data1D 14 15 16 def find(filename): 17 return os.path.join(os.path.dirname(__file__), filename) 13 18 14 19 … … 31 36 self.extrapolation = None 32 37 self.transformation = None 33 self.results = [np.loadtxt(fi lename+"_out.txt").T[2]38 self.results = [np.loadtxt(find(filename+"_out.txt")).T[2] 34 39 for filename in ("gamma1", "gamma3", "idf")] 35 40 … … 69 74 while True: 70 75 time.sleep(0.001) 71 if not self.calculator.transform_isrunning(): 76 if (not self.calculator.transform_isrunning() and 77 self.transformation is not None): 72 78 break 73 79 74 def transform_callback(self, transforms): 75 transform1, transform3, idf = transforms 80 transform1, transform3, idf = self.transformation 76 81 self.assertIsNotNone(transform1) 77 82 self.assertAlmostEqual(transform1.y[0], 1) 78 83 self.assertAlmostEqual(transform1.y[-1], 0, 5) 84 85 def transform_callback(self, transforms): 79 86 self.transformation = transforms 80 87 … … 110 117 111 118 def load_data(filename="98929.txt"): 112 data = np.loadtxt(fi lename, dtype=np.float64)119 data = np.loadtxt(find(filename), dtype=np.float64) 113 120 q = data[:,0] 114 121 iq = data[:,1]
Note: See TracChangeset
for help on using the changeset viewer.