Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BioFlow-Insight
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shareFAIR
BioFlow-Insight
Commits
fdf81599
Commit
fdf81599
authored
2 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Update ternary operation calculation
parent
78099d8b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#14452
failed with stage
in 2 minutes and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/code_.py
+1
-1
1 addition, 1 deletion
src/code_.py
src/workflow.py
+2
-25
2 additions, 25 deletions
src/workflow.py
with
3 additions
and
26 deletions
src/code_.py
+
1
−
1
View file @
fdf81599
...
@@ -46,7 +46,7 @@ class Code:
...
@@ -46,7 +46,7 @@ class Code:
#This methods rewrite ternary operation into "normal" conditions
#This methods rewrite ternary operation into "normal" conditions
#variable = (condition) ? Expression2 : Expression3;
#variable = (condition) ? Expression2 : Expression3;
def
rewrite_ternary_operation_to_normal_condition
(
self
,
code
):
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
=
[]
to_replace
=
[]
for
match
in
re
.
finditer
(
pattern
,
code
):
for
match
in
re
.
finditer
(
pattern
,
code
):
variable
=
match
.
group
(
1
)
variable
=
match
.
group
(
1
)
...
...
This diff is collapsed.
Click to expand it.
src/workflow.py
+
2
−
25
View file @
fdf81599
...
@@ -532,7 +532,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -532,7 +532,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
self
.
initialise
()
self
.
initialise
()
self
.
graph
.
initialise
(
processes_2_remove
=
self
.
processes_2_remove
)
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
)):
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
):
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_OG
"
,
temp_spec_graph
,
render_graphs
=
True
)
generate_graph
(
self
.
get_output_dir
()
/
"
debug
"
/
"
spec_graph
"
,
self
.
graph
.
full_dico
,
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
...
@@ -769,10 +768,8 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
return
broken_subworkflows
return
broken_subworkflows
#Get the clusters and the code
#Get the clusters and the code
print
(
"
Calculating user view ....
"
)
relevant_processes
=
self
.
check_relevant_processes_in_workflow
(
relevant_processes
)
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
)
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
()
clusters
=
self
.
graph
.
get_clusters_from_user_view
()
broken_subworkflows
=
get_workflows_broken
(
get_subworkflow_2_executors
(),
get_clusters_with_calls
(
clusters
))
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
...
@@ -790,9 +787,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
clusters
=
self
.
graph
.
get_clusters_from_user_view
()
clusters
=
self
.
graph
.
get_clusters_from_user_view
()
broken_subworkflows
=
get_workflows_broken
(
get_subworkflow_2_executors
(),
get_clusters_with_calls
(
clusters
))
broken_subworkflows
=
get_workflows_broken
(
get_subworkflow_2_executors
(),
get_clusters_with_calls
(
clusters
))
#print(code)
#Get the clsuters with the corresponding operations inside
#Get the clsuters with the corresponding operations inside
...
@@ -803,16 +797,8 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -803,16 +797,8 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
#Get the topological order
#Get the topological order
executors_in_order
=
self
.
get_order_execution_executors
()
executors_in_order
=
self
.
get_order_execution_executors
()
new_clusters
=
[]
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
:
for
cluster
in
clusters
:
tab
=
[]
tab
=
[]
for
e
in
executors_in_order
:
for
e
in
executors_in_order
:
...
@@ -822,15 +808,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
...
@@ -822,15 +808,6 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
clusters
=
new_clusters
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)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment