SimulationSetup.sweep_data fails on Discrete Sweep
- Dominant language
- Python
- Stars
- 7
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### 🔍 Before submitting the issue
- [x] I have searched among the existing issues
- [x] I am using a Python virtual environment
### 🐞 Description of the bug
When getting sweep data from a simulation setup, if the sweep is a discrete sweep with one point, it fails with following trace:
File "d:\source\assembler_edbcore\.venv\Lib\site-packages\ansys\edb\core\simulation_setup\simulation_setup.py", line 444, in sweep_data
sweep_data.append(_msg_to_sweep_data(sweep_data_msg))
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "d:\source\assembler_edbcore\.venv\Lib\site-packages\ansys\edb\core\simulation_setup\simulation_setup.py", line 374, in _msg_to_sweep_data
FrequencyData(Distribution[params[0]], *params[1:4])
~~~~~~~~~~~~^^^^^^^^^^^
File "C:\Users\karib\AppData\Roaming\uv\python\cpython-3.13-windows-x86_64-none\Lib\enum.py", line 794, in __getitem__
return cls._member_map_[name]
~~~~~~~~~~~~~~~~^^^^^^
KeyError: '15.5GHz'
### 📝 Steps to reproduce
with session.session(ansys_em_root=ansysem_path)
edb = Database.open(db_path, read_only=True)
layout = edb.top_circuit_cells[0].layout
cell = layout.cell
for simulation_setup in cell.simulation_setups:
if simulation_setup.type != SimulationSetupType.HFSS:
logger.warning("Solution setup that is not HFSS found, will ignore")
continue
solve_setup_name = simulation_setup.name
sim_setup_info = simulation_setup
sweeps = []
if sim_setup_info.sweep_data is None or len(sim_setup_info.sweep_data) == 0:
return sweeps
sd = sim_setup_info.sweep_data
### 💻 Which operating system are you using?
Windows
### 📀 Which ANSYS version are you using?
26R1
### 🐍 Which Python version are you using?
3.13
### 📦 Installed packages
```shell
annotated-types==0.7.0
ansys-api-edb==0.3.2
ansys-edb-core==0.3.2
ansys-pythonnet==3.1.0rc8
ansys-tools-common==0.5.0
asgiref==3.11.1
attrs==26.1.0
black==26.3.1
certifi==2026.5.20
cffi==2.0.0
cfgv==3.5.0
charset-normalizer==3.4.7
click==8.4.0
clr_loader==0.3.1
colorama==0.4.6
defusedxml==0.7.1
distlib==0.4.0
Django==6.0.5
docopt==0.6.2
execnet==2.1.2
filelock==3.29.0
flake8==7.3.0
flake8-unused-arguments==0.0.14
grpcio==1.78.0
identify==2.6.19
idna==3.15
iniconfig==2.3.0
isort==8.0.1
Jinja2==3.1.6
jsonschema==4.26.0
jsonschema-specifications==2025.9.1
MarkupSafe==3.0.3
mccabe==0.7.0
mypy_extensions==1.1.0
nodeenv==1.10.0
numpy==2.2.6
packaging==26.2
pathspec==1.1.1
platformdirs==4.9.6
pluggy==1.6.0
portalocker==3.2.0
pre_commit==4.5.1
protobuf==6.33.6
psutil==7.2.2
pyaedt==1.0.0rc1
pycodestyle==2.14.0
pycparser==3.0
pydantic==2.12.5
pydantic_core==2.41.5
pyedb==0.71.0
pyflakes==3.4.0
Pygments==2.20.0
PySide6==6.11.0
pyside6-qml-stubgen==0.1.0a10
PySide6_Addons==6.11.0
PySide6_Essentials==6.11.0
pytest==9.0.2
pytest-qt==4.5.0
pytest-xdist==3.8.0
python-discovery==1.3.1
pytokens==0.4.1
pywin32==311
PyYAML==6.0.3
referencing==0.37.0
requests==2.34.2
rpds-py==0.30.0
scooby==0.11.2
shapely==2.1.2
shiboken6==6.11.0
sqlparse==0.5.5
toml==0.10.2
tomli_w==1.2.0
towncrier==25.8.0
typing-inspection==0.4.2
typing_extensions==4.15.0
tzdata==2026.2
urllib3==2.7.0
virtualenv==21.3.3
xmltodict==1.0.4
```
Contributor guide
Research direction
Start in ansys/edb/core/simulation_setup/simulation_setup.py at sweep_data and _msg_to_sweep_data, using the provided discrete sweep with one point to reproduce the KeyError. Trace how the sweep message is converted into FrequencyData and verify that the completed behavior returns sweep data without failing for the reported 15.5GHz value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100