Skip to content

Commit

Permalink
⬆️🪝 update pre-commit hooks (#120)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.280 →
v0.0.281](astral-sh/ruff-pre-commit@v0.0.280...v0.0.281)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Nils Quetschlich <Nils.Quetschlich@tum.de>
  • Loading branch information
pre-commit-ci[bot] and nquetschlich committed Aug 1, 2023
1 parent 89b7490 commit da95395
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repos:
types_or: [yaml, markdown, html, css, javascript, json]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.280
rev: v0.0.281
hooks:
- id: ruff
args: ["--fix"]
Expand Down
11 changes: 5 additions & 6 deletions src/mqt/predictor/ml/Predictor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import glob
import logging
from pathlib import Path
from typing import Any, cast
Expand Down Expand Up @@ -249,15 +248,15 @@ def generate_training_sample(
scores: list[float] = []
for _ in range(len(LUT)):
scores.append(ml.helper.get_width_penalty())
all_relevant_paths = Path(path_compiled_circuits) / (file.split(".")[0] + "*")
all_relevant_files = glob.glob(str(all_relevant_paths))
all_relevant_files = Path(path_compiled_circuits).glob(file.split(".")[0] + "*")

for filename in all_relevant_files:
if (file.split(".")[0] + "_") in filename and filename.endswith(".qasm"):
comp_path_index = int(filename.split("_")[-1].split(".")[0])
filename_str = str(filename)
if (file.split(".")[0] + "_") in filename_str and filename_str.endswith(".qasm"):
comp_path_index = int(filename_str.split("_")[-1].split(".")[0])
device = LUT[comp_path_index][1]

score = reward.expected_fidelity(filename, device)
score = reward.expected_fidelity(filename_str, device)
scores[comp_path_index] = score

num_not_empty_entries = 0
Expand Down

0 comments on commit da95395

Please sign in to comment.