Source code for chap_core.runners.runner
import abc
from typing import Optional
[docs]
class Runner:
"""
An interface for Runners. A runner is able to run "something", e.g. a command on the command line
through Docker."""
[docs]
def run_command(self, command): ...
[docs]
def store_file(self, file_path):
...
# not used for anything now
[docs]
def teardown(self):
"""To be called after the runner is done with train and predict. This is to clean up the runner, e.g.
to remove docker images, etc"""
...
[docs]
class TrainPredictRunner(abc.ABC):
"""
Specific wrapper for runners that only run train/predict commands
"""
[docs]
@abc.abstractmethod
def train(self, train_data: str, model_file_name: str, polygons_file_name: Optional[str]): ...
[docs]
@abc.abstractmethod
def predict(
self,
model_file_name: str,
historic_data: str,
future_data: str,
output_file: str,
polygons_file_name: Optional[str],
): ...
[docs]
def teardown(self): ...