Skip to content

Commit

Permalink
⬆️🪝 update pre-commit hooks (#250)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.248 →
v0.0.253](astral-sh/ruff-pre-commit@v0.0.248...v0.0.253)
<!--pre-commit.ci end-->
  • Loading branch information
burgholzer authored Feb 28, 2023
2 parents 3f59866 + 893f84a commit f249df6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:

# Run ruff (subsumes pyupgrade, isort, flake8+plugins, and more)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.248
rev: v0.0.253
hooks:
- id: ruff
args: ["--fix"]
Expand Down
4 changes: 2 additions & 2 deletions mqt/qmap/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def extract_initial_layout_from_qasm(qasm: str, qregs: list[QuantumRegister]) ->
for line in qasm.split("\n"):
if line.startswith("// i "):
# strip away initial part of line
line = line[5:]
stripped_line = line[5:]
# split line into tokens
tokens = line.split(" ")
tokens = stripped_line.split(" ")
# convert tokens to integers
int_tokens = [int(token) for token in tokens]
# create an empty layout
Expand Down
4 changes: 2 additions & 2 deletions mqt/qmap/subarchitectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ def __compute_desirable_subarchitectures(self) -> None:
des.sort()
new_des: set[tuple[int, int]] = set()
for j, (n_prime, i_prime) in enumerate(reversed(des)):
j = len(des) - j - 1
if not any([(n_prime, i_prime) in self.subarch_order[k] for k in des[:j]]):
idx = len(des) - j - 1
if not any((n_prime, i_prime) in self.subarch_order[k] for k in des[:idx]):
new_des.add((n_prime, i_prime))

self.desirable_subarchitectures[(n, i)] = new_des
Expand Down

0 comments on commit f249df6

Please sign in to comment.