Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
force-bdss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Adham Hashibon
force-bdss
Commits
4b450bb5
Unverified
Commit
4b450bb5
authored
6 years ago
by
Stefano Borini
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #176 from force-h2020/verifier-fix
Verifier Fix
parents
16a69a9d
eba44f03
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
force_bdss/core/tests/test_verifier.py
+1
-1
1 addition, 1 deletion
force_bdss/core/tests/test_verifier.py
force_bdss/core/verifier.py
+13
-12
13 additions, 12 deletions
force_bdss/core/verifier.py
with
14 additions
and
13 deletions
force_bdss/core/tests/test_verifier.py
+
1
−
1
View file @
4b450bb5
...
...
@@ -124,7 +124,7 @@ class TestVerifier(unittest.TestCase):
ds_model
.
output_slot_info
[
0
].
name
=
''
errors
=
verify_workflow
(
wf
)
self
.
assertEqual
(
len
(
errors
),
2
)
self
.
assertIn
(
"
Undefined name for output parameter
"
,
self
.
assertIn
(
"
Undefined name
s
for
all
output parameter
s
"
,
errors
[
1
].
local_error
)
def
test_multi_error_format
(
self
):
...
...
This diff is collapsed.
Click to expand it.
force_bdss/core/verifier.py
+
13
−
12
View file @
4b450bb5
...
...
@@ -11,7 +11,7 @@ class VerifierError(HasStrictTraits):
subject
=
Any
()
#: An error message relevant to the local modelview
local_error
=
Str
()
#: An error message relev
e
nt to the overall workflow
#: An error message relev
a
nt to the overall workflow
global_error
=
Str
()
def
__init__
(
self
,
subject
,
global_error
=
''
,
local_error
=
''
):
...
...
@@ -53,6 +53,7 @@ def _check_mco(workflow):
subject
=
mco
,
global_error
=
"
The MCO has no defined parameters
"
))
#: Check MCO parameters have names and types
for
idx
,
param
in
enumerate
(
mco
.
parameters
):
factory_name
=
param
.
factory
.
name
if
param
.
name
==
''
:
...
...
@@ -69,6 +70,7 @@ def _check_mco(workflow):
global_error
=
"
Error in MCO parameter
"
"
(Type: {})
"
.
format
(
factory_name
)))
#: Check KPIs have names and optimisation objectives
for
idx
,
kpi
in
enumerate
(
mco
.
kpis
):
if
kpi
.
name
==
''
:
errors
.
append
(
VerifierError
(
subject
=
kpi
,
...
...
@@ -151,10 +153,12 @@ def _check_data_source(data_source_model, layer_number):
global_error
=
"
Missing input slot name assignment
"
"
in layer {}
"
.
format
(
layer_number
)))
#: Check if any input slots are unnamed
row_index_errors
=
[]
for
idx
,
info
in
enumerate
(
data_source_model
.
input_slot_info
):
if
info
.
name
==
''
:
row_index_errors
.
append
(
idx
)
if
row_index_errors
!=
[]:
err_no_string
=
multi_error_format
(
row_index_errors
)
if
len
(
row_index_errors
)
==
1
:
...
...
@@ -178,18 +182,15 @@ def _check_data_source(data_source_model, layer_number):
global_error
=
"
Missing output slot name assignment
"
"
in layer {}
"
.
format
(
layer_number
)))
row_index_errors
=
[]
for
idx
,
info
in
enumerate
(
data_source_model
.
output_slot_info
):
if
info
.
name
==
''
:
row_index_errors
.
append
(
idx
)
err_no_string
=
multi_error_format
(
row_index_errors
)
if
len
(
row_index_errors
)
==
1
:
#: Check if the datasource has all outputs unnamed
unnamed
=
[
info
.
name
==
""
for
info
in
data_source_model
.
output_slot_info
]
if
all
(
unnamed
)
and
len
(
unnamed
)
!=
0
:
errors
.
append
(
VerifierError
(
subject
=
data_source_model
,
local_error
=
"
Undefined name for output
"
"
parameters
{}
"
.
format
(
err_no_string
)
,
global_error
=
"
An output parameter is undefined in {}
"
"
(Layer {})
"
.
format
(
factory
.
name
,
layer_number
)))
subject
=
data_source_model
,
local_error
=
"
Undefined name
s
for
all
output
"
"
parameters
"
,
global_error
=
"
An output parameter is undefined in {}
"
"
(Layer {})
"
.
format
(
factory
.
name
,
layer_number
)))
return
errors
...
...
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