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
f568f4c1
Commit
f568f4c1
authored
6 years ago
by
Stefano Borini
Browse files
Options
Downloads
Patches
Plain Diff
Reworked evaluation driver to handle data sources only
parent
25009970
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!120
Allow KPIs to be specified as datasource outputs.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
force_bdss/core_evaluation_driver.py
+6
-16
6 additions, 16 deletions
force_bdss/core_evaluation_driver.py
with
6 additions
and
16 deletions
force_bdss/core_evaluation_driver.py
+
6
−
16
View file @
f568f4c1
...
...
@@ -57,23 +57,17 @@ def execute_workflow(workflow, data_values):
ds_results
=
_compute_layer_results
(
available_data_values
,
layer
,
"
create_data_source
"
)
available_data_values
+=
ds_results
log
.
info
(
"
Computing KPI layer
"
)
kpi_results
=
_compute_layer_results
(
available_data_values
,
workflow
.
kpi_calculators
,
"
create_kpi_calculator
"
)
kpi_results
=
[
dv
for
dv
in
available_data_values
if
dv
.
is_kpi
]
return
kpi_results
def
_compute_layer_results
(
environment_data_values
,
evaluator_models
,
creator_method_name
):
"""
Helper routine.
Performs the evaluation of a single layer.
...
...
@@ -86,12 +80,7 @@ def _compute_layer_results(environment_data_values,
A list of data values to submit to the evaluators.
evaluator_models: list
A list of the models for all the evaluators (data source
or kpi calculator)
creator_method_name: str
A string of the creator method for the evaluator on the
factory (e.g. create_kpi_calculator)
A list of the models for all the data sources
NOTE: The above parameter is going to go away as soon as we move
to unlimited layers and remove the distinction between data sources
...
...
@@ -101,12 +90,12 @@ def _compute_layer_results(environment_data_values,
for
model
in
evaluator_models
:
factory
=
model
.
factory
evaluator
=
getattr
(
factory
,
creat
or_method_name
)
()
data_source
=
factory
.
creat
e_data_source
()
# Get the slots for this data source. These must be matched to
# the appropriate values in the environment data values.
# Matching is by position.
in_slots
,
out_slots
=
evaluator
.
slots
(
model
)
in_slots
,
out_slots
=
data_source
.
slots
(
model
)
# Binding performs the extraction of the specified data values
# satisfying the above input slots from the environment data values
...
...
@@ -125,7 +114,7 @@ def _compute_layer_results(environment_data_values,
factory
.
name
))
try
:
res
=
evaluator
.
run
(
model
,
passed_data_values
)
res
=
data_source
.
run
(
model
,
passed_data_values
)
except
Exception
:
log
.
error
(
"
Evaluation could not be performed. Run method raised
"
"
exception
"
,
exc_info
=
True
)
...
...
@@ -162,6 +151,7 @@ def _compute_layer_results(environment_data_values,
# Add the names as specified by the user.
for
dv
,
output_slot_info
in
zip
(
res
,
model
.
output_slot_info
):
dv
.
name
=
output_slot_info
.
name
dv
.
is_kpi
=
output_slot_info
.
is_kpi
# If the name was not specified, simply discard the value,
# because apparently the user is not interested in it.
...
...
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