Skip to content

Commit c8aac54

Browse files
renovate[bot]denialhaagpre-commit-ci[bot]
authored
⬆️🔒️ Lock file maintenance (#516)
This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/munich-quantum-toolkit/predictor). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQyLjEzLjUiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyIsInB5dGhvbiJdfQ==--> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c2c202a commit c8aac54

File tree

3 files changed

+427
-412
lines changed

3 files changed

+427
-412
lines changed

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
@@ -249,33 +249,6 @@ def test_train_and_qcompile_with_hellinger_model(source_path: Path, target_path:
249249
assert predicted_dev.description in get_available_device_names()
250250

251251

252-
def test_remove_files(source_path: Path, target_path: Path) -> None:
253-
"""Remove files created during testing."""
254-
if source_path.exists():
255-
for file in source_path.iterdir():
256-
if file.suffix == ".qasm":
257-
file.unlink()
258-
source_path.rmdir()
259-
260-
if target_path.exists():
261-
for file in target_path.iterdir():
262-
if file.suffix == ".qasm":
263-
file.unlink()
264-
target_path.rmdir()
265-
266-
data_path = get_path_training_data() / "training_data_aggregated"
267-
if data_path.exists():
268-
for file in data_path.iterdir():
269-
if file.suffix == ".npy":
270-
file.unlink()
271-
272-
model_path = get_path_training_data() / "trained_model"
273-
if model_path.exists():
274-
for file in model_path.iterdir():
275-
if file.suffix == ".joblib":
276-
file.unlink()
277-
278-
279252
def test_predict_device_for_estimated_hellinger_distance_no_device_provided() -> None:
280253
"""Test the error handling of the device selection predictor when no device is provided for the Hellinger distance model."""
281254
rng = np.random.default_rng()

0 commit comments

Comments
 (0)