Changeset 3a473ef in sasview for test/corfunc


Ignore:
Timestamp:
Aug 31, 2018 7:13:23 AM (6 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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
Message:

Manual update of test/ directory with changes on master - SASVIEW-996

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/corfunc/test/utest_corfunc.py

    r86ba9d6 r3a473ef  
    44from __future__ import division, print_function 
    55 
     6import os.path 
    67import unittest 
    78import time 
     
    1112from sas.sascalc.corfunc.corfunc_calculator import CorfuncCalculator 
    1213from sas.sascalc.dataloader.data_info import Data1D 
     14 
     15 
     16def find(filename): 
     17    return os.path.join(os.path.dirname(__file__), filename) 
    1318 
    1419 
     
    3136        self.extrapolation = None 
    3237        self.transformation = None 
    33         self.results = [np.loadtxt(filename+"_out.txt").T[2] 
     38        self.results = [np.loadtxt(find(filename+"_out.txt")).T[2] 
    3439                        for filename in ("gamma1", "gamma3", "idf")] 
    3540 
     
    6974        while True: 
    7075            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): 
    7278                break 
    7379 
    74     def transform_callback(self, transforms): 
    75         transform1, transform3, idf = transforms 
     80        transform1, transform3, idf = self.transformation 
    7681        self.assertIsNotNone(transform1) 
    7782        self.assertAlmostEqual(transform1.y[0], 1) 
    7883        self.assertAlmostEqual(transform1.y[-1], 0, 5) 
     84 
     85    def transform_callback(self, transforms): 
    7986        self.transformation = transforms 
    8087 
     
    110117 
    111118def load_data(filename="98929.txt"): 
    112     data = np.loadtxt(filename, dtype=np.float64) 
     119    data = np.loadtxt(find(filename), dtype=np.float64) 
    113120    q = data[:,0] 
    114121    iq = data[:,1] 
Note: See TracChangeset for help on using the changeset viewer.