Commit c74eefd6 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[algorithm] Rename xxx_loop and xxx_loop_user

WARNING this is a breaking change

xxx_loop and xxx_loop_user were not really clear.

They are now:
- xxx_loop_evaluator
- xxx_loop_processor

This makes their role easier to understand.
parent a749c91c
...@@ -216,7 +216,7 @@ class Runner(object): ...@@ -216,7 +216,7 @@ class Runner(object):
if hasattr(self.obj, "prepare"): if hasattr(self.obj, "prepare"):
if self.algorithm.type in [ if self.algorithm.type in [
Algorithm.AUTONOMOUS, Algorithm.AUTONOMOUS,
Algorithm.AUTONOMOUS_LOOP_USER, Algorithm.AUTONOMOUS_LOOP_PROCESSOR,
]: ]:
self.prepared = loader.run( self.prepared = loader.run(
self.obj, "prepare", self.exc, data_loaders.secondaries() self.obj, "prepare", self.exc, data_loaders.secondaries()
...@@ -451,10 +451,10 @@ class Algorithm(object): ...@@ -451,10 +451,10 @@ class Algorithm(object):
LEGACY = "legacy" LEGACY = "legacy"
SEQUENTIAL = "sequential" SEQUENTIAL = "sequential"
AUTONOMOUS = "autonomous" AUTONOMOUS = "autonomous"
SEQUENTIAL_LOOP = "sequential_loop" SEQUENTIAL_LOOP_EVALUATOR = "sequential_loop_evaluator"
AUTONOMOUS_LOOP = "autonomous_loop" AUTONOMOUS_LOOP_EVALUATOR = "autonomous_loop_evaluator"
SEQUENTIAL_LOOP_USER = "sequential_loop_user" SEQUENTIAL_LOOP_PROCESSOR = "sequential_loop_processor"
AUTONOMOUS_LOOP_USER = "autonomous_loop_user" AUTONOMOUS_LOOP_PROCESSOR = "autonomous_loop_processor"
dataformat_klass = dataformat.DataFormat dataformat_klass = dataformat.DataFormat
...@@ -698,8 +698,8 @@ class Algorithm(object): ...@@ -698,8 +698,8 @@ class Algorithm(object):
""" Returns whether the algorithm is in the autonomous category""" """ Returns whether the algorithm is in the autonomous category"""
return self.type in [ return self.type in [
Algorithm.AUTONOMOUS, Algorithm.AUTONOMOUS,
Algorithm.AUTONOMOUS_LOOP, Algorithm.AUTONOMOUS_LOOP_EVALUATOR,
Algorithm.AUTONOMOUS_LOOP_USER, Algorithm.AUTONOMOUS_LOOP_PROCESSOR,
] ]
@property @property
...@@ -707,13 +707,16 @@ class Algorithm(object): ...@@ -707,13 +707,16 @@ class Algorithm(object):
""" Returns whether the algorithm is in the sequential category""" """ Returns whether the algorithm is in the sequential category"""
return self.type in [ return self.type in [
Algorithm.SEQUENTIAL, Algorithm.SEQUENTIAL,
Algorithm.SEQUENTIAL_LOOP, Algorithm.SEQUENTIAL_LOOP_EVALUATOR,
Algorithm.SEQUENTIAL_LOOP_USER, Algorithm.SEQUENTIAL_LOOP_PROCESSOR,
] ]
@property @property
def is_loop(self): def is_loop(self):
return self.type in [Algorithm.SEQUENTIAL_LOOP, Algorithm.AUTONOMOUS_LOOP] return self.type in [
Algorithm.SEQUENTIAL_LOOP_EVALUATOR,
Algorithm.AUTONOMOUS_LOOP_EVALUATOR,
]
@language.setter @language.setter
def language(self, value): def language(self, value):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment