neclib.safety.status#

class Status(levels=['warning', 'critical'])[source]#

Bases: object

Status manager.

Parameters:

levels (List[str]) – List of level names, default is [“warning”, “critical”]. The names should be given in ascending order in severity.

Raises:

ValueError – If (at least) one of level names are reserved by Python.

Examples

>>> status = Status()
>>> status["topic1"].warning = True
>>> status["topic1"]
namespace(warning=True, critical=False)
>>> status["topic2"] = {"warning": False, "critical": False}
>>> status.warning()
True
>>> status.critical()
False