transonic.analyses.util

Utilities for the analyses

Functions

adapt_code_dependance(func, ...)

Adapt code_dependance to the call of a jitted function in a jitted function:

change_import_name(code_dep, changed_node, ...)

Change the name of changed_node in code_dep by adding "__" + func + "__" at the beginning of the imported module, and return the modified code

dump(node)

extract_returns_annotation(returns, namespace)

extract_variable_annotations(fdef, namespace)

filter_code_typevars(module, duc, ancestors)

Create a filtered code with what is needed to create the annotations

filter_external_code(module, names)

Filter the module to keep only the necessary nodes needed by functions or class in the parameter names

find_path(node, pathfile)

Return the path of node (instance of ast.Import or ast.ImportFrom)

gather_rawcode_comments(node, code_module)

Get the comments in a node

get_annotations(object_def, namespace)

Create the annotations from a definition node

get_exterior_code(codes_dependance, pathfile)

Get all imported functions needed by boosted functions and methods at multiple levels, (i.e get functions needed by functions imported by boosted function) and add them into code_ext

print_dumped(source)

Pretty print the AST

print_unparsed(node)

Print the code corresponding to a tree or a node

Classes

AnalyseLines(main_node)

Analyse to find the last line of a node