Skip to content

Commit

Permalink
fix model directory typing
Browse files Browse the repository at this point in the history
Signed-off-by: weiwee <wbwmat@gmail.com>
  • Loading branch information
sagewe committed Jun 28, 2023
1 parent bf049d8 commit 343741f
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from typing import Iterator, List, Optional, Type

from .._base_type import Role, _create_artifact_annotation
from ._directory import ModelDirectoryArtifactDescribe
from ._directory import (
ModelDirectoryArtifactDescribe,
ModelDirectoryReader,
ModelDirectoryWriter,
)
from ._json import JsonModelArtifactDescribe, JsonModelReader, JsonModelWriter


Expand All @@ -21,25 +25,21 @@ def json_model_outputs(roles: Optional[List[Role]] = None, desc="", optional=Fal
return _create_artifact_annotation(False, True, JsonModelArtifactDescribe, "model")(roles, desc, optional)


def model_directory_input(
roles: Optional[List[Role]] = None, desc="", optional=False
) -> Type[ModelDirectoryArtifactDescribe]:
def model_directory_input(roles: Optional[List[Role]] = None, desc="", optional=False) -> Type[ModelDirectoryReader]:
return _create_artifact_annotation(True, False, ModelDirectoryArtifactDescribe, "model")(roles, desc, optional)


def model_directory_inputs(
roles: Optional[List[Role]] = None, desc="", optional=False
) -> Type[List[ModelDirectoryArtifactDescribe]]:
) -> Type[List[ModelDirectoryReader]]:
return _create_artifact_annotation(True, True, ModelDirectoryArtifactDescribe, "model")(roles, desc, optional)


def model_directory_output(
roles: Optional[List[Role]] = None, desc="", optional=False
) -> Type[ModelDirectoryArtifactDescribe]:
def model_directory_output(roles: Optional[List[Role]] = None, desc="", optional=False) -> Type[ModelDirectoryWriter]:
return _create_artifact_annotation(False, False, ModelDirectoryArtifactDescribe, "model")(roles, desc, optional)


def model_directory_outputs(
roles: Optional[List[Role]] = None, desc="", optional=False
) -> Type[Iterator[ModelDirectoryArtifactDescribe]]:
) -> Type[Iterator[ModelDirectoryWriter]]:
return _create_artifact_annotation(False, True, ModelDirectoryArtifactDescribe, "model")(roles, desc, optional)

0 comments on commit 343741f

Please sign in to comment.