Skip to content

Commit 6492eae

Browse files
committed
Try to debug numpy issue
1 parent 8afc9fb commit 6492eae

5 files changed

Lines changed: 60 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test-array:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
runs-on:
12+
[
13+
ubuntu-24.04,
14+
ubuntu-24.04-arm,
15+
macos-15,
16+
macos-15-intel,
17+
windows-2025,
18+
]
19+
20+
runs-on: ${{ matrix.runs-on }}
21+
22+
steps:
23+
- name: Check out repository
24+
uses: actions/checkout@v6.0.2
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v6.2.0
28+
with:
29+
python-version: "3.13"
30+
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install numpy pytest threadpoolctl
35+
36+
- name: Run array test
37+
run: pytest

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
nox.needs_version = ">=2025.10.16"
3333
nox.options.default_venv_backend = "uv"
3434

35-
PYTHON_ALL_VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
35+
PYTHON_ALL_VERSIONS = ["3.14"]
3636

3737
if os.environ.get("CI", None):
3838
nox.options.error_on_missing_interpreters = True
@@ -98,6 +98,7 @@ def _run_tests(
9898
)
9999
if extra_command:
100100
session.run(*extra_command, env=env)
101+
session.run("uv", "pip", "install", "threadpoolctl")
101102
if "--cov" in session.posargs:
102103
# try to use the lighter-weight `sys.monitoring` coverage core
103104
env["COVERAGE_CORE"] = "sysmon"

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,10 @@ write_to = "python/mqt/qudits/_version.py"
141141

142142
[tool.pytest]
143143
minversion = "9.0"
144-
testpaths = ["test/python"]
144+
testpaths = ["test/python/test_array.py"]
145145
strict = true
146146
addopts = [
147147
"-ra",
148-
"--showlocals",
149-
"--numprocesses=auto", # Automatically use all available CPU cores for parallel testing
150148
]
151149
log_level = "INFO"
152150
filterwarnings = [

test/python/test_array.npy

244 KB
Binary file not shown.

test/python/test_array.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2023 - 2026 Chair for Design Automation, TUM
2+
# Copyright (c) 2025 - 2026 Munich Quantum Software Company GmbH
3+
# All rights reserved.
4+
#
5+
# SPDX-License-Identifier: MIT
6+
#
7+
# Licensed under the MIT License
8+
9+
from pathlib import Path
10+
11+
import numpy as np
12+
13+
14+
def test_array() -> None:
15+
np.show_runtime()
16+
test_array_path = Path(__file__).parent / "test_array.npy"
17+
test_array = np.load(test_array_path)
18+
norm = np.linalg.norm(test_array)
19+
print(f"norm = {norm}")
20+
assert np.isclose(norm, 1.0)

0 commit comments

Comments
 (0)