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
5872c6ac
Commit
5872c6ac
authored
7 years ago
by
Stefano Borini
Browse files
Options
Downloads
Patches
Plain Diff
Fixed MCO driver
parent
b3b9a7e7
No related branches found
No related tags found
1 merge request
!86
Improve event handling
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
force_bdss/core_mco_driver.py
+7
-7
7 additions, 7 deletions
force_bdss/core_mco_driver.py
with
7 additions
and
7 deletions
force_bdss/core_mco_driver.py
+
7
−
7
View file @
5872c6ac
...
@@ -32,9 +32,7 @@ class CoreMCODriver(BaseCoreDriver):
...
@@ -32,9 +32,7 @@ class CoreMCODriver(BaseCoreDriver):
@on_trait_change
(
"
application:started
"
)
@on_trait_change
(
"
application:started
"
)
def
application_started
(
self
):
def
application_started
(
self
):
self
.
_deliver_start_event
()
self
.
mco
.
run
(
self
.
workflow
.
mco
)
self
.
mco
.
run
(
self
.
workflow
.
mco
)
self
.
_deliver_event
(
MCOFinishEvent
())
@on_trait_change
(
"
application:stopping
"
)
@on_trait_change
(
"
application:stopping
"
)
def
application_stopping
(
self
):
def
application_stopping
(
self
):
...
@@ -53,6 +51,7 @@ class CoreMCODriver(BaseCoreDriver):
...
@@ -53,6 +51,7 @@ class CoreMCODriver(BaseCoreDriver):
mco_factory
=
mco_model
.
factory
mco_factory
=
mco_model
.
factory
return
mco_factory
.
create_optimizer
()
return
mco_factory
.
create_optimizer
()
@on_trait_change
(
"
mco:started
"
)
def
_deliver_start_event
(
self
):
def
_deliver_start_event
(
self
):
output_names
=
[]
output_names
=
[]
for
kpi
in
self
.
workflow
.
kpi_calculators
:
for
kpi
in
self
.
workflow
.
kpi_calculators
:
...
@@ -63,12 +62,13 @@ class CoreMCODriver(BaseCoreDriver):
...
@@ -63,12 +62,13 @@ class CoreMCODriver(BaseCoreDriver):
output_names
=
output_names
output_names
=
output_names
))
))
@on_trait_change
(
"
mco:finished
"
)
def
_deliver_finished_event
(
self
):
self
.
_deliver_event
(
MCOFinishEvent
())
@on_trait_change
(
"
mco:new_data
"
)
@on_trait_change
(
"
mco:new_data
"
)
def
_deliver_progress_event
(
self
,
event
):
def
_deliver_mco_progress_event
(
self
,
data
):
self
.
_deliver_event
(
MCOProgressEvent
(
self
.
_deliver_event
(
MCOProgressEvent
(
**
data
))
input
=
event
[
'
input
'
],
output
=
event
[
'
output
'
]
))
def
_deliver_event
(
self
,
event
):
def
_deliver_event
(
self
,
event
):
"""
Delivers an event to the listeners
"""
"""
Delivers an event to the listeners
"""
...
...
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