diff --git a/src/code_.py b/src/code_.py index 1e40f36753782533db9d17e052d6370bff9c54c0..b256be2915eecbdecc433ea37bdad9dd10d3838e 100644 --- a/src/code_.py +++ b/src/code_.py @@ -46,7 +46,7 @@ class Code: #This methods rewrite ternary operation into "normal" conditions #variable = (condition) ? Expression2 : Expression3; def rewrite_ternary_operation_to_normal_condition(self, code): - pattern = r"(\w+) *\= *([^?\n]+) *\? *([^:\n]+) *\: *([^\n]+)\n" + pattern = r"(\w+) *\= *([\w][^?\n]+) *\? *([^:\n]+) *\: *([^\n]+)\n" to_replace = [] for match in re.finditer(pattern, code): variable = match.group(1) diff --git a/src/workflow.py b/src/workflow.py index 69eb6c98df8313fd4843045abddece526120f323..e4ecebc6e28a960e892fbbd3e8a63f43b69f3822 100644 --- a/src/workflow.py +++ b/src/workflow.py @@ -532,7 +532,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen self.initialise() self.graph.initialise(processes_2_remove = self.processes_2_remove) if(not self.graph.check_if_process_dependendy_is_equivalent_to_other_without_subworkflows(temp_process_dependency_graph)): - print(render_graphs) if(render_graphs==True): generate_graph(self.get_output_dir()/ "debug" /"spec_graph_OG", temp_spec_graph, render_graphs = True) generate_graph(self.get_output_dir()/ "debug" /"spec_graph", self.graph.full_dico, render_graphs = True) @@ -769,10 +768,8 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen return broken_subworkflows #Get the clusters and the code - print("Calculating user view ....") relevant_processes = self.check_relevant_processes_in_workflow(relevant_processes) self.generate_user_view(relevant_processes = relevant_processes, processes_2_remove = [], render_graphs=render_graphs) - print("Finished user view") clusters = self.graph.get_clusters_from_user_view() broken_subworkflows = get_workflows_broken(get_subworkflow_2_executors(), get_clusters_with_calls(clusters)) @@ -790,9 +787,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen clusters = self.graph.get_clusters_from_user_view() broken_subworkflows = get_workflows_broken(get_subworkflow_2_executors(), get_clusters_with_calls(clusters)) - #print(code) - - #Get the clsuters with the corresponding operations inside @@ -803,16 +797,8 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen #Get the topological order executors_in_order = self.get_order_execution_executors() new_clusters = [] - #for clust in clusters: - # print("*") - # for c in clust: - # if(c.get_type()=="Process"): - # print(c, c.get_code()[:20]) - # else: - # print(c, c.get_code()[:20], c.artificial) - - for c in clusters: - print(len(c)) + + for cluster in clusters: tab = [] for e in executors_in_order: @@ -822,15 +808,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen clusters = new_clusters - #clusters = self.graph.get_topogical_order(clusters) - #print('_________________') - #for clust in clusters: - # print("*") - # for c in clust: - # if(c.get_type()=="Process"): - # print(c, c.get_code()[:20]) - # else: - # print(c, c.get_code()[:20], c.artificial)