np_inline
index
/home/johnl/local/lib/python2.6/site-packages/np_inline.py

 
Modules
       
imp
multiprocessing
numpy
os

 
Functions
       
inline(unique_name, args=(), py_types=(), np_types=(), code=None, code_path=None, support_code=None, support_code_path=None, extension_kwargs={}, return_type=None)
Inline C code in your python code. 
 
Parameters:
unique_name : string
    A unique string identifying this bit of code. This should be valid
    to use as a filename.
args : typle
    The arguments passed to the C function. Currently the code can
    accept python ints and floats, as well as numpy numeric arrays 
    of all types. Numpy objects should always be after other 
    objects, and types should correspond with the definitions given
    in py_types and np_types respectively. 
py_types : typle of tuples (python_type, c_name)
    Type specifications for non-numpy arguments. Currently only int 
    and float are valid types. Default is empty tuple.
np_types : typle of tuples (numpy_type, dims, c_name)
    Type specifications for numpy-type arguments. Most numeric numpy 
    types are valid. dims is the integer number of dimensions of the 
    corresponding array. Default is empty tuple.
code : string, optional 
    C-code. One of code and code_path must be given. 
code_path : string, optional
    Full path to c-code. One of code or code_path should be given.
support_code : string, optional 
    C support code. This code will be inserted before the function 
    containing the c-code above. This can include any valid C code 
    including #includes and #defines.
support_code_path : string, optional
    Full path to support code. 
extension_kwargs : dictionary, optiona
    Keyword arguments to pass to the distutils.Extension constructor.
return_type : python primitive type
    Either int or float.
inline_debug(unique_name, args=(), py_types=(), np_types=(), code=None, code_path=None, support_code=None, support_code_path=None, extension_kwargs={}, return_type=None)
Same as inline, but the types of each argument are checked, and 
the code is recompiled the first time this function is called.