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
61c0317f
Commit
61c0317f
authored
4 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Fix weird bug with the subworkflows not being duplicated -> cause they had the same name
parent
fef4742a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#14347
failed with stage
in 2 minutes and 39 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/call.py
+5
-3
5 additions, 3 deletions
src/call.py
src/include.py
+1
-1
1 addition, 1 deletion
src/include.py
src/process.py
+14
-4
14 additions, 4 deletions
src/process.py
src/subworkflow.py
+12
-1
12 additions, 1 deletion
src/subworkflow.py
with
32 additions
and
9 deletions
src/call.py
+
5
−
3
View file @
61c0317f
...
@@ -286,7 +286,7 @@ class Call(Executor):
...
@@ -286,7 +286,7 @@ class Call(Executor):
temp_dico
[
'
edges
'
]
=
[]
temp_dico
[
'
edges
'
]
=
[]
temp_dico
[
'
subworkflows
'
]
=
{}
temp_dico
[
'
subworkflows
'
]
=
{}
sub
.
get_structure
(
temp_dico
)
sub
.
get_structure
(
temp_dico
)
dico
[
'
subworkflows
'
][
sub
.
get_
alias
()]
=
temp_dico
dico
[
'
subworkflows
'
][
sub
.
get_
printed_name
()]
=
temp_dico
param_index
=
0
param_index
=
0
def
add_parameter
(
p
,
param_index
):
def
add_parameter
(
p
,
param_index
):
...
@@ -413,8 +413,9 @@ class Call(Executor):
...
@@ -413,8 +413,9 @@ class Call(Executor):
#If the elements need to duplicated -> then we need to duplicate it
#If the elements need to duplicated -> then we need to duplicate it
if
(
self
.
get_duplicate_status
()):
if
(
self
.
get_duplicate_status
()):
temp
=
process
temp
=
process
process
=
process
.
copy
()
process
,
num
=
process
.
copy
()
process
.
set_alias
(
temp
.
get_alias
())
process
.
set_alias
(
temp
.
get_alias
())
process
.
set_printed_name
(
f
"
{
temp
.
get_alias
()
}
_
{
num
}
"
)
process
.
initialise
()
process
.
initialise
()
self
.
first_element_called
=
process
self
.
first_element_called
=
process
self
.
origin
.
add_element_to_elements_being_called
(
process
)
self
.
origin
.
add_element_to_elements_being_called
(
process
)
...
@@ -422,8 +423,9 @@ class Call(Executor):
...
@@ -422,8 +423,9 @@ class Call(Executor):
if
(
process
==
None
and
subworkflow
!=
None
and
fun
==
None
):
if
(
process
==
None
and
subworkflow
!=
None
and
fun
==
None
):
if
(
self
.
get_duplicate_status
()):
if
(
self
.
get_duplicate_status
()):
temp
=
subworkflow
temp
=
subworkflow
subworkflow
=
subworkflow
.
copy
()
subworkflow
,
num
=
subworkflow
.
copy
()
subworkflow
.
set_alias
(
temp
.
get_alias
())
subworkflow
.
set_alias
(
temp
.
get_alias
())
subworkflow
.
set_printed_name
(
f
"
{
temp
.
get_alias
()
}
_
{
num
}
"
)
subworkflow
.
initialise
()
subworkflow
.
initialise
()
self
.
first_element_called
=
subworkflow
self
.
first_element_called
=
subworkflow
self
.
origin
.
add_element_to_elements_being_called
(
subworkflow
)
self
.
origin
.
add_element_to_elements_being_called
(
subworkflow
)
...
...
This diff is collapsed.
Click to expand it.
src/include.py
+
1
−
1
View file @
61c0317f
...
@@ -117,7 +117,7 @@ class Include(Nextflow_Building_Blocks):
...
@@ -117,7 +117,7 @@ class Include(Nextflow_Building_Blocks):
for
match
in
re
.
finditer
(
pattern_as
,
include
):
for
match
in
re
.
finditer
(
pattern_as
,
include
):
found
=
True
found
=
True
#if(self.get_duplicate_status()):
#if(self.get_duplicate_status()):
thing_as
=
self
.
nextflow_file
.
get_element_from_name
(
match
.
group
(
1
)).
copy
()
thing_as
,
num
=
self
.
nextflow_file
.
get_element_from_name
(
match
.
group
(
1
)).
copy
()
thing_as
.
set_alias
(
match
.
group
(
3
))
thing_as
.
set_alias
(
match
.
group
(
3
))
self
.
defines
[
match
.
group
(
3
)]
=
thing_as
self
.
defines
[
match
.
group
(
3
)]
=
thing_as
#else:
#else:
...
...
This diff is collapsed.
Click to expand it.
src/process.py
+
14
−
4
View file @
61c0317f
...
@@ -29,6 +29,7 @@ class Process(Nextflow_Building_Blocks):
...
@@ -29,6 +29,7 @@ class Process(Nextflow_Building_Blocks):
self
.
called_by
=
[]
#List of calls
self
.
called_by
=
[]
#List of calls
self
.
initialised
=
False
self
.
initialised
=
False
self
.
number_times_copied
=
0
def
copy
(
self
):
def
copy
(
self
):
...
@@ -46,17 +47,28 @@ class Process(Nextflow_Building_Blocks):
...
@@ -46,17 +47,28 @@ class Process(Nextflow_Building_Blocks):
process
.
script_code
=
""
process
.
script_code
=
""
process
.
called_by
=
[]
#List of calls
process
.
called_by
=
[]
#List of calls
process
.
initialised
=
False
process
.
initialised
=
False
return
process
num
=
self
.
number_times_copied
self
.
number_times_copied
+=
1
return
process
,
num
def
add_to_emits
(
self
,
emit
):
def
add_to_emits
(
self
,
emit
):
self
.
later_emits
.
append
(
emit
)
self
.
later_emits
.
append
(
emit
)
def
get_later_emits
(
self
):
def
get_later_emits
(
self
):
return
self
.
later_emits
return
self
.
later_emits
def
set_alias
(
self
,
alias
):
def
set_alias
(
self
,
alias
):
self
.
alias
=
alias
self
.
alias
=
alias
def
set_printed_name
(
self
,
name
):
self
.
printed_name
=
name
def
get_alias
(
self
):
return
self
.
alias
def
get_printed_name
(
self
):
return
self
.
printed_name
def
get_number_times_called
(
self
):
def
get_number_times_called
(
self
):
return
self
.
number_times_called
return
self
.
number_times_called
...
@@ -69,8 +81,6 @@ class Process(Nextflow_Building_Blocks):
...
@@ -69,8 +81,6 @@ class Process(Nextflow_Building_Blocks):
def
get_call
(
self
):
def
get_call
(
self
):
return
self
.
call
return
self
.
call
def
get_alias
(
self
):
return
self
.
alias
def
get_script_code
(
self
):
def
get_script_code
(
self
):
return
self
.
script_code
return
self
.
script_code
...
...
This diff is collapsed.
Click to expand it.
src/subworkflow.py
+
12
−
1
View file @
61c0317f
...
@@ -15,6 +15,7 @@ class Subworkflow(Main):
...
@@ -15,6 +15,7 @@ class Subworkflow(Main):
Main
.
__init__
(
self
,
code
,
nextflow_file
)
Main
.
__init__
(
self
,
code
,
nextflow_file
)
self
.
name
=
name
.
replace
(
"'"
,
""
).
replace
(
'"'
,
''
)
self
.
name
=
name
.
replace
(
"'"
,
""
).
replace
(
'"'
,
''
)
self
.
alias
=
self
.
name
self
.
alias
=
self
.
name
self
.
printed_name
=
self
.
name
#These are the different parts of of a subworkflow -> work corresponds to the main
#These are the different parts of of a subworkflow -> work corresponds to the main
self
.
take
=
[]
self
.
take
=
[]
self
.
takes_channels
=
[]
self
.
takes_channels
=
[]
...
@@ -28,10 +29,12 @@ class Subworkflow(Main):
...
@@ -28,10 +29,12 @@ class Subworkflow(Main):
self
.
number_times_called
=
0
self
.
number_times_called
=
0
self
.
called_by
=
[]
#List of calls
self
.
called_by
=
[]
#List of calls
self
.
number_times_copied
=
0
def
copy
(
self
):
def
copy
(
self
):
sub
=
copy
.
copy
(
self
)
sub
=
copy
.
copy
(
self
)
sub
.
alias
=
self
.
name
sub
.
alias
=
self
.
name
sub
.
printed_name
=
self
.
printed_name
sub
.
take
=
[]
sub
.
take
=
[]
sub
.
takes_channels
=
[]
sub
.
takes_channels
=
[]
sub
.
work
=
None
sub
.
work
=
None
...
@@ -41,7 +44,9 @@ class Subworkflow(Main):
...
@@ -41,7 +44,9 @@ class Subworkflow(Main):
sub
.
later_emits
=
[]
sub
.
later_emits
=
[]
sub
.
number_times_called
=
0
sub
.
number_times_called
=
0
sub
.
called_by
=
[]
sub
.
called_by
=
[]
return
sub
num
=
self
.
number_times_copied
self
.
number_times_copied
+=
1
return
sub
,
num
#TODO make sure this is uptodate
#TODO make sure this is uptodate
def
get_calls_by_name
(
self
,
name
):
def
get_calls_by_name
(
self
,
name
):
...
@@ -81,8 +86,14 @@ class Subworkflow(Main):
...
@@ -81,8 +86,14 @@ class Subworkflow(Main):
def
set_alias
(
self
,
alias
):
def
set_alias
(
self
,
alias
):
self
.
alias
=
alias
self
.
alias
=
alias
def
set_printed_name
(
self
,
name
):
self
.
printed_name
=
name
def
get_alias
(
self
):
def
get_alias
(
self
):
return
self
.
alias
return
self
.
alias
def
get_printed_name
(
self
):
return
self
.
printed_name
def
get_type
(
self
):
def
get_type
(
self
):
return
"
Subworkflow
"
return
"
Subworkflow
"
...
...
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