Changeset 3c56da87 in sasmodels for sasmodels/kerneldll.py


Ignore:
Timestamp:
Mar 4, 2015 10:55:38 PM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
b89f519
Message:

lint cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    rf734e7d r3c56da87  
    1919    COMPILE = "gcc -shared -fPIC -std=c99 -O2 -Wall %(source)s -o %(output)s -lm" 
    2020elif os.name == 'nt': 
    21     # make sure vcvarsall.bat is called first in order to set compiler, headers, lib paths, etc. 
     21    # call vcvarsall.bat before compiling to set path, headers, libs, etc. 
    2222    if "VCINSTALLDIR" in os.environ: 
    2323        # MSVC compiler is available, so use it. 
     
    2525        # TODO: maybe don't use randomized name for the c file 
    2626        COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /openmp /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
    27         # Can't find VCOMP90.DLL (don't know why), so remove openmp support from windows compiler build 
     27        # Can't find VCOMP90.DLL (don't know why), so remove openmp support 
     28        # from windows compiler build 
    2829        #COMPILE = "cl /nologo /Ox /MD /W3 /GS- /DNDEBUG /Tp%(source)s /link /DLL /INCREMENTAL:NO /MANIFEST /OUT:%(output)s" 
    2930    else: 
     
    123124        self.__dict__ = state 
    124125 
    125     def __call__(self, input): 
     126    def __call__(self, q_input): 
    126127        if self.dll is None: self._load_dll() 
    127         kernel = self.Iqxy if input.is_2D else self.Iq 
    128         return DllKernel(kernel, self.info, input) 
     128        kernel = self.Iqxy if q_input.is_2D else self.Iq 
     129        return DllKernel(kernel, self.info, q_input) 
    129130 
     131    # pylint: disable=no-self-use 
    130132    def make_input(self, q_vectors): 
    131133        """ 
     
    150152    *info* is the module information 
    151153 
    152     *input* is the DllInput q vectors at which the kernel should be 
     154    *q_input* is the DllInput q vectors at which the kernel should be 
    153155    evaluated. 
    154156 
     
    161163    Call :meth:`release` when done with the kernel instance. 
    162164    """ 
    163     def __init__(self, kernel, info, input): 
     165    def __init__(self, kernel, info, q_input): 
    164166        self.info = info 
    165         self.input = input 
     167        self.q_input = q_input 
    166168        self.kernel = kernel 
    167         self.res = np.empty(input.nq, input.dtype) 
    168         dim = '2d' if input.is_2D else '1d' 
     169        self.res = np.empty(q_input.nq, q_input.dtype) 
     170        dim = '2d' if q_input.is_2D else '1d' 
    169171        self.fixed_pars = info['partype']['fixed-'+dim] 
    170172        self.pd_pars = info['partype']['pd-'+dim] 
     
    174176 
    175177    def __call__(self, fixed_pars, pd_pars, cutoff): 
    176         real = np.float32 if self.input.dtype == F32 else np.float64 
     178        real = np.float32 if self.q_input.dtype == F32 else np.float64 
    177179 
    178         nq = c_int(self.input.nq) 
     180        nq = c_int(self.q_input.nq) 
    179181        if pd_pars: 
    180182            cutoff = real(cutoff) 
    181183            loops_N = [np.uint32(len(p[0])) for p in pd_pars] 
    182184            loops = np.hstack(pd_pars) 
    183             loops = np.ascontiguousarray(loops.T, self.input.dtype).flatten() 
     185            loops = np.ascontiguousarray(loops.T, self.q_input.dtype).flatten() 
    184186            p_loops = loops.ctypes.data 
    185187            dispersed = [p_loops, cutoff] + loops_N 
     
    187189            dispersed = [] 
    188190        fixed = [real(p) for p in fixed_pars] 
    189         args = self.input.q_pointers + [self.p_res, nq] + dispersed + fixed 
     191        args = self.q_input.q_pointers + [self.p_res, nq] + dispersed + fixed 
    190192        #print pars 
    191193        self.kernel(*args) 
Note: See TracChangeset for help on using the changeset viewer.