Skip to content

Commit

Permalink
[easy] Make explicit the abstract methods in the PipelineComponent hi…
Browse files Browse the repository at this point in the history
…erarchy (#1105)

Depends on #1095
  • Loading branch information
ttung authored Mar 26, 2019
1 parent 50d00d9 commit d2b4051
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion starfish/pipeline/pipelinecomponent.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import importlib
from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import Mapping, MutableMapping, Optional, Set, Type


class PipelineComponentType(type):
class PipelineComponentType(ABCMeta):
"""
This is the metaclass for PipelineComponent. As each subclass that is _not_ PipelineComponent
is created, it sets up a map between the algorithm name and the class that implements it.
Expand Down Expand Up @@ -58,6 +59,7 @@ def get_pipeline_component_class_by_name(name: str) -> Type["PipelineComponent"]
return PipelineComponentType.get_pipeline_component_type_by_name(name)

@classmethod
@abstractmethod
def pipeline_component_type_name(cls) -> str:
"""
Returns the name of the pipeline component type.
Expand All @@ -71,6 +73,7 @@ def _algorithm_to_class_map(cls) -> Mapping[str, Type]:
return cls._algorithm_to_class_map_int

@classmethod
@abstractmethod
def _cli_run(cls, ctx, instance):
raise NotImplementedError()

Expand Down

0 comments on commit d2b4051

Please sign in to comment.