Changeset cb6ecf4 in sasmodels


Ignore:
Timestamp:
Feb 13, 2015 5:20:52 PM (8 years ago)
Author:
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:
b3f6bc3
Parents:
f5b9a6b
Message:

rename gen.py to generate.py for clarity

Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • doc/genmodel.py

    r19dcb933 rcb6ecf4  
    1212 
    1313# Load the doc string from the module definition file and store it in rst 
    14 from sasmodels import gen 
    15 docstr = gen.doc(module) 
     14from sasmodels import generate 
     15docstr = generate.doc(module) 
    1616open(sys.argv[2],'w').write(docstr) 
  • sasmodels/dll.py

    r87c722e rcb6ecf4  
    1010import numpy as np 
    1111 
    12 from . import gen 
    13  
    14 from .gen import F32, F64 
     12from . import generate 
     13 
     14from .generate import F32, F64 
    1515# Compiler platform details 
    1616if sys.platform == 'darwin': 
     
    5252    import tempfile 
    5353 
    54     source, info = gen.make(kernel_module) 
    55     source_files = gen.sources(info) + [info['filename']] 
     54    source, info = generate.make(kernel_module) 
     55    source_files = generate.sources(info) + [info['filename']] 
    5656    newest = max(os.path.getmtime(f) for f in source_files) 
    5757    dllpath = dll_path(info) 
     
    103103        self.dll = ct.CDLL(self.dllpath) 
    104104 
    105         self.Iq = self.dll[gen.kernel_name(self.info, False)] 
     105        self.Iq = self.dll[generate.kernel_name(self.info, False)] 
    106106        self.Iq.argtypes = IQ_ARGS + [c_double]*Nfixed1d + [c_int]*Npd1d 
    107107 
    108         self.Iqxy = self.dll[gen.kernel_name(self.info, True)] 
     108        self.Iqxy = self.dll[generate.kernel_name(self.info, True)] 
    109109        self.Iqxy.argtypes = IQXY_ARGS + [c_double]*Nfixed2d + [c_int]*Npd2d 
    110110 
  • sasmodels/gpu.py

    rf5b9a6b rcb6ecf4  
    2727from pyopencl import mem_flags as mf 
    2828 
    29 from . import gen 
     29from . import generate 
    3030 
    3131F64_DEFS = """\ 
     
    5050    so models can be defined without using too many resources. 
    5151    """ 
    52     source, info = gen.make(kernel_module) 
     52    source, info = generate.make(kernel_module) 
    5353    ## for debugging, save source to a .cl file, edit it, and reload as model 
    5454    #open(info['name']+'.cl','w').write(source) 
     
    112112    """ 
    113113    dtype = np.dtype(dtype) 
    114     if dtype==gen.F64 and not all(has_double(d) for d in context.devices): 
     114    if dtype==generate.F64 and not all(has_double(d) for d in context.devices): 
    115115        raise RuntimeError("Double precision not supported for devices") 
    116116 
    117     header = F64_DEFS if dtype == gen.F64 else "" 
    118     if dtype == gen.F32: 
    119         source = gen.use_single(source) 
     117    header = F64_DEFS if dtype == generate.F64 else "" 
     118    if dtype == generate.F32: 
     119        source = generate.use_single(source) 
    120120    # Note: USE_SINCOS makes the intel cpu slower under opencl 
    121121    if context.devices[0].type == cl.device_type.GPU: 
     
    170170    is an optional extension which may not be available on all devices. 
    171171    """ 
    172     def __init__(self, source, info, dtype=gen.F32): 
     172    def __init__(self, source, info, dtype=generate.F32): 
    173173        self.info = info 
    174174        self.source = source 
     
    189189        if self.program is None: 
    190190            self.program = environment().compile_program(self.info['name'],self.source, self.dtype) 
    191         kernel_name = gen.kernel_name(self.info, input.is_2D) 
     191        kernel_name = generate.kernel_name(self.info, input.is_2D) 
    192192        kernel = getattr(self.program, kernel_name) 
    193193        return GpuKernel(kernel, self.info, input) 
     
    233233    buffer will be released when the data object is freed. 
    234234    """ 
    235     def __init__(self, q_vectors, dtype=gen.F32): 
     235    def __init__(self, q_vectors, dtype=generate.F32): 
    236236        env = environment() 
    237237        self.nq = q_vectors[0].size 
     
    294294 
    295295    def __call__(self, pars, pd_pars, cutoff=1e-5): 
    296         real = np.float32 if self.input.dtype == gen.F32 else np.float64 
     296        real = np.float32 if self.input.dtype == generate.F32 else np.float64 
    297297        fixed = [real(p) for p in pars] 
    298298        cutoff = real(cutoff) 
Note: See TracChangeset for help on using the changeset viewer.