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
359ecbfb
Commit
359ecbfb
authored
1 month ago
by
George Marchment
Browse files
Options
Downloads
Patches
Plain Diff
Added filter to flag when a condition is not extracted correctly
parent
74de56c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#14655
failed with stage
in 2 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/code_.py
+8
-1
8 additions, 1 deletion
src/code_.py
with
8 additions
and
1 deletion
src/code_.py
+
8
−
1
View file @
359ecbfb
from
.outils
import
remove_comments
,
get_parenthese_count
,
get_curly_count
,
get_code_until_parenthese_count
,
extract_curly
from
.outils
import
remove_comments
,
get_parenthese_count
,
get_curly_count
,
get_code_until_parenthese_count
,
extract_curly
,
get_next_element_caracter
from
.bioflowinsighterror
import
BioFlowInsightError
import
re
from
.
import
constant
...
...
@@ -100,6 +100,7 @@ class Code:
temp_code
=
code
[
start
:]
for
match
in
re
.
finditer
(
pattern
,
temp_code
):
if
(
match
.
span
(
0
)[
0
]
==
0
):
_
,
end_line
=
match
.
span
(
0
)
found_if_bloc
=
True
all
=
match
.
group
(
0
)
extarcted
=
match
.
group
(
2
).
strip
()
...
...
@@ -113,6 +114,12 @@ class Code:
if
(
body
!=
""
and
body
[
0
]
!=
"
{
"
):
new
=
f
"
if (
{
condition
}
) {{
\n
{
body
}
\n
}}
\n
"
to_replace
.
append
((
all
,
new
))
elif
(
body
==
""
):
char
,
pos
=
get_next_element_caracter
(
temp_code
,
end_line
)
if
(
char
!=
"
{
"
):
raise
BioFlowInsightError
(
f
"
The condition
'
(
{
extracted_condition
}
'
was not extracted correctly. Make sure the condition follows the correct syntaxe.
"
,
type
=
"
Unable to extract condition
"
)
start
+=
1
...
...
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