From 4f985403fa75acd90fa70da0c6c501df4d59c052 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Wed, 21 Nov 2018 09:52:50 +0100 Subject: [PATCH] [algorithm][Algorithm] Add is_autonomous property This will allow to simplify checking for autonomous algorithm types --- beat/backend/python/algorithm.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/beat/backend/python/algorithm.py b/beat/backend/python/algorithm.py index 2510064..22b938c 100644 --- a/beat/backend/python/algorithm.py +++ b/beat/backend/python/algorithm.py @@ -613,6 +613,14 @@ class Algorithm(object): return self.data.get('type', Algorithm.SEQUENTIAL) + @property + def is_autonomous(self): + """ Returns whether the algorithm is in the autonomous category""" + return self.type in [Algorithm.AUTONOMOUS, + Algorithm.LOOP_USER, + Algorithm.LOOP] + + @language.setter def language(self, value): """Sets the current executable code programming language""" -- GitLab