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
b55e7a50
Commit
b55e7a50
authored
2 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
optimised the implementation of the user view
parent
0b8e77c8
No related branches found
No related tags found
No related merge requests found
Pipeline
#14444
failed with stage
in 2 minutes and 29 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/code_.py
+6
-0
6 additions, 0 deletions
src/code_.py
src/outils_graph.py
+108
-29
108 additions, 29 deletions
src/outils_graph.py
with
114 additions
and
29 deletions
src/code_.py
+
6
−
0
View file @
b55e7a50
...
...
@@ -22,6 +22,7 @@ class Code:
self
.
code_wo_comments
=
self
.
code_wo_comments
.
replace
(
"
||
"
,
"
$OR$
"
)
self
.
code_wo_comments
=
self
.
turn_single_condition_into_multiline
(
self
.
code_wo_comments
)
self
.
code_wo_comments
=
self
.
rewrite_ternary_operation_to_normal_condition
(
self
.
code_wo_comments
)
self
.
code_wo_comments
=
self
.
rewrite_jump_dot
(
self
.
code_wo_comments
)
def
check_its_nextflow
(
self
):
...
...
@@ -61,6 +62,11 @@ class Code:
code
=
code
.
replace
(
old
,
new
)
return
code
def
rewrite_jump_dot
(
self
,
code
):
pattern
=
r
"
\n *\.
"
code
=
re
.
sub
(
pattern
,
'
.
'
,
code
)
return
code
def
get_line
(
self
,
bit_of_code
):
code
=
remove_comments
(
self
.
code
)
index
=
code
.
find
(
bit_of_code
)
...
...
This diff is collapsed.
Click to expand it.
src/outils_graph.py
+
108
−
29
View file @
b55e7a50
...
...
@@ -577,34 +577,94 @@ def exist_path_dico(A, B, dico):
return
exists
,
visited
#def nr_path_succ(n, r, dico, R):
# rest_of_R = set(R)-set([r])
# edges = remove_edges_with_node(dico["edges"], rest_of_R)
# exists, _ = exist_path(n, r, edges)
# if(exists):
# return True
# return False
path_exists
=
{}
def
nr_path_succ
(
n
,
r
,
dico
,
R
):
try
:
temp
=
path_exists
[
n
]
except
:
path_exists
[
n
]
=
{}
try
:
temp
=
path_exists
[
n
][
r
]
except
:
path_exists
[
n
][
r
]
=
{}
rest_of_R
=
set
(
R
)
-
set
([
r
])
edges
=
remove_edges_with_node
(
dico
[
"
edges
"
],
rest_of_R
)
exists
,
_
=
exist_path
(
n
,
r
,
edges
)
if
(
exists
):
return
True
return
False
try
:
temp
=
path_exists
[
n
][
r
][
str
(
rest_of_R
)]
return
temp
except
:
edges
=
remove_edges_with_node
(
dico
[
"
edges
"
],
rest_of_R
)
exists
,
_
=
exist_path
(
n
,
r
,
edges
)
path_exists
[
n
][
r
][
str
(
rest_of_R
)]
=
exists
return
exists
#def nr_path_pred(r, n, dico, R):
# rest_of_R = set(R)-set([r])
# edges = remove_edges_with_node(dico["edges"], rest_of_R)
# exists, _ = exist_path(r, n, edges)
# if(exists):
# return True
# return False
def
nr_path_pred
(
r
,
n
,
dico
,
R
):
try
:
temp
=
path_exists
[
r
]
except
:
path_exists
[
r
]
=
{}
try
:
temp
=
path_exists
[
r
][
n
]
except
:
path_exists
[
r
][
n
]
=
{}
rest_of_R
=
set
(
R
)
-
set
([
r
])
edges
=
remove_edges_with_node
(
dico
[
"
edges
"
],
rest_of_R
)
exists
,
_
=
exist_path
(
r
,
n
,
edges
)
if
(
exists
):
return
True
return
False
try
:
temp
=
path_exists
[
r
][
n
][
str
(
rest_of_R
)]
return
temp
except
:
edges
=
remove_edges_with_node
(
dico
[
"
edges
"
],
rest_of_R
)
exists
,
_
=
exist_path
(
r
,
n
,
edges
)
path_exists
[
r
][
n
][
str
(
rest_of_R
)]
=
exists
return
exists
##Added a dico so it knows what it's already searched
#dico_rSucc = {}
#def rSucc(n, dico, R, outputs):
# #try:
# # tab = dico_rSucc[n]
# #except:
# tab = []
# for r in set(R).union(set(outputs)):
# if(nr_path_succ(n, r, dico, R+list(outputs))):
# tab.append(r)
# dico_rSucc[n] = tab
# return tab
#Added a dico so it knows what it's already searched
dico_rSucc
=
{}
def
rSucc
(
n
,
dico
,
R
,
outputs
):
#try:
# tab = dico_rSucc[n]
#except:
tab
=
[]
for
r
in
set
(
R
).
union
(
set
(
outputs
)):
if
(
nr_path_succ
(
n
,
r
,
dico
,
R
+
list
(
outputs
))):
tab
.
append
(
r
)
dico_rSucc
[
n
]
=
tab
return
tab
try
:
temp
=
dico_rSucc
[
n
]
except
:
dico_rSucc
[
n
]
=
{}
union_set
=
set
(
R
).
union
(
set
(
outputs
))
try
:
temp
=
dico_rSucc
[
n
][
str
(
union_set
)]
return
temp
except
:
tab
=
[]
for
r
in
union_set
:
if
(
nr_path_succ
(
n
,
r
,
dico
,
R
+
list
(
outputs
))):
tab
.
append
(
r
)
dico_rSucc
[
n
][
str
(
union_set
)]
=
tab
return
tab
def
rSuccM
(
M
,
dico
,
R
,
outputs
):
tab
=
[]
...
...
@@ -612,18 +672,37 @@ def rSuccM(M, dico, R, outputs):
tab
+=
rSucc
(
n
,
dico
,
R
,
outputs
)
return
list
(
set
(
tab
))
#Added a dico so it knows what it's already searched
#dico_rPred = {}
#def rPred(n, dico, R, inputs):
# #try:
# # tab = dico_rPred[n]
# #except:
# tab = []
# for r in set(R).union(set(inputs)):
# if(nr_path_pred(r, n, dico, R+list(inputs))):
# tab.append(r)
# dico_rPred[n] = tab
# return tab
#Added a dico so it knows what it's already searched
dico_rPred
=
{}
def
rPred
(
n
,
dico
,
R
,
inputs
):
#try:
# tab = dico_rPred[n]
#except:
tab
=
[]
for
r
in
set
(
R
).
union
(
set
(
inputs
)):
if
(
nr_path_pred
(
r
,
n
,
dico
,
R
+
list
(
inputs
))):
tab
.
append
(
r
)
dico_rPred
[
n
]
=
tab
return
tab
try
:
temp
=
dico_rPred
[
n
]
except
:
dico_rPred
[
n
]
=
{}
union_set
=
set
(
R
).
union
(
set
(
inputs
))
try
:
temp
=
dico_rPred
[
n
][
str
(
union_set
)]
return
temp
except
:
tab
=
[]
for
r
in
union_set
:
if
(
nr_path_pred
(
r
,
n
,
dico
,
R
+
list
(
inputs
))):
tab
.
append
(
r
)
dico_rPred
[
n
][
str
(
union_set
)]
=
tab
return
tab
def
rPredM
(
M
,
dico
,
R
,
inputs
):
tab
=
[]
...
...
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