Skip to content
Snippets Groups Projects
Commit 3fb56bfe authored by Stefano Borini's avatar Stefano Borini
Browse files

Added documentation

parent 848be820
No related branches found
No related tags found
1 merge request!79Deliver notification info
......@@ -14,7 +14,7 @@ class BaseMCO(ABCHasStrictTraits):
#: A reference to the factory
factory = Instance(IMCOFactory)
#: Must be triggered when an event occurs.
#: Triggered when an event occurs.
event = Event(BaseMCOEvent)
def __init__(self, factory, *args, **kwargs):
......@@ -41,4 +41,16 @@ class BaseMCO(ABCHasStrictTraits):
"""
def notify_event(self, event):
"""Method based interface to deliver an event, instead of
assignment to traits.
Sends the event, synchronously. When the routine returns,
listeners have been fully informed (they might, however, handle
the event asynchronously at their convenience)
Parameters
----------
event: BaseMCOEvent
The event to deliver.
"""
self.event = event
......@@ -2,17 +2,20 @@ from traits.api import HasStrictTraits, Tuple
class BaseMCOEvent(HasStrictTraits):
pass
"""Base event for the MCO"""
class MCOStartEvent(BaseMCOEvent):
pass
"""MCO should emit this event when the evaluation starts."""
class MCOFinishEvent(BaseMCOEvent):
pass
"""MCO should emit this event when the evaluation ends."""
class MCOProgressEvent(BaseMCOEvent):
"""MCO should emit this event for every new evaluation that has been
completed. It carries data about the evaluation, specifically the
input data (MCO parameter values) and the resulting output (KPIs)."""
input = Tuple()
output = Tuple()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment