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
5 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
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):
temp_dico
[
'
edges
'
]
=
[]
temp_dico
[
'
subworkflows
'
]
=
{}
sub
.
get_structure
(
temp_dico
)
dico
[
'
subworkflows
'
][
sub
.
get_
alias
()]
=
temp_dico
dico
[
'
subworkflows
'
][
sub
.
get_
printed_name
()]
=
temp_dico
param_index
=
0
def
add_parameter
(
p
,
param_index
):
...
...
@@ -413,8 +413,9 @@ class Call(Executor):
#If the elements need to duplicated -> then we need to duplicate it
if
(
self
.
get_duplicate_status
()):
temp
=
process
process
=
process
.
copy
()
process
,
num
=
process
.
copy
()
process
.
set_alias
(
temp
.
get_alias
())
process
.
set_printed_name
(
f
"
{
temp
.
get_alias
()
}
_
{
num
}
"
)
process
.
initialise
()
self
.
first_element_called
=
process
self
.
origin
.
add_element_to_elements_being_called
(
process
)
...
...
@@ -422,8 +423,9 @@ class Call(Executor):
if
(
process
==
None
and
subworkflow
!=
None
and
fun
==
None
):
if
(
self
.
get_duplicate_status
()):
temp
=
subworkflow
subworkflow
=
subworkflow
.
copy
()
subworkflow
,
num
=
subworkflow
.
copy
()
subworkflow
.
set_alias
(
temp
.
get_alias
())
subworkflow
.
set_printed_name
(
f
"
{
temp
.
get_alias
()
}
_
{
num
}
"
)
subworkflow
.
initialise
()
self
.
first_element_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):
for
match
in
re
.
finditer
(
pattern_as
,
include
):
found
=
True
#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
))
self
.
defines
[
match
.
group
(
3
)]
=
thing_as
#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):
self
.
called_by
=
[]
#List of calls
self
.
initialised
=
False
self
.
number_times_copied
=
0
def
copy
(
self
):
...
...
@@ -46,17 +47,28 @@ class Process(Nextflow_Building_Blocks):
process
.
script_code
=
""
process
.
called_by
=
[]
#List of calls
process
.
initialised
=
False
return
process
num
=
self
.
number_times_copied
self
.
number_times_copied
+=
1
return
process
,
num
def
add_to_emits
(
self
,
emit
):
self
.
later_emits
.
append
(
emit
)
def
get_later_emits
(
self
):
return
self
.
later_emits
def
set_alias
(
self
,
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
):
return
self
.
number_times_called
...
...
@@ -69,8 +81,6 @@ class Process(Nextflow_Building_Blocks):
def
get_call
(
self
):
return
self
.
call
def
get_alias
(
self
):
return
self
.
alias
def
get_script_code
(
self
):
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):
Main
.
__init__
(
self
,
code
,
nextflow_file
)
self
.
name
=
name
.
replace
(
"'"
,
""
).
replace
(
'"'
,
''
)
self
.
alias
=
self
.
name
self
.
printed_name
=
self
.
name
#These are the different parts of of a subworkflow -> work corresponds to the main
self
.
take
=
[]
self
.
takes_channels
=
[]
...
...
@@ -28,10 +29,12 @@ class Subworkflow(Main):
self
.
number_times_called
=
0
self
.
called_by
=
[]
#List of calls
self
.
number_times_copied
=
0
def
copy
(
self
):
sub
=
copy
.
copy
(
self
)
sub
.
alias
=
self
.
name
sub
.
printed_name
=
self
.
printed_name
sub
.
take
=
[]
sub
.
takes_channels
=
[]
sub
.
work
=
None
...
...
@@ -41,7 +44,9 @@ class Subworkflow(Main):
sub
.
later_emits
=
[]
sub
.
number_times_called
=
0
sub
.
called_by
=
[]
return
sub
num
=
self
.
number_times_copied
self
.
number_times_copied
+=
1
return
sub
,
num
#TODO make sure this is uptodate
def
get_calls_by_name
(
self
,
name
):
...
...
@@ -81,8 +86,14 @@ class Subworkflow(Main):
def
set_alias
(
self
,
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_type
(
self
):
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