Skip to content

Commit a27f27c

Browse files
authored
Merge branch 'main' into new_structure
Signed-off-by: Shaobo-Zhou <109073755+Shaobo-Zhou@users.noreply.github.com>
2 parents a3d4baa + da89199 commit a27f27c

File tree

9 files changed

+60
-45
lines changed

9 files changed

+60
-45
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Contributing
55

66
Thank you for your interest in contributing to MQT Predictor!
7-
An extensive contribution guide is available in our [documentation](https://mqt.readthedocs.io/projects/predictor/en/latest/CONTRIBUTING.html).
7+
An extensive contribution guide is available in our [documentation](https://mqt.readthedocs.io/projects/predictor/en/latest/contributing.html).

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ on:
1010
jobs:
1111
build-sdist:
1212
name: 🐍 Packaging
13-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
13+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
1414

1515
build-wheel:
1616
name: 🐍 Packaging
17-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
17+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
1818

1919
deploy:
2020
if: github.event_name == 'release' && github.event.action == 'published'

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
jobs:
1515
change-detection:
1616
name: 🔍 Change
17-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
17+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
1818

1919
python-tests:
2020
name: 🐍 Test
@@ -24,15 +24,15 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
runs-on: [ubuntu-24.04, macos-14, windows-2022]
27-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
27+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
2828
with:
2929
runs-on: ${{ matrix.runs-on }}
3030

3131
python-coverage:
3232
name: 🐍 Coverage
3333
needs: [change-detection, python-tests]
3434
if: fromJSON(needs.change-detection.outputs.run-python-tests)
35-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
35+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
3636
permissions:
3737
contents: read
3838
id-token: write
@@ -41,19 +41,19 @@ jobs:
4141
name: 🐍 Lint
4242
needs: change-detection
4343
if: fromJSON(needs.change-detection.outputs.run-python-tests)
44-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
44+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
4545

4646
build-sdist:
4747
name: 🚀 CD
4848
needs: change-detection
4949
if: fromJSON(needs.change-detection.outputs.run-cd)
50-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
50+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
5151

5252
build-wheel:
5353
name: 🚀 CD
5454
needs: change-detection
5555
if: fromJSON(needs.change-detection.outputs.run-cd)
56-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
56+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@dbcd4474154dda0794838207274a3bccd4550de0 # v1.17.3
5757

5858
# this job does nothing and is only used for branch protection
5959
required-checks-pass:

.github/workflows/templating.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
pull-requests: write
1515
steps:
1616
- id: create-token
17-
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
17+
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
1818
with:
1919
app-id: ${{ secrets.APP_ID }}
2020
private-key: ${{ secrets.APP_PRIVATE_KEY }}
21-
- uses: munich-quantum-toolkit/templates@ee3423de8b910ad0846d5f48edf47d5aebee222f # v1.1.9
21+
- uses: munich-quantum-toolkit/templates@db1400818735d56b0b4fae9e84adbb096b444820 # v1.1.10
2222
with:
2323
token: ${{ steps.create-token.outputs.token }}
2424
name: Predictor

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ repos:
5757

5858
# Python linting and formatting using ruff
5959
- repo: https://github.com/astral-sh/ruff-pre-commit
60-
rev: v0.14.4
60+
rev: v0.14.6
6161
hooks:
6262
- id: ruff-check
6363
args: ["--fix", "--show-fixes"]
@@ -104,7 +104,7 @@ repos:
104104

105105
# Check for spelling
106106
- repo: https://github.com/crate-ci/typos
107-
rev: v1.39.0
107+
rev: v1.39.2
108108
hooks:
109109
- id: typos
110110

@@ -119,22 +119,22 @@ repos:
119119

120120
# Check best practices for scientific Python code
121121
- repo: https://github.com/scientific-python/cookie
122-
rev: 2025.11.07
122+
rev: 2025.11.21
123123
hooks:
124124
- id: sp-repo-review
125125
additional_dependencies: ["repo-review[cli]"]
126126

127127
# Check JSON schemata
128128
- repo: https://github.com/python-jsonschema/check-jsonschema
129-
rev: 0.34.1
129+
rev: 0.35.0
130130
hooks:
131131
- id: check-dependabot
132132
- id: check-github-workflows
133133
- id: check-readthedocs
134134

135135
# Check the pyproject.toml file
136136
- repo: https://github.com/henryiii/validate-pyproject-schema-store
137-
rev: 2025.11.04
137+
rev: 2025.11.21
138138
hooks:
139139
- id: validate-pyproject
140140

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ addopts = [
118118
"--strict-config",
119119
"--showlocals",
120120
]
121-
log_cli_level = "INFO"
121+
log_level = "INFO"
122122
xfail_strict = true
123123
filterwarnings = [
124124
'error',

tests/conftest.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
2+
# Copyright (c) 2025 Munich Quantum Software Company GmbH
3+
# All rights reserved.
4+
#
5+
# SPDX-License-Identifier: MIT
6+
#
7+
# Licensed under the MIT License
8+
9+
"""Clean-up fixtures for the tests."""
10+
11+
from __future__ import annotations
12+
13+
from typing import TYPE_CHECKING
14+
15+
import pytest
16+
17+
from mqt.predictor.ml.helper import get_path_training_data as ml_get_path_training_data
18+
from mqt.predictor.rl.helper import get_path_trained_model as rl_get_path_trained_model
19+
20+
if TYPE_CHECKING:
21+
from collections.abc import Generator
22+
23+
24+
@pytest.fixture(scope="session", autouse=True)
25+
def clean_rl_models() -> Generator[None]:
26+
"""Clean up trained RL models after test session."""
27+
yield
28+
29+
for model in rl_get_path_trained_model().glob("*.zip"):
30+
model.unlink()
31+
32+
33+
@pytest.fixture(scope="session", autouse=True)
34+
def clean_ml_models() -> Generator[None]:
35+
"""Clean up trained ML models after test session."""
36+
yield
37+
38+
for model in (ml_get_path_training_data() / "trained_model").glob("*.joblib"):
39+
model.unlink()
40+
41+
for data in (ml_get_path_training_data() / "training_data_aggregated").glob("*.npy"):
42+
data.unlink()

tests/hellinger_distance/test_estimated_hellinger_distance.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -240,33 +240,6 @@ def test_train_and_qcompile_with_hellinger_model(source_path: Path, target_path:
240240
assert predicted_dev.description in get_available_device_names()
241241

242242

243-
def test_remove_files(source_path: Path, target_path: Path) -> None:
244-
"""Remove files created during testing."""
245-
if source_path.exists():
246-
for file in source_path.iterdir():
247-
if file.suffix == ".qasm":
248-
file.unlink()
249-
source_path.rmdir()
250-
251-
if target_path.exists():
252-
for file in target_path.iterdir():
253-
if file.suffix == ".qasm":
254-
file.unlink()
255-
target_path.rmdir()
256-
257-
data_path = get_path_training_data() / "training_data_aggregated"
258-
if data_path.exists():
259-
for file in data_path.iterdir():
260-
if file.suffix == ".npy":
261-
file.unlink()
262-
263-
model_path = get_path_training_data() / "trained_model"
264-
if model_path.exists():
265-
for file in model_path.iterdir():
266-
if file.suffix == ".joblib":
267-
file.unlink()
268-
269-
270243
def test_predict_device_for_estimated_hellinger_distance_no_device_provided() -> None:
271244
"""Test the error handling of the device selection predictor when no device is provided for the Hellinger distance model."""
272245
rng = np.random.default_rng()

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)