Source code for dasf.pipeline.executors.base

#!/usr/bin/env python3


[docs] class Executor: @property def is_connected(self) -> bool: return False @property def info(self) -> str: return "This executor has no info to show."
[docs] def has_dataset(self, key) -> bool: return False
[docs] def register_dataset(self, **kwargs): dataset = list(kwargs.values()) if len(dataset) != 1: raise Exception("This function requires one dataset only. " f"We found {len(dataset)}.") return dataset.pop()
[docs] def get_dataset(self, key): raise NotImplementedError("This function needs to be specialized for " "every executor.")
[docs] def register_plugin(self, plugin): raise Exception("This executor does not accept plugins.")
[docs] def pre_run(self, pipeline): pass
[docs] def post_run(self, pipeline): pass
[docs] def execute(self, fn, *args, **kwargs): ...
[docs] def shutdown(self): pass