Skip to content

Commit e3aab20

Browse files
committed
Fix Q3D results on fresh pandas installs
1 parent dce9b11 commit e3aab20

6 files changed

Lines changed: 50 additions & 2 deletions

File tree

docs/source/release_notes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
Release Notes
22
=============
33

4+
Version 0.4.5 (Unreleased)
5+
--------------------------
6+
7+
**Bug Fixes**
8+
9+
- Capped ``pandas`` below 3.0 because ``pyEPR`` still uses the removed
10+
``read_csv(delim_whitespace=...)`` argument when parsing Q3D exported
11+
capacitance matrices. Fresh installs could otherwise solve successfully in
12+
Ansys, fail while loading the matrix, and surface as a confusing
13+
``NoneType`` simulation result.
14+
- ``AnsysSimulator.simulate`` now raises a clear ``RuntimeError`` if a
15+
low-level simulation path returns no result payload, instead of printing
16+
``Simulation Completed Successfully!`` and returning ``None``.
17+
418
Version 0.4.4 (2026-04-19)
519
--------------------------
620

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies = [
2424
"huggingface-hub>=0.21",
2525
# === Scientific Computing ===
2626
"numpy>=1.16.6,<2.0",
27-
"pandas>=1.5",
27+
"pandas>=1.5,<3.0",
2828
"scipy>=1.10",
2929
"numba>=0.60",
3030
"scqubits>=4.0",

squadds/simulations/ansys_simulator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ def simulate(self, device_dict=None, run_async=False):
401401
self.console.rule("[bold cyan]Starting Simulation[/bold cyan]")
402402
try:
403403
result = self._run_simulation(device_dict)
404+
if result is None:
405+
raise RuntimeError(
406+
"Ansys simulation completed without a result payload. "
407+
"Check the Q3D/HFSS logs above for the root error."
408+
)
404409
self.console.print("[bold green]Simulation Completed Successfully![/bold green]")
405410
return result
406411
except Exception as e:

tests/test_ansys_simulator.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
from pathlib import Path
33
from unittest.mock import patch
44

5+
import pytest
6+
7+
import squadds.simulations.ansys_simulator as ansys_simulator_module
58
from squadds.simulations.ansys_simulator import AnsysSimulator
69
from squadds.simulations.drivenmodal.models import (
710
CapacitanceExtractionRequest,
@@ -151,6 +154,24 @@ def test_normalize_device_dict_deserializes_json_like_payloads(headless_qiskit_e
151154
assert simulator.device_dict["setup_cavity_claw"] == {"max_passes": 15}
152155

153156

157+
def test_simulate_raises_when_low_level_simulation_returns_none(monkeypatch, headless_qiskit_environment):
158+
simulator = AnsysSimulator(
159+
DummyAnalyzer("qubit"),
160+
{
161+
"design_options": {"cross_length": "200um"},
162+
"setup": {"max_passes": 1},
163+
},
164+
)
165+
166+
def fake_simulate_single_design(*args, **kwargs):
167+
return None, None, None
168+
169+
monkeypatch.setattr(ansys_simulator_module, "simulate_single_design", fake_simulate_single_design)
170+
171+
with pytest.raises(RuntimeError, match="completed without a result payload"):
172+
simulator.simulate()
173+
174+
154175
def test_run_drivenmodal_initializes_checkpoint_manifest(headless_qiskit_environment, tmp_path: Path):
155176
simulator = AnsysSimulator(
156177
DummyAnalyzer("qubit_claw"),
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from pathlib import Path
2+
3+
4+
def test_pandas_is_capped_below_three_until_pyepr_matrix_parser_is_updated():
5+
pyproject = Path("pyproject.toml").read_text()
6+
pandas_specs = [line.strip().strip('",') for line in pyproject.splitlines() if '"pandas' in line]
7+
8+
assert pandas_specs == ["pandas>=1.5,<3.0"]

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)