Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/flowrep/api/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
for downstream library developers.
"""

from flowrep.base_models import is_valid_label as is_valid_label
from flowrep.base_models import validate_label as validate_label
from flowrep.compiler.source import flowrep2python as flowrep2python
from flowrep.converters.python_workflow_definition import (
OutputContractError as OutputContractError,
Expand All @@ -15,6 +17,7 @@
from flowrep.parsers.atomic_parser import atomic as atomic
from flowrep.parsers.atomic_parser import parse_atomic as parse_atomic
from flowrep.parsers.dataclass_parser import dataclass as dataclass
from flowrep.parsers.label_helpers import unique_suffix as unique_suffix
from flowrep.parsers.workflow_parser import parse_workflow as parse_workflow
from flowrep.parsers.workflow_parser import workflow as workflow
from flowrep.prospective.constant_recipe import is_jsonable as is_jsonable
Expand Down
4 changes: 2 additions & 2 deletions src/flowrep/base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def is_valid_label(label: str) -> bool:
)


def _validate_label(v: str) -> str:
def validate_label(v: str) -> str:
if not isinstance(v, str) or not is_valid_label(v):
raise ValueError(
f"Label must be a valid Python identifier and not in "
Expand All @@ -51,7 +51,7 @@ def _validate_label(v: str) -> str:
return v


Label = Annotated[str, pydantic.BeforeValidator(_validate_label)]
Label = Annotated[str, pydantic.BeforeValidator(validate_label)]


T = TypeVar("T", bound=Hashable)
Expand Down
Loading