for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"""Basic grouped optimizer."""
from grortir.main.model.core.optimization_status import OptimizationStatus
class Result(object):
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
def __init__(self, process):
self.process = process
self.summary_result = OptimizationStatus.not_started
self.detailed_result = {}
def generate(self):
for stage in self.process.nodes():
self.detailed_result[str(stage)] = stage.optimization_status
if stage.optimization_status != OptimizationStatus.success:
self.summary_result = OptimizationStatus.failed
else:
self.summary_result = OptimizationStatus.success
class GroupedOptimizer:
"""Optimizer is object which optimize process."""
def __init__(self, process, grouping_strategy, pso):
self.grouping_strategy = grouping_strategy
self.pso = pso
self.result = Result(self.process)
def optimize_process(self):
"""Optimize process.
Returns:
True if success, False otherwise."""
self.pso.run()
self.result.generate()
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.