Ejemplo n.º 1
0
    def __init__(self,
                 name: str,
                 wrapper_meta: Optional[dict] = None,
                 artifact: 'ArtifactCollection' = None,
                 requirements: Requirements = None,
                 params: Dict[str, Any] = None,
                 description: str = None,
                 id: int = None,
                 task_id: int = None,
                 author: str = None,
                 creation_date: datetime.datetime = None):
        super().__init__(id, name, author, creation_date)

        self.description = description
        self.params = params or {}
        try:
            json.dumps(self.params)
        except TypeError:
            raise ValueError(f'"params" argument must be json-serializable')
        self._wrapper = None
        self._wrapper_meta = None
        if isinstance(wrapper_meta, ModelWrapper):
            self._wrapper = wrapper_meta
        elif isinstance(wrapper_meta, dict):
            self._wrapper_meta = wrapper_meta

        self.requirements = requirements
        self.transformer = None
        self.task_id = task_id
        self._persisted_artifacts = artifact
        self._unpersisted_artifacts: Optional[ArtifactCollection] = None

        self._images: IndexDict[Image] = IndexDict('id', 'name')
        self.images: IndexDictAccessor[Image] = IndexDictAccessor(self._images)
Ejemplo n.º 2
0
 def __init__(self,
              name: str,
              id: int = None,
              author: str = None,
              creation_date: datetime.datetime = None):
     super().__init__(id, name, author, creation_date)
     self._tasks: IndexDict[Task] = IndexDict('id', 'name')
     self.tasks: IndexDictAccessor[Task] = IndexDictAccessor(self._tasks)
Ejemplo n.º 3
0
 def __init__(self,
              name: str,
              id: int = None,
              project_id: int = None,
              author: str = None,
              creation_date: datetime.datetime = None):
     super().__init__(id, name, author, creation_date)
     self.project_id = project_id
     # self.metrics = metrics TODO
     # self.sample_data = sample_data
     self._models: IndexDict[Model] = IndexDict('id', 'name')
     self.models: IndexDictAccessor[Model] = IndexDictAccessor(self._models)
     self._pipelines: IndexDict[Pipeline] = IndexDict('id', 'name')
     self.pipelines: IndexDictAccessor[Pipeline] = IndexDictAccessor(
         self._pipelines)
     self._images: IndexDict[Image] = IndexDict('id', 'name')
     self.images: IndexDictAccessor[Image] = IndexDictAccessor(self._images)