-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definition Graph Visualization for noWorkflow #165
Conversation
Adds definition graph
Fix history and nowvis npm packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I left some comments on the files. Can you check if it is feasible to do these changes?
TrialAst class constructs and manages ASTs based on trial's code_components and compositions. To fetch the AST data, use the new route. Example JSON response: { "ast": { "08ece614-f5ae-4e65-93a0-5a8b44ac9a44": "Module(body=[Import(names=.[alias(name='numpy', asname='np')]), Import(names=[alias(name='matplotlib.pyplot', asname='plt')]), ImportFrom(module='precipitation', names=[alias(name='read'), alias(name='prepare')], level=0), FunctionDef(name='bar_graph', args=arguments(posonlyargs=[], args=[arg(arg='years')], kwonlyargs=[], kw_defaults=[], defaults=[]), body=[Global(names=['PREC', ' MONTHS']), Expr(value=Call(func=Name(id='prepare', ctx=Load()), args=[Name(id='PREC', ctx=Load()), Name(id='MONTHS', ctx=Load()), Name(id='years', ctx=Load()), Name(id='plt', ctx=Load())], keywords=[])), Expr(value=Call(func=Attribute(value=Name(id='plt', ctx=Load()), attr='savefig', ctx=Load()), args=[Constant(value='\"out.png\"')], keywords=[]))], decorator_list=[], type_params=[]), Assign(targets=[Name(id='MONTHS', ctx=Load())], value=BinOp(left=Call(func=Attribute(value=Name(id='np', ctx=Load()), attr='arange', ctx=Load()), args=[Constant(value='12')], keywords=[]), op=Add(), right=Constant(value='1'))), Assign(targets=[Tuple(elts=[Name(id='d13', ctx=Load()), Name(id='d14', ctx=Load())], ctx=Load())], value=Tuple(elts=[Call(func=Name(id='read', ctx=Load()), args=[Constant(value=\"'p13.dat'\")], keywords=[]), Call(func=Name(id='read', ctx=Load()), args=[Constant(value=\"'p14.dat'\")], keywords=[])], ctx=Load())), Assign(targets=[Name(id='PREC', ctx=Load()), Tuple(elts=[Name(id='prec13', ctx=Load()), Name(id='prec14', ctx=Load())], ctx=Load())], value=Tuple(elts=[List(elts=[], ctx=Load()), List(elts=[], ctx=Load())], ctx=Load())), For(target=Name(id='i', ctx=Load()), iter=Name(id='MONTHS', ctx=Load()), body=[Expr(value=Call(func=Attribute(value=Name(id='prec13', ctx=Load()), attr='append', ctx=Load()), args=[Call(func=Name(id='sum', ctx=Load()), args=[Subscript(value=Name(id='d13', ctx=Load()), slice=Name(id='i', ctx=Load()), ctx=Load())], keywords=[])], keywords=[])), Expr(value=Call(func=Attribute(value=Name(id='prec14', ctx=Load()), attr='append', ctx=Load()), args=[Call(func=Name(id='sum', ctx=Load()), args=[Subscript(value=Name(id='d14', ctx=Load()), slice=Name(id='i', ctx=Load()), ctx=Load())], keywords=[])], keywords=[]))], orelse=[]), Expr(value=Call(func=Name(id='bar_graph', ctx=Load()), args=[List(elts=[Constant(value=\"'2013'\"), Constant(value=\"'2014'\")], ctx=Load())], keywords=[]))], type_ignores=[])" }, "trial": "08ece614-f5ae-4e65-93a0-5a8b44ac9a44" }
I've made the definiton_tree to be a new mode for trial_graph. Don't know if As for |
Everything looks good in the source code! I'll try to run it here to check for other issues. Thanks! |
Oh, I have two additional requests. First, can you add a section in the README.md that briefly describes the definition graph and possibility of diff, with figures. Second: before creating the now vis definition graph, you had a graphviz version, right? Is it working? Maybe you can submit another pull request for a command line that exports it. Like, |
Okay, I've made labelling changes for the nodes. The README also mentions the definition graph. Does the README look good? |
`now ast [trial] -j (--json) -d (--dot)`
-a (--activation) print tree edit distance of trial's activation graph -d (--definition) print tree edit distance of trial's definition graph
Google Summer Code 2024 Final Report
This pull request marks the final submission for my Google Summer of Code (GSoC) 2024 project, "Verify the reproducibility of an experiment". The primary objective of this project was to identify discrepancies in a trial's provenance data and compare them. The current implementation can differentiate trials using the
now vis
application, but it only does so through the trial's activations.now vis
command now includes a new feature for displaying a trial's definition graph. Here, the definition refers to the trial's code_component representation and its relationships based on the trial's composition. This graph provides a visual representation of the trial's definition, structured as a tree similar to an Abstract Syntax Tree (AST).now ast
command has been introduced to represent a generated AST structure of a trial. Thenow ast
result is using ast module, but it is based on the trial's code_components and compositions rather than the original script. The tool supports two output formats: JSON and Graphviz dot format.now diff
command now includes an option to display discrepancies between trials, either for activations or definitions. The differences are displayed using the APTED algorithm. To display the output of trial differences in Tree Edit Distance, simply add-d
for definition and-a
for activations.