for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"""Base optimizer."""
import networkx as nx
networkx
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
class BaseOptimizer(object):
Abstract classes which are used only once can usually be inlined into the class which already uses this abstract class.
"""Optimizer is object which optimize process."""
def __init__(self, process):
self.process = process
self.ordered_stages = nx.topological_sort(self.process)
self.swarm_size = 40
def set_custom_optimizing_order(self, ordered_stages):
"""Set custom order.
Raises:
ValueError: When order doesn't contain all stages.
"""
if set(self.ordered_stages) == set(ordered_stages) and len(
self.ordered_stages) == len(ordered_stages):
self.ordered_stages = ordered_stages
else:
raise ValueError("List of stages must contain all stages.")
def optimize_process(self):
"""Optimize process.
NotImplementedError: Abstract method.
raise NotImplementedError
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.