From 39e3d4262dac3ddc14d09eca3176fc1e05f8503d Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Wed, 12 Dec 2018 15:02:52 +0100
Subject: [PATCH] [algorithm] Give loop full access to input content in prepare

Unlike other autonomous algorithm, loop must have access to
everything directly in the prepare method so it can properly setup
everything for validation.
---
 beat/backend/python/algorithm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/beat/backend/python/algorithm.py b/beat/backend/python/algorithm.py
index 971d957..7cda28e 100644
--- a/beat/backend/python/algorithm.py
+++ b/beat/backend/python/algorithm.py
@@ -204,7 +204,7 @@ class Runner(object):
 
         # The method is optional
         if hasattr(self.obj, 'prepare'):
-            if self.algorithm.is_autonomous:
+            if self.algorithm.type in [Algorithm.AUTONOMOUS, Algorithm.LOOP_USER]:
                 self.prepared = loader.run(self.obj, 'prepare', self.exc, data_loaders.secondaries())
             else:
                 self.prepared = loader.run(self.obj, 'prepare', self.exc, data_loaders)
-- 
GitLab