Skip to content

Commit

Permalink
fix: Export the float ops extension
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Sep 3, 2024
1 parent faeac27 commit 7c90f9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions hugr-py/src/hugr/std/float.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
from hugr import val
from hugr.std import _load_extension

EXTENSION = _load_extension("arithmetic.float.types")
FLOAT_TYPES_EXTENSION = _load_extension("arithmetic.float.types")

FLOAT_T = EXTENSION.types["float64"].instantiate([])
FLOAT_T = FLOAT_TYPES_EXTENSION.types["float64"].instantiate([])


FLOAT_OPS_EXTENSION = _load_extension("arithmetic.float")


@dataclass
Expand All @@ -22,7 +25,7 @@ def to_value(self) -> val.Extension:
name = "ConstF64"
payload = {"value": self.v}
return val.Extension(
name, typ=FLOAT_T, val=payload, extensions=[EXTENSION.name]
name, typ=FLOAT_T, val=payload, extensions=[FLOAT_TYPES_EXTENSION.name]
)

def __str__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion hugr-py/tests/test_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from hugr.build.dfg import Dfg
from hugr.hugr import Hugr, Node
from hugr.ops import AsExtOp, Custom, ExtOp
from hugr.std.float import EXTENSION as FLOAT_EXT
from hugr.std.float import FLOAT_T
from hugr.std.float import FLOAT_TYPES_EXTENSION as FLOAT_EXT
from hugr.std.int import INT_OPS_EXTENSION, INT_TYPES_EXTENSION, DivMod, int_t
from hugr.std.logic import EXTENSION as LOGIC_EXT
from hugr.std.logic import Not
Expand Down

0 comments on commit 7c90f9a

Please sign in to comment.