ansys / pyaedt

AEDT Python Client Package
https://aedt.docs.pyansys.com
MIT License
201 stars 120 forks source link

Variables parameters can't be updated in Optimization #2900

Closed linmingchih closed 1 year ago

linmingchih commented 1 year ago

Before submitting the issue

Description of the bug

image

from pyaedt import Q2d

q2d = Q2d(specified_version='2023.1')

%%

x = q2d.optimizations.setups[0].props['Variables'] x['trace_s'][1] = 'int=false' x.update() q2d.optimizations.setups[0].props['Variables'].update() q2d.optimizations.setups[0].props.update() q2d.optimizations.setups[0].update()

Steps To Reproduce

Run the code above, check the property in optimization update

Which Operating System are you using?

Windows

Which Python version are you using?

3.10

Installed packages

ansys-api-mechanical==0.1.0 ansys-api-platform-instancemanagement==1.0.0b3 ansys-mechanical-core==0.7.2 ansys-platform-instancemanagement==1.0.3 ansys-pythonnet==3.1.0rc1 appdirs==1.4.4 backcall==0.2.0 cffi==1.15.1 cloudpickle==2.2.1 clr-loader==0.2.5 colorama==0.4.6 comm==0.1.3 contourpy==1.0.7 cycler==0.11.0 debugpy==1.6.7 decorator==5.1.1 entrypoints==0.4 fonttools==4.39.3 googleapis-common-protos==1.59.0 grpcio==1.53.0 importlib-metadata==6.4.1 ipykernel==6.22.0 ipython==7.34.0 jedi==0.18.2 joblib==1.2.0 jupyter_client==7.4.9 jupyter_core==5.3.0 kiwisolver==1.4.4 matplotlib==3.7.1 matplotlib-inline==0.1.6 nest-asyncio==1.5.6 numpy==1.24.2 packaging==23.1 pandas==2.0.0 parso==0.8.3 pickleshare==0.7.5 Pillow==9.5.0 platformdirs==3.2.0 plumbum==1.8.1 prompt-toolkit==3.0.38 protobuf==3.20.3 protoc-gen-swagger==0.1.0 psutil==5.9.5 pyaedt==0.6.71 pycparser==2.21 Pygments==2.15.0 pyparsing==3.0.9 python-dateutil==2.8.2 pythonnet==3.0.1 pytz==2023.3 pywin32==306 pyzmq==25.0.2 rpyc==5.3.0 scikit-learn==1.2.2 scipy==1.10.1 six==1.16.0 spyder-kernels==2.3.3 threadpoolctl==3.1.0 tornado==6.2 tqdm==4.65.0 traitlets==5.9.0 tzdata==2023.3 wcwidth==0.2.6 zipp==3.15.0

Samuelopez-ansys commented 1 year ago

@linmingchih I have fixed the issue in the attached Pull request. Please try:

q2d.optimizations.setups[0].props["Variables"]['trace_s'][1] = False
q2d.optimizations.setups[0].update()