Description
Before submitting the issue
- I have searched among the existing issues
- I am using a Python virtual environment
Description of the bug
Dear PyAEDT team!
I need to import a parametric sweep in to my Maxwell 2D design from a .csv file, but when I'm trying to do it withPyAEDT, I get an error message:
[error] script macro error: load_cases - sweep variable must be independent.
When I import the same file manually, it works and the sweep runs without issue.
Steps To Reproduce
from ansys.aedt.core import Maxwell2d
m2d = Maxwell2d(version="2025.1", project="ansys_issue", design="test")
load_case_file = r'C:\Users\xxx\load_cases_final.csv'
m2d.parametrics.add_from_file(input_file=load_case_file, name="load_cases")
Unfortunately our organization doesn't allow uploading file to github, but here's the content of the .csv file, and I can share the .aedt file by email.
*, rated_hv, hv_turns1, hv_turns2, rated_lv, rated_yv
1, 400, 100, 100, 0, 50
2, 400, 100, 100, 50, 0
3, 350, 150, 150, 0, 50
4, 350, 150, 150, 50, 0
5, 450, 200, 200, 0, 50
6, 450, 200, 200, 50, 0
Which Operating System are you using?
Windows
Which Python version are you using?
3.12
Installed packages
accessible-pygments==0.0.5
alabaster==1.0.0
altair==5.5.0
annotated-types==0.7.0
ansys-api-dbu==0.3.16
ansys-api-geometry==0.4.50
ansys-api-mechanical==0.1.2
ansys-dpf-core==0.13.6
ansys-geometry-core==0.10.2
ansys-mechanical-core==0.11.14
ansys-mechanical-env==0.1.9
ansys-mechanical-stubs==0.1.6
ansys-pythonnet==3.1.0rc6
ansys-sphinx-theme==1.4.2
-e git+https://github.com/ansys/python-installer-qt-gui@6b25633990662c05a56c8d2e3b763dd643fc4dd8#egg=ansys_tools_installer
ansys-tools-path==0.7.1
apeye==1.4.1
apeye-core==1.1.5
appdirs==1.4.4
attrs==24.2.0
autodocsumm==0.2.14
babel==2.17.0
beartype==0.20.2
beautifulsoup4==4.13.3
blinker==1.9.0
CacheControl==0.14.2
cachetools==5.5.2
certifi==2024.12.14
cffi==1.17.1
chardet==5.2.0
charset-normalizer==3.4.1
click==8.1.8
clr_loader==0.2.7.post0
colorama==0.4.6
contourpy==1.3.1
coverage==7.8.0
cryptography==44.0.0
cssselect==1.2.0
cssutils==2.11.1
cycler==0.12.1
defusedxml==0.7.1
Deprecated==1.2.18
dict2css==0.3.0.post1
docutils==0.21.2
domdf_python_tools==3.10.0
et_xmlfile==2.0.0
filelock==3.18.0
flatdict==4.0.1
flexcache==0.3
flexparser==0.4
fonttools==4.55.3
fpdf2==2.8.2
geomdl==5.3.1
gitdb==4.0.12
GitPython==3.1.44
grpcio==1.67.1
grpcio-health-checking==1.67.1
html5lib==1.1
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
Jinja2==3.1.5
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
kiwisolver==1.4.8
lxml==5.3.0
markdown-it-py==3.0.0
MarkupSafe==3.0.2
matplotlib==3.10.0
mdurl==0.1.2
more-itertools==10.6.0
msgpack==1.1.0
narwhals==1.27.1
natsort==8.4.0
numpy==2.2.1
openpyxl==3.1.5
packaging==24.2
pandas==2.2.3
pdf2image==1.17.0
pdfminer.six==20240706
pdfquery==0.4.3
pillow==11.0.0
Pint==0.24.4
platformdirs==4.3.6
pluggy==1.5.0
plumbum==1.9.0
pooch==1.8.2
protobuf==5.29.3
psutil==6.1.1
pyaedt==0.17.2
pyarrow==19.0.1
pycparser==2.22
pydantic==2.9.2
pydantic_core==2.23.4
pydata-sphinx-theme==0.16.1
pydeck==0.9.1
pyedb==0.34.3
PyGithub==2.6.1
Pygments==2.19.1
PyJWT==2.10.1
PyNaCl==1.5.0
pyparsing==3.2.0
pypdf==5.1.0
pyquery==2.0.1
PySide6==6.8.3
PySide6_Addons==6.8.3
PySide6_Essentials==6.8.3
pytest==8.3.5
pytest-cov==6.0.0
pytest-qt==4.4.0
python-dateutil==2.9.0.post0
pytz==2024.2
pyvista==0.44.2
pywin32==308
PyYAML==6.0.2
referencing==0.35.1
requests==2.32.3
rich==13.9.4
roman==4.2
roman-numerals-py==3.1.0
rpds-py==0.22.3
rpyc==6.0.1
Rtree==1.3.0
ruamel.yaml==0.18.10
ruamel.yaml.clib==0.2.12
scikit-rf==1.5.0
scipy==1.14.1
scooby==0.10.0
semver==3.0.4
setuptools==78.1.0
shiboken6==6.8.3
six==1.17.0
smmap==5.0.2
snowballstemmer==2.2.0
soupsieve==2.6
Sphinx==8.2.3
sphinx-autodoc-typehints==3.1.0
sphinx-copybutton==0.5.2
sphinx-jinja2-compat==0.3.0
sphinx-prompt==1.9.0
sphinx-tabs==3.4.5
sphinx-toolbox==3.9.0
sphinx_design==0.6.1
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
streamlit==1.43.1
tabulate==0.9.0
tenacity==9.0.0
toml==0.10.2
tomli_w==1.1.0
tornado==6.4.2
tqdm==4.67.1
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.3.0
vtk==9.3.1
watchdog==6.0.0
webencodings==0.5.1
wrapt==1.17.2
xlwings==0.33.11
zipp==3.21.0