Skip to content

Commit

Permalink
fix: Remove insert_port_types for LoadFunction (#993)
Browse files Browse the repository at this point in the history
The existing implementation of `insert_port_types` was wrong, we can
just get rid of it
  • Loading branch information
mark-koch authored May 3, 2024
1 parent a858353 commit acca7bf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
5 changes: 1 addition & 4 deletions hugr-py/src/hugr/serialization/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,7 @@ class LoadFunction(DataflowOp):
op: Literal["LoadFunction"] = "LoadFunction"
func_sig: PolyFuncType
type_args: list[tys.TypeArg]
signature: FunctionType = Field(default_factory=FunctionType.empty)

def insert_port_types(self, in_types: TypeRow, out_types: TypeRow) -> None:
self.signature = FunctionType(input=list(in_types), output=list(out_types))
signature: FunctionType


class DFG(DataflowOp):
Expand Down
3 changes: 2 additions & 1 deletion specification/schema/hugr_schema_strict_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,8 @@
"required": [
"parent",
"func_sig",
"type_args"
"type_args",
"signature"
],
"title": "LoadFunction",
"type": "object"
Expand Down
3 changes: 2 additions & 1 deletion specification/schema/hugr_schema_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,8 @@
"required": [
"parent",
"func_sig",
"type_args"
"type_args",
"signature"
],
"title": "LoadFunction",
"type": "object"
Expand Down
3 changes: 2 additions & 1 deletion specification/schema/testing_hugr_schema_strict_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,8 @@
"required": [
"parent",
"func_sig",
"type_args"
"type_args",
"signature"
],
"title": "LoadFunction",
"type": "object"
Expand Down
3 changes: 2 additions & 1 deletion specification/schema/testing_hugr_schema_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,8 @@
"required": [
"parent",
"func_sig",
"type_args"
"type_args",
"signature"
],
"title": "LoadFunction",
"type": "object"
Expand Down

0 comments on commit acca7bf

Please sign in to comment.