Notifications
Notifications can be useful for long experiments. In the core module, we define an abstract QOSSTNotifier and a notifier based on this should implement the send_notification method.
This method can then be used in other code by using the following code for instance
from qosst_core.notifications import QOSSTNotifier
notifier = QOSSTNotifier()
notifier.send_notification("Experiment is finished.")
This is an example code but cannot be used as the QOSSTNofitifier abstract object cannot be instantiated.
Telegram notifier
The only notifier implemented is the telegram notifier that will send message on a telegram conversation. It can be used with the following code
Implementing a new notifier
Implementing a new notifier is an easy task:
Create a class inheriting from
qosst_core.notifications.QOSSTNotifier.Implement the
__init__method to get all the required variablesImplement the
send_notificationmethod that will use the variables passed in the__init__method to send the notification.