Pipeline.py 812 B

12345678910111213141516171819202122232425262728293031
  1. from pycs.pipeline import Result
  2. from pycs.pipeline.Job import Job
  3. class Pipeline:
  4. def __init__(self, root_folder, distribution):
  5. """
  6. prepare everything needed to run jobs later
  7. :param root_folder: relative path to model folder
  8. :param distribution: object parsed from distribution.json
  9. """
  10. raise NotImplementedError
  11. def close(self):
  12. """
  13. is called everytime a pipeline is not needed anymore and should be used
  14. to free native resources
  15. :return:
  16. """
  17. raise NotImplementedError
  18. def execute(self, job: Job) -> Result:
  19. """
  20. receive a job, execute it and return the predicted result
  21. :param job: that should be executed
  22. :return:
  23. """
  24. raise NotImplementedError