Closed reshinthadithyan closed 2 years ago
Have a look at program_graph.get_program_graph
, with example usage in https://github.com/google-research/python-graphs/blob/main/python_graphs/program_graph_test.py.
It doesn't do exactly what you're asking for. Instead it constructs a "program graph" consisting of AST, data flow, control flow, and lexical edges. It should be possible to write a similar function that only incorporates the data flow edges.
Heads up that data flow is less battle tested than control flow in the library, so there are likely sharp edges along the way.
Let me know if you have any further questions. And if you do write a complete data flow graph function, please consider contributing it back to the library.
@dbieber, Thanks for this awesome work.
Question
control_flow.get_control_flow_graph
, returns a Control Flow Graph for a given Function Object. There is onedata_flow
class, Is there a way to generate a complete Data Flow Graph given a Function Object?Thanks.