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
0
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
aa591e04
Commit
aa591e04
authored
3 weeks ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Added check to not try and rewrite the same thing (it was creating an error)
parent
ab4dba41
No related branches found
No related tags found
No related merge requests found
Pipeline
#14513
failed with stage
Stage:
in 2 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/workflow.py
+22
-9
22 additions, 9 deletions
src/workflow.py
with
22 additions
and
9 deletions
src/workflow.py
+
22
−
9
View file @
aa591e04
...
...
@@ -675,17 +675,30 @@ George Marchment, Bryan Brancotte, Marie Schmit, Frédéric Lemoine, Sarah Cohen
new
=
exe
.
get_code
(
get_OG
=
True
).
replace
(
emited
.
get_code
(),
emited
.
get_emits
().
get_origins
()[
0
].
get_code
())
#to_replace.append((exe.get_code(get_OG = True), f"{exe.get_gives()[0].get_code()} = {emited.get_emits().get_origins()[0].get_code()}"))
to_replace
.
append
((
exe
.
get_code
(
get_OG
=
True
),
new
))
#This dictionnary is used to check if the replacement has already been done (in the case of dupliactes in new)
dico_replace
=
{}
for
r
in
to_replace
:
old
,
new
=
r
temp_code
=
code
#Case of channel = channel
if
(
new
.
find
(
"
=
"
)
!=-
1
):
if
(
new
.
split
(
"
=
"
)[
0
].
strip
()
==
new
.
split
(
"
=
"
)[
1
].
strip
()):
new
=
''
#code = code.replace(old, new)
code
=
replace_group1
(
code
,
fr
"
(
{
re
.
escape
(
old
)
}
)[^\w]
"
,
new
)
if
(
temp_code
==
code
):
raise
Exception
(
"
Something went wrong: The code hasn
'
t changed
"
)
need_to_replace
=
True
try
:
t
=
dico_replace
[
old
]
if
(
t
==
new
):
need_to_replace
=
False
else
:
raise
Exception
(
"
This shouldn
'
t happen
"
)
except
:
dico_replace
[
old
]
=
new
if
(
need_to_replace
):
temp_code
=
code
#Case of channel = channel
if
(
new
.
find
(
"
=
"
)
!=-
1
):
if
(
new
.
split
(
"
=
"
)[
0
].
strip
()
==
new
.
split
(
"
=
"
)[
1
].
strip
()):
new
=
''
#code = code.replace(old, new)
code
=
replace_group1
(
code
,
fr
"
(
{
re
.
escape
(
old
)
}
)[^\w]
"
,
new
)
if
(
temp_code
==
code
):
raise
Exception
(
"
Something went wrong: The code hasn
'
t changed
"
)
return
code
...
...
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