Skip to content

Commit 7d56bf9

Browse files
committed
More places where I have missed extension sets.
1 parent 2797326 commit 7d56bf9

File tree

7 files changed

+2
-102
lines changed

7 files changed

+2
-102
lines changed

hugr-core/src/ops.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::extension::resolution::{
1515
use std::borrow::Cow;
1616

1717
use crate::extension::simple_op::MakeExtensionOp;
18-
use crate::extension::{ExtensionId, ExtensionRegistry, ExtensionSet};
18+
use crate::extension::{ExtensionId, ExtensionRegistry};
1919
use crate::types::{EdgeKind, Signature, Substitution};
2020
use crate::{Direction, OutgoingPort, Port};
2121
use crate::{IncomingPort, PortIndex};
@@ -384,12 +384,6 @@ pub trait OpTrait: Sized + Clone {
384384
None
385385
}
386386

387-
/// The delta between the input extensions specified for a node,
388-
/// and the output extensions calculated for that node
389-
fn extension_delta(&self) -> ExtensionSet {
390-
ExtensionSet::new()
391-
}
392-
393387
/// The edge kind for the non-dataflow inputs of the operation,
394388
/// not described by the signature.
395389
///

hugr-py/src/hugr/_serialization/ops.py

-5
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ class DataflowBlock(BaseOp):
206206
inputs: TypeRow = Field(default_factory=list)
207207
other_outputs: TypeRow = Field(default_factory=list)
208208
sum_rows: list[TypeRow]
209-
extension_delta: ExtensionSet = Field(default_factory=list)
210209

211210
def insert_port_types(self, in_types: TypeRow, out_types: TypeRow) -> None:
212211
num_cases = len(out_types)
@@ -405,8 +404,6 @@ class Conditional(DataflowOp):
405404
sum_rows: list[TypeRow] = Field(
406405
description="The possible rows of the Sum input", default_factory=list
407406
)
408-
# Extensions used to produce the outputs
409-
extension_delta: ExtensionSet = Field(default_factory=list)
410407

411408
def insert_port_types(self, in_types: TypeRow, out_types: TypeRow) -> None:
412409
# First port is a predicate, i.e. a sum of tuple types. We need to unpack
@@ -457,7 +454,6 @@ class TailLoop(DataflowOp):
457454
just_outputs: TypeRow = Field(default_factory=list)
458455
# Types that are appended to both input and output:
459456
rest: TypeRow = Field(default_factory=list)
460-
extension_delta: ExtensionSet = Field(default_factory=list)
461457

462458
def insert_port_types(self, in_types: TypeRow, out_types: TypeRow) -> None:
463459
assert in_types == out_types
@@ -470,7 +466,6 @@ def deserialize(self) -> ops.TailLoop:
470466
just_inputs=deser_it(self.just_inputs),
471467
_just_outputs=deser_it(self.just_outputs),
472468
rest=deser_it(self.rest),
473-
extension_delta=self.extension_delta,
474469
)
475470

476471

hugr-py/src/hugr/ops.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ class DFG(DfParentOp, DataflowOp):
629629
#: Inputs types of the operation.
630630
inputs: tys.TypeRow
631631
_outputs: tys.TypeRow | None = field(default=None, repr=False)
632-
_extension_delta: tys.ExtensionSet = field(default_factory=list, repr=False)
633632

634633
@property
635634
def outputs(self) -> tys.TypeRow:
@@ -647,7 +646,7 @@ def signature(self) -> tys.FunctionType:
647646
Raises:
648647
IncompleteOp: If the outputs have not been set.
649648
"""
650-
return tys.FunctionType(self.inputs, self.outputs, self._extension_delta)
649+
return tys.FunctionType(self.inputs, self.outputs)
651650

652651
@property
653652
def num_out(self) -> int:
@@ -726,7 +725,6 @@ class DataflowBlock(DfParentOp):
726725
inputs: tys.TypeRow
727726
_sum: tys.Sum | None = None
728727
_other_outputs: tys.TypeRow | None = field(default=None, repr=False)
729-
extension_delta: tys.ExtensionSet = field(default_factory=list)
730728

731729
@property
732730
def sum_ty(self) -> tys.Sum:
@@ -759,7 +757,6 @@ def _to_serial(self, parent: Node) -> sops.DataflowBlock:
759757
inputs=ser_it(self.inputs),
760758
sum_rows=list(map(ser_it, self.sum_ty.variant_rows)),
761759
other_outputs=ser_it(self.other_outputs),
762-
extension_delta=self.extension_delta,
763760
)
764761

765762
def inner_signature(self) -> tys.FunctionType:
@@ -990,7 +987,6 @@ class TailLoop(DfParentOp, DataflowOp):
990987
#: Types that are appended to both inputs and outputs of the graph.
991988
rest: tys.TypeRow
992989
_just_outputs: tys.TypeRow | None = field(default=None, repr=False)
993-
extension_delta: tys.ExtensionSet = field(default_factory=list, repr=False)
994990

995991
@property
996992
def just_outputs(self) -> tys.TypeRow:
@@ -1011,7 +1007,6 @@ def _to_serial(self, parent: Node) -> sops.TailLoop:
10111007
just_inputs=ser_it(self.just_inputs),
10121008
just_outputs=ser_it(self.just_outputs),
10131009
rest=ser_it(self.rest),
1014-
extension_delta=self.extension_delta,
10151010
)
10161011

10171012
def inner_signature(self) -> tys.FunctionType:

specification/schema/hugr_schema_live.json

-21
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,6 @@
277277
},
278278
"title": "Sum Rows",
279279
"type": "array"
280-
},
281-
"extension_delta": {
282-
"items": {
283-
"type": "string"
284-
},
285-
"title": "Extension Delta",
286-
"type": "array"
287280
}
288281
},
289282
"required": [
@@ -428,13 +421,6 @@
428421
},
429422
"title": "Sum Rows",
430423
"type": "array"
431-
},
432-
"extension_delta": {
433-
"items": {
434-
"type": "string"
435-
},
436-
"title": "Extension Delta",
437-
"type": "array"
438424
}
439425
},
440426
"required": [
@@ -1519,13 +1505,6 @@
15191505
},
15201506
"title": "Rest",
15211507
"type": "array"
1522-
},
1523-
"extension_delta": {
1524-
"items": {
1525-
"type": "string"
1526-
},
1527-
"title": "Extension Delta",
1528-
"type": "array"
15291508
}
15301509
},
15311510
"required": [

specification/schema/hugr_schema_strict_live.json

-21
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,6 @@
277277
},
278278
"title": "Sum Rows",
279279
"type": "array"
280-
},
281-
"extension_delta": {
282-
"items": {
283-
"type": "string"
284-
},
285-
"title": "Extension Delta",
286-
"type": "array"
287280
}
288281
},
289282
"required": [
@@ -428,13 +421,6 @@
428421
},
429422
"title": "Sum Rows",
430423
"type": "array"
431-
},
432-
"extension_delta": {
433-
"items": {
434-
"type": "string"
435-
},
436-
"title": "Extension Delta",
437-
"type": "array"
438424
}
439425
},
440426
"required": [
@@ -1519,13 +1505,6 @@
15191505
},
15201506
"title": "Rest",
15211507
"type": "array"
1522-
},
1523-
"extension_delta": {
1524-
"items": {
1525-
"type": "string"
1526-
},
1527-
"title": "Extension Delta",
1528-
"type": "array"
15291508
}
15301509
},
15311510
"required": [

specification/schema/testing_hugr_schema_live.json

-21
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,6 @@
277277
},
278278
"title": "Sum Rows",
279279
"type": "array"
280-
},
281-
"extension_delta": {
282-
"items": {
283-
"type": "string"
284-
},
285-
"title": "Extension Delta",
286-
"type": "array"
287280
}
288281
},
289282
"required": [
@@ -428,13 +421,6 @@
428421
},
429422
"title": "Sum Rows",
430423
"type": "array"
431-
},
432-
"extension_delta": {
433-
"items": {
434-
"type": "string"
435-
},
436-
"title": "Extension Delta",
437-
"type": "array"
438424
}
439425
},
440426
"required": [
@@ -1518,13 +1504,6 @@
15181504
},
15191505
"title": "Rest",
15201506
"type": "array"
1521-
},
1522-
"extension_delta": {
1523-
"items": {
1524-
"type": "string"
1525-
},
1526-
"title": "Extension Delta",
1527-
"type": "array"
15281507
}
15291508
},
15301509
"required": [

specification/schema/testing_hugr_schema_strict_live.json

-21
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,6 @@
277277
},
278278
"title": "Sum Rows",
279279
"type": "array"
280-
},
281-
"extension_delta": {
282-
"items": {
283-
"type": "string"
284-
},
285-
"title": "Extension Delta",
286-
"type": "array"
287280
}
288281
},
289282
"required": [
@@ -428,13 +421,6 @@
428421
},
429422
"title": "Sum Rows",
430423
"type": "array"
431-
},
432-
"extension_delta": {
433-
"items": {
434-
"type": "string"
435-
},
436-
"title": "Extension Delta",
437-
"type": "array"
438424
}
439425
},
440426
"required": [
@@ -1518,13 +1504,6 @@
15181504
},
15191505
"title": "Rest",
15201506
"type": "array"
1521-
},
1522-
"extension_delta": {
1523-
"items": {
1524-
"type": "string"
1525-
},
1526-
"title": "Extension Delta",
1527-
"type": "array"
15281507
}
15291508
},
15301509
"required": [

0 commit comments

Comments
 (0)