Changeset 823e620 in sasmodels for sasmodels/kerneldll.py


Ignore:
Timestamp:
Jan 29, 2016 10:46:54 PM (8 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:
eafc9fa
Parents:
803f835
Message:

delint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    r74667d3 r823e620  
    122122    models are allowed as DLLs. 
    123123    """ 
    124     if callable(info.get('Iq',None)): 
     124    if callable(info.get('Iq', None)): 
    125125        return PyModel(info) 
    126126 
     
    140140    source = generate.convert_type(source, dtype) 
    141141    source_files = generate.sources(info) + [info['filename']] 
    142     dll= dll_path(info, dtype) 
     142    dll = dll_path(info, dtype) 
    143143    newest = max(os.path.getmtime(f) for f in source_files) 
    144     if not os.path.exists(dll) or os.path.getmtime(dll)<newest: 
     144    if not os.path.exists(dll) or os.path.getmtime(dll) < newest: 
    145145        # Replace with a proper temp file 
    146         fid, filename = tempfile.mkstemp(suffix=".c",prefix=tempfile_prefix) 
    147         os.fdopen(fid,"w").write(source) 
     146        fid, filename = tempfile.mkstemp(suffix=".c", prefix=tempfile_prefix) 
     147        os.fdopen(fid, "w").write(source) 
    148148        command = COMPILE%{"source":filename, "output":dll} 
    149149        print("Compile command: "+command) 
     
    160160def load_dll(source, info, dtype="double"): 
    161161    """ 
    162     Create and load a dll corresponding to the source,info pair returned 
     162    Create and load a dll corresponding to the source, info pair returned 
    163163    from :func:`sasmodels.generate.make` compiled for the target precision. 
    164164 
     
    199199        Npd2d = len(self.info['partype']['pd-2d']) 
    200200 
    201         #print("dll",self.dllpath) 
     201        #print("dll", self.dllpath) 
    202202        try: 
    203203            self.dll = ct.CDLL(self.dllpath) 
     
    210210              else c_longdouble) 
    211211        pd_args_1d = [c_void_p, fp] + [c_int]*Npd1d if Npd1d else [] 
    212         pd_args_2d= [c_void_p, fp] + [c_int]*Npd2d if Npd2d else [] 
     212        pd_args_2d = [c_void_p, fp] + [c_int]*Npd2d if Npd2d else [] 
    213213        self.Iq = self.dll[generate.kernel_name(self.info, False)] 
    214214        self.Iq.argtypes = IQ_ARGS + pd_args_1d + [fp]*Nfixed1d 
     
    257257 
    258258    The resulting call method takes the *pars*, a list of values for 
    259     the fixed parameters to the kernel, and *pd_pars*, a list of (value,weight) 
     259    the fixed parameters to the kernel, and *pd_pars*, a list of (value, weight) 
    260260    vectors for the polydisperse parameters.  *cutoff* determines the 
    261261    integration limits: any points with combined weight less than *cutoff* 
Note: See TracChangeset for help on using the changeset viewer.