Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I try to retrieve data using ‘solver_session. solution_variable_info’ and ‘solver_session. solution_variable_data’, it prompts' has no attribute 'solution_variable_info' #2784

Closed
2 tasks done
tryzang opened this issue May 6, 2024 · 3 comments · Fixed by #2790
Assignees
Labels
bug Something isn't working

Comments

@tryzang
Copy link

tryzang commented May 6, 2024

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

I first imported the .cas and .dat files, and then I wanted to get the relevant data, but I got an error message, here is my source code and error message
Source code

import ansys.fluent.core as pyfluent
from ansys.fluent.visualization import set_config

solver_session = pyfluent.launch_fluent(
    mode="solver"
)
set_config(blocking=True, set_view_on_display="isometric")
import_case = "R1.cas"
import_data = "R1.dat"
solver_session.tui.file.read_case(import_case)
solver_session.tui.file.read_data(import_data)

solution_variable_info = solver_session.solution_variable_info
solution_variable_data = solver_session.solution_variable_data

#etc.

Error message

Traceback (most recent call last):
  File "D:\Desktop\PyANSYS\R1.py", line 18, in <module>
    solution_variable_info = solver_session.solution_variable_info
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\python\anaconda\envs\PyANSYS\Lib\site-packages\ansys\fluent\core\session_solver.py", line 255, in __getattr__
    return getattr(self._settings_api_root, attr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SettingsRoot' object has no attribute 'solution_variable_info'

进程已结束,退出代码为 1

📝 Steps to reproduce

Directly running it may yield the same result. The two files used in my code cannot be uploaded due to occupying too much space, but I can ensure that the model and data files are read correctly

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

Anasys 2024 R1

🐍 Which Python version are you using?

3.12

📦 Installed packages

about-time==4.2.1
aiohttp==3.9.5
aiosignal==1.3.1
alive-progress==3.1.5
annotated-types==0.6.0
ansys-additive-core==0.17.2
ansys-api-acp==0.1.0.dev8
ansys-api-additive==1.7.2
ansys-api-dbu==0.3.0
ansys-api-dyna==0.3.6
ansys-api-edb==1.0.3
ansys-api-fluent==0.3.22
ansys-api-geometry==0.3.8
ansys-api-mapdl==0.5.1
ansys-api-mechanical==0.1.1
ansys-api-meshing-prime==0.1.2
ansys-api-modelcenter==0.3.1
ansys-api-platform-instancemanagement==1.1.0
ansys-api-pyensight==0.3.7
ansys-api-sherlock==0.1.22
ansys-api-systemcoupling==0.1.0
ansys-api-tools-filetransfer==0.1.0
ansys-dpf-composites==0.4.0
ansys-dpf-core==0.10.1
ansys-dpf-post==0.6.0
ansys-dyna-core==0.4.13
ansys-dynamicreporting-core==0.5.1
ansys-edb-core==0.1.3
ansys-fluent-core==0.19.2
ansys-fluent-parametric==0.9.0
ansys-fluent-visualization==0.8.0
ansys-geometry-core==0.4.11
ansys-grantami-bomanalytics==2.0.0
ansys-grantami-bomanalytics-openapi==2.0.0
ansys-grantami-recordlists==1.1.0
ansys-grantami-serverapi-openapi==2.0.0
ansys-hps-client==0.7.1
ansys-mapdl-core==0.68.1
ansys-mapdl-reader==0.53.0
ansys-math-core==0.1.3
ansys-mechanical-core==0.10.8
ansys-mechanical-env==0.1.4
ansys-meshing-prime==0.5.1
ansys-motorcad-core==0.4.3
ansys-openapi-common==1.5.1
ansys-optislang-core==0.6.3
ansys-platform-instancemanagement==1.1.2
ansys-pyensight-core==0.7.8
ansys-pythonnet==3.1.0rc3
ansys-rocky-core==0.1.0
ansys-seascape==0.2.0
ansys-sherlock-core==0.4.0
ansys-simai-core==0.1.4
ansys-systemcoupling-core==0.4.1
ansys-tools-filetransfer==0.1.0
ansys-tools-local-product-launcher==0.1.0
ansys-tools-path==0.5.2
ansys-turbogrid-api==0.4.0
ansys-turbogrid-core==0.4.0
ansys-units==0.3.2
anyio==4.3.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/argon2-cffi-bindings_1699549801117/work
arrow==1.3.0
asgiref==3.8.1
asttokens==2.4.1
async-lru @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/async-lru_1701796859357/work
attrs==23.2.0
Babel==2.14.0
backoff==2.2.1
backports.entry-points-selectable==1.3.0
bcrypt==4.1.2
beartype==0.17.2
beautifulsoup4==4.12.3
bleach==6.1.0
bokeh==3.4.1
Brotli==1.1.0
build==1.2.1
cachetools==5.3.3
certifi @ file:///C:/b/abs_35d7n66oz9/croot/certifi_1707229248467/work/certifi
cffi @ file:///C:/b/abs_924gv1kxzj/croot/cffi_1700254355075/work
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
clr-loader==0.2.6
colorama @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/colorama_1699472650914/work
comm==0.2.2
contourpy==1.2.1
cryptography==42.0.5
cycler==0.12.1
debugpy==1.8.1
decorator @ file:///opt/conda/conda-bld/decorator_1643638310831/work
defusedxml @ file:///tmp/build/80754af9/defusedxml_1615228127516/work
Deprecated==1.2.14
deprecation==2.1.0
dill==0.3.8
Django==5.0.4
docker==6.1.3
docutils==0.21.2
ecdsa==0.19.0
elementpath==4.4.0
executing==2.0.1
fabric==3.2.2
fastjsonschema==2.19.1
filelock==3.14.0
fonttools==4.51.0
fpdf2==2.7.8
fqdn==1.5.1
frozenlist==1.4.1
geomdl==5.3.1
google-api-core==2.18.0
google-api-python-client==2.127.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
googleapis-common-protos==1.63.0
grapheme==0.6.0
grpcio==1.62.2
grpcio-health-checking==1.48.2
grpcio-status==1.48.2
h11==0.14.0
h5py==3.11.0
httpcore==1.0.5
httplib2==0.22.0
httpx==0.27.0
idna==3.7
importlib_metadata==7.1.0
invoke==2.2.0
ipykernel==6.29.4
ipython==8.24.0
ipywidgets @ file:///C:/b/abs_25rsd7yhd4/croot/ipywidgets_1709575117021/work
isoduration==20.11.0
jaraco.classes==3.4.0
jaraco.context==5.3.0
jaraco.functools==4.0.1
jedi==0.19.1
Jinja2 @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/jinja2_1707426091452/work
json5==0.9.25
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter @ file:///C:/b/abs_03nm7xrhxz/croot/jupyter_1709837239940/work
jupyter-console @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/jupyter_console_1707430148515/work
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.1
jupyter_core==5.7.2
jupyter_server==2.14.0
jupyter_server_terminals==0.5.3
jupyterlab==4.1.8
jupyterlab-widgets @ file:///C:/b/abs_62picw9xos/croot/jupyterlab_widgets_1709323131962/work
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.1
jwcrypto==1.5.6
keyring==25.2.0
kiwisolver==1.4.5
linkify-it-py==2.0.3
lxml==4.9.4
Markdown==3.6
markdown-it-py==3.0.0
MarkupSafe==2.1.5
marshmallow==3.21.1
marshmallow-oneofschema==3.1.1
matplotlib==3.8.4
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.0
mdurl==0.1.2
mistune==3.0.2
more-itertools==10.2.0
mpld3==0.5.10
msgpack==1.0.8
multidict==6.0.5
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio @ file:///C:/b/abs_65d6lblmoi/croot/nest-asyncio_1708532721305/work
nh3==0.2.17
notebook==7.1.3
notebook_shim==0.2.4
numpy==1.26.4
overrides==7.7.0
packaging==24.0
pandas==1.5.3
pandocfilters==1.5.1
panel==1.4.2
param==2.1.0
paramiko==3.4.0
parso==0.8.4
pillow==10.3.0
Pint==0.23
pip-review==1.3.0
pkginfo==1.10.0
platformdirs==3.11.0
plotly==5.21.0
plumbum==1.8.3
ply @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/ply_1699473999871/work
pooch==1.8.1
prometheus_client==0.20.0
prompt-toolkit @ file:///C:/b/abs_68uwr58ed1/croot/prompt-toolkit_1704404394082/work
proto-plus==1.23.0
protobuf==3.20.3
psutil==5.9.8
pure-eval @ file:///opt/conda/conda-bld/pure_eval_1646925070566/work
pyaedt==0.7.10
pyansys==2024.1.8
pyansys-tools-variableinterop==0.1.1
pyansys-tools-versioning==0.5.0
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
pydantic==2.7.1
pydantic_core==2.18.2
pyedb==0.9.0
Pygments==2.17.2
pygranta==2024.1.0
pyiges==0.3.1
PyJWT==2.8.0
PyNaCl==1.5.0
pyparsing==3.1.2
pypiwin32==223
pypng==0.20220715.0
pyproject_hooks==1.1.0
PyQt5==5.15.10
PyQt5-sip @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/pyqt-split_1699478669290/work/pyqt_sip
Pyro5==5.15
PySide6==6.7.0
PySide6_Addons==6.7.0
PySide6_Essentials==6.7.0
PySocks @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/pysocks_1699473336188/work
pyspnego==0.10.2
python-dateutil==2.9.0.post0
python-jose==3.3.0
python-json-logger @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/python-json-logger_1699543626759/work
python-keycloak==2.0.0
pytwin==0.6.0
pytz @ file:///C:/b/abs_6ap4tsz1ox/croot/pytz_1713974360290/work
pyvista==0.43.4
pyvistaqt==0.11.0
pyviz_comms==3.0.2
pywin32==306
pywin32-ctypes==0.2.2
pywinpty==2.0.13
PyYAML @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/pyyaml_1699479991712/work
pyzmq==26.0.2
qtconsole @ file:///C:/b/abs_03f8rg9vl6/croot/qtconsole_1709231218069/work
QtPy @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/qtpy_1701807198514/work
readme_renderer==43.0
referencing==0.35.0
requests @ file:///C:/b/abs_474vaa3x9e/croot/requests_1707355619957/work
requests-negotiate-sspi==0.5.2
requests-ntlm==1.2.0
requests-toolbelt==1.0.0
rfc3339-validator @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/rfc3339-validator_1699543924991/work
rfc3986==2.0.0
rfc3986-validator @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/rfc3986-validator_1699543955651/work
rich==13.7.1
rpds-py==0.18.0
rpyc==5.3.1
rsa==4.9
Rtree==1.2.0
scipy==1.13.0
scooby==0.9.2
semver==3.0.2
Send2Trash==1.8.3
serpent==1.41
setuptools==69.5.1
shiboken6==6.7.0
sip==6.8.3
six @ file:///tmp/build/80754af9/six_1644875935023/work
sniffio==1.3.1
soupsieve @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/soupsieve_1699496611169/work
sqlparse==0.5.0
sseclient-py==1.8.0
sspilib==0.1.0
stack-data==0.6.3
tabulate==0.9.0
tenacity==8.2.3
terminado==0.18.1
tinycss2==1.3.0
toml==0.10.2
tomli==2.0.1
tornado==6.4
tqdm==4.66.2
traitlets==5.14.3
trame==3.6.0
trame-client==3.0.2
trame-server==3.0.0
twine==5.0.0
types-python-dateutil==2.9.0.20240316
typing_extensions==4.11.0
tzdata==2024.1
uc-micro-py==1.0.3
uri-template==1.3.0
uritemplate==4.1.1
urllib3==1.26.18
vtk==9.3.0
wakepy==0.7.2
wcwidth==0.2.13
webcolors==1.13
webencodings @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/webencodings_1699497069416/work
websocket-client==1.8.0
wheel==0.43.0
widgetsnbextension @ file:///C:/b/abs_a84ycxud7_/croot/widgetsnbextension_1709322945280/work
win-inet-pton @ file:///C:/Users/dev-admin/perseverance-python-buildout/croot/win_inet_pton_1699472992992/work
wrapt==1.16.0
wslink==2.0.2
xmlschema==2.5.1
xyzservices==2024.4.0
yarl==1.9.4
zipp==3.18.1
@tryzang tryzang added the bug Something isn't working label May 6, 2024
@prmukherj prmukherj self-assigned this May 7, 2024
@prmukherj
Copy link
Collaborator

prmukherj commented May 7, 2024

@tryzang, now the implementation has changed to: solver_session.fields.solution_variable_info and solver_session.fields.solution_variable_data, respectively. The documentation has also been updated recently, which will be part of the next stable PyFluent release.

Thank you.

@tryzang
Copy link
Author

tryzang commented May 8, 2024

Hello, @prmukherj
I just tried solver_session.fields.solution_variable_info and solver_session.fields.solution_variable_data, and still shows an error with no associated attributes, AttributeError: 'SettingsRoot' object has no attribute 'fields' . Is there currently no way to use solution_variable_info and solution_variable_data related methods but to wait for the release of the next stable version of pyfluent?
Also, what can I do to make sure that the implementation in pyfluent I'm using is consistent with the documentation I'm reading?
Thank you for your reply and good luck!

@prmukherj
Copy link
Collaborator

Hi @tryzang,
Since you are using "ansys-fluent-core==0.19.2", you need to access using "solver_session.svar_info" and "solver_session.svar_data", respectively. In the current release these will throw deprecated warnings and you can access using the way mentioned in the comments.
For doc you can follow the doc released with the particular PyPi release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants