Skip to content

Commit

Permalink
fix: use correct logger
Browse files Browse the repository at this point in the history
  • Loading branch information
qartik committed Nov 17, 2024
1 parent cdbd04a commit 8dcf75d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- black==23.10.1

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.7.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
8 changes: 4 additions & 4 deletions pytket/phir/phirgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def convert_gate(op: tk.Op, cmd: tk.Command) -> JsonDict | None:
if op.type == tk.OpType.Phase:
# ignore global phase
return {"mop": "Skip"}
logging.exception("Gate %s unsupported by PHIR", op.get_name())
logger.exception("Gate %s unsupported by PHIR", op.get_name())
raise

angles = (op.params, "pi") if op.params else None
Expand Down Expand Up @@ -430,7 +430,7 @@ def get_cop_from_op(op: ClOp) -> str | int: # noqa: PLR0912
case ClOp.RegPow:
cop = "**"
case _:
logging.exception("Classical operation %s unsupported by PHIR", str(op))
logger.exception("Classical operation %s unsupported by PHIR", str(op))
raise NotImplementedError(op)
return cop

Expand All @@ -452,12 +452,12 @@ def phir_from_clexpr_arg(
bits_in_reg = [bits[i] for i in reg_posn[expr_arg.index]]
reg_size = len(bits_in_reg)
if reg_size == 0:
logging.exception("Register variable with no bits")
logger.exception("Register variable with no bits")
reg_name = bits_in_reg[0].reg_name
if any(bit.reg_name != reg_name for bit in bits_in_reg) or any(
bit.index[0] != i for i, bit in enumerate(bits_in_reg)
):
logging.exception("Register variable not aligned with any register")
logger.exception("Register variable not aligned with any register")
return reg_name
assert isinstance(expr_arg, ClExpr) # noqa: S101

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pre-commit==4.0.1
pydata_sphinx_theme==0.16.0
pytest==8.3.3
pytket==1.34.0
ruff==0.7.3
ruff==0.7.4
setuptools_scm==8.1.0
wasmtime==25.0.0
wheel==0.45.0

0 comments on commit 8dcf75d

Please sign in to comment.