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
78099d8b
Commit
78099d8b
authored
4 months ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Update to the replacement of parameters -> so it doesn't replace a subset by mistake
parent
9b7b4e3f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#14451
failed with stage
in 2 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/call.py
+7
-5
7 additions, 5 deletions
src/call.py
with
7 additions
and
5 deletions
src/call.py
+
7
−
5
View file @
78099d8b
...
@@ -6,7 +6,7 @@ import time
...
@@ -6,7 +6,7 @@ import time
from
.code_
import
Code
from
.code_
import
Code
from
.condition
import
Condition
from
.condition
import
Condition
from
.outils
import
get_next_param
from
.outils
import
get_next_param
,
replace_group1
from
.executor
import
Executor
from
.executor
import
Executor
from
.bioflowinsighterror
import
BioFlowInsightError
from
.bioflowinsighterror
import
BioFlowInsightError
from
.
import
constant
from
.
import
constant
...
@@ -83,7 +83,8 @@ class Call(Executor):
...
@@ -83,7 +83,8 @@ class Call(Executor):
if
(
param
.
get_type
()
==
"
Call
"
):
if
(
param
.
get_type
()
==
"
Call
"
):
#If it's not a function -> then we rewrite it
#If it's not a function -> then we rewrite it
if
(
param
.
get_first_element_called
().
get_type
()
!=
"
Function
"
):
if
(
param
.
get_first_element_called
().
get_type
()
!=
"
Function
"
):
code
=
code
.
replace
(
param
.
get_code
(
get_OG
=
True
),
param_new_name
)
code
=
replace_group1
(
code
,
fr
"
[^\w](
{
re
.
escape
(
param
.
get_code
(
get_OG
=
True
))
}
)
"
,
param_new_name
)
#code = code.replace(param.get_code(get_OG=True), param_new_name)
new_bit
=
param
.
simplify_code
(
new_name
=
param_new_name
)
new_bit
=
param
.
simplify_code
(
new_name
=
param_new_name
)
code
=
code
.
replace
(
tag_to_add
,
f
"
{
tag_to_add
}
\n
{
new_bit
}
"
)
code
=
code
.
replace
(
tag_to_add
,
f
"
{
tag_to_add
}
\n
{
new_bit
}
"
)
...
@@ -91,8 +92,8 @@ class Call(Executor):
...
@@ -91,8 +92,8 @@ class Call(Executor):
elif
(
param
.
get_type
()
==
"
Operation
"
):
elif
(
param
.
get_type
()
==
"
Operation
"
):
#If it's an artificial operation -> we don't need to do anything
#If it's an artificial operation -> we don't need to do anything
if
(
not
param
.
get_artificial_status
()):
if
(
not
param
.
get_artificial_status
()):
code
=
replace_group1
(
code
,
fr
"
[^\w](
{
re
.
escape
(
param
.
get_code
(
get_OG
=
True
))
}
)
"
,
param_new_name
)
code
=
code
.
replace
(
param
.
get_code
(
get_OG
=
True
),
param_new_name
)
#
code = code.replace(param.get_code(get_OG=True), param_new_name)
lines
=
param
.
simplify_code
().
split
(
'
\n
'
)
lines
=
param
.
simplify_code
().
split
(
'
\n
'
)
if
(
len
(
lines
)
==
1
):
if
(
len
(
lines
)
==
1
):
new_bit
=
f
"
{
param_new_name
}
=
{
lines
[
0
]
}
"
new_bit
=
f
"
{
param_new_name
}
=
{
lines
[
0
]
}
"
...
@@ -106,7 +107,8 @@ class Call(Executor):
...
@@ -106,7 +107,8 @@ class Call(Executor):
raise
Exception
(
"
This shouldn
'
t happen
"
)
raise
Exception
(
"
This shouldn
'
t happen
"
)
None
None
elif
(
param
.
get_type
()
==
"
Emitted
"
):
elif
(
param
.
get_type
()
==
"
Emitted
"
):
code
=
code
.
replace
(
param
.
get_code
(
get_OG
=
True
),
param_new_name
)
code
=
replace_group1
(
code
,
fr
"
[^\w](
{
re
.
escape
(
param
.
get_code
(
get_OG
=
True
))
}
)
"
,
param_new_name
)
#code = code.replace(param.get_code(get_OG=True), param_new_name)
new_bit
=
f
"
{
param_new_name
}
=
{
param
.
simplify_code
()
}
"
new_bit
=
f
"
{
param_new_name
}
=
{
param
.
simplify_code
()
}
"
code
=
code
.
replace
(
tag_to_add
,
f
"
{
tag_to_add
}
\n
{
new_bit
}
"
)
code
=
code
.
replace
(
tag_to_add
,
f
"
{
tag_to_add
}
\n
{
new_bit
}
"
)
else
:
else
:
...
...
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