Deliver notification info
Created by: stefanoborini
Notification system to communicate to the UI and other entities interested in notification.
Merge request reports
Activity
Filter activity
Created by: codecov[bot]
Codecov Report
Merging #79 into master will increase coverage by
1.13%
. The diff coverage is96.67%
.@@ Coverage Diff @@ ## master #79 +/- ## ========================================== + Coverage 95.68% 96.82% +1.13% ========================================== Files 49 60 +11 Lines 719 976 +257 Branches 55 82 +27 ========================================== + Hits 688 945 +257 + Misses 29 23 -6 - Partials 2 8 +6
Impacted Files Coverage Δ force_bdss/base_extension_plugin.py 100% <100%> (ø)
...ore_plugins/dummy/dummy_dakota/dakota_optimizer.py 100% <100%> (ø)
force_bdss/core_plugins/dummy/dummy_plugin.py 100% <100%> (ø)
force_bdss/core/workflow.py 100% <100%> (ø)
...on_listener/dummy_notification_listener_factory.py 100% <100%> (ø)
force_bdss/core_mco_driver.py 94.44% <100%> (+41.81%)
...tion_listener/dummy_notification_listener_model.py 100% <100%> (ø)
force_bdss/ids.py 100% <100%> (ø)
force_bdss/io/workflow_reader.py 100% <100%> (+3.94%)
...ins/dummy/ui_notification/ui_notification_model.py 100% <100%> (ø)
... and 24 more
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update f97dff7...8c751d8. Read the comment docs.81 82 return listeners 83 84 def _finalize_listener(self, listener): 85 """Helper method. Finalizes a listener and handles possible 86 exceptions. it does _not_ remove the listener from the listener 87 list. 88 """ 89 try: 90 listener.finalize() 91 except Exception as e: 92 log.error( 93 "Exception while finalizing listener {}: {}".format( 94 listener.__class__.__name__, 95 str(e) 96 )) 1 from traits.api import String 2 3 from force_bdss.api import ( 4 factory_id, 5 BaseNotificationListenerFactory) 6 7 from .dummy_notification_listener import DummyNotificationListener 8 from .dummy_notification_listener_model import DummyNotificationListenerModel 9 10 11 class DummyNotificationListenerFactory(BaseNotificationListenerFactory): 12 id = String(factory_id("enthought", "dummy_notification_listener")) 13 14 name = String("Dummy Notification Listener") 15 16 def create_model(self, model_data=None): 18 Notification engine for the UI. Uses zeromq for the traffic handling. 19 """ 20 #: The ZMQ context. If None, it means that the service is unavailable. 21 _context = Instance(zmq.Context) 22 23 #: The pubsub socket. 24 _pub_socket = Instance(zmq.Socket) 25 26 #: The synchronization socket to communicate with the server (UI) 27 _sync_socket = Instance(zmq.Socket) 28 29 #: Unique identifier from the UI. To be returned in the protocol. 30 _identifier = String() 31 32 #: The protocol version that this plugin delivers 33 _proto_version = "1" 5 """Base event for the MCO""" 6 7 8 class MCOStartEvent(BaseMCOEvent): 9 """MCO should emit this event when the evaluation starts.""" 10 11 12 class MCOFinishEvent(BaseMCOEvent): 13 """MCO should emit this event when the evaluation ends.""" 14 15 16 class MCOProgressEvent(BaseMCOEvent): 17 """MCO should emit this event for every new evaluation that has been 18 completed. It carries data about the evaluation, specifically the 19 input data (MCO parameter values) and the resulting output (KPIs).""" 20 input = Tuple() 1 import logging 2 from traits.api import Instance, String 3 4 from force_bdss.api import ( 5 BaseNotificationListener, 6 MCOStartEvent, 7 MCOFinishEvent, 8 MCOProgressEvent 9 ) 10 11 import zmq 12 13 log = logging.getLogger(__name__) 14 15 16 class UINotification(BaseNotificationListener):
Please register or sign in to reply