SciPy.org SciPy 0.6.0 API Documentation Generated by Endo, 2007-10-17

Track relationships between compiled extension functions & code fragments

catalog keeps track of which compiled(or even standard) functions are related to which code fragments. It also stores these relationships to disk so they are remembered between Python sessions. When

a = 1 compiler.inline('printf("printed from C: %d",a);',['a'] )

is called, inline() first looks to see if it has seen the code 'printf("printed from C");' before. If not, it calls

catalog.get_functions('printf("printed from C: %d", a);')

which returns a list of all the function objects that have been compiled for the code fragment. Multiple functions can occur because the code could be compiled for different types for 'a' (although not likely in this case). The catalog first looks in its cache and quickly returns a list of the functions if possible. If the cache lookup fails, it then looks through possibly multiple catalog files on disk and fills its cache with all the functions that match the code fragment.

In case where the code fragment hasn't been compiled, inline() compiles the code and then adds it to the catalog:

function = <code to compile function> catalog.add_function('printf("printed from C: %d", a);',function)

add_function() adds function to the front of the cache. function, along with the path information to its module, are also stored in a persistent catalog for future use by python sessions.

Classes

Function summary

Functions

Imported Names

Local nameRefers to
osos
picklepickle
socketsocket
stringstring
syssys
tempfiletempfile