-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,415 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Literal, Optional | ||
from pydantic import BaseModel | ||
from .tys import Type, SumType, PolyFuncType | ||
from .ops import Value | ||
|
||
|
||
class TestingHugr(BaseModel): | ||
"""A serializable representation of a Hugr Type, SumType, PolyFuncType, or | ||
Value. Intended for testing only.""" | ||
|
||
version: Literal["v1"] = "v1" | ||
typ: Optional[Type] = None | ||
sum_type: Optional[SumType] = None | ||
poly_func_type: Optional[PolyFuncType] = None | ||
value: Optional[Value] = None | ||
|
||
@classmethod | ||
def get_version(cls) -> str: | ||
"""Return the version of the schema.""" | ||
return cls().version | ||
|
||
class Config: | ||
title = "HugrTesting" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.