ansys / pyfluent-visualization

Visualize Ansys Fluent simulations using Python
https://visualization.fluent.docs.pyansys.com
MIT License
26 stars 3 forks source link

'Graphics' object has no attribute 'session_handle' #359

Closed answillgm closed 5 months ago

answillgm commented 8 months ago

🔍 Before submitting the issue

🐞 Description of the bug

After creating a contour object (contour1), calling contour1() on the object throws a runtime error:

Traceback (most recent call last):
  File "Graphics_Demo.py", line 34, in <module>
    contour1()
  File "E:\pyfluent\src\ansys\fluent\core\meta.py", line 588, in wrapper
    update_state(self.__class__)
  File "E:\pyfluent\src\ansys\fluent\core\meta.py", line 545, in update_state
    o = getattr(self, name)
  File "E:\pyfluent\src\ansys\fluent\core\meta.py", line 500, in wrapper
    obj = object.__getattribute__(self, name)
  File "E:\pyfluent\src\ansys\fluent\core\meta.py", line 235, in <lambda>
    attrs["session_handle"] = property(lambda self: self.get_session_handle())
  File "E:\pyfluent\src\ansys\fluent\core\meta.py", line 220, in wrapper
    return root.session_handle
AttributeError: 'Graphics' object has no attribute 'session_handle'

This happens in an example Graphics_Demo.py scripts

📝 Steps to reproduce

  1. Download and unzip the attached files
  2. Run the Graphics_Demo.py script - this should fail

recreate.zip

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

24.2

🐍 Which Python version are you using?

3.10

📦 Installed packages

absl-py==2.0.0
ansi2html==1.8.0
ansys-api-fluent==0.3.18
ansys-api-platform-instancemanagement==1.0.0
-e e:\pyfluent
-e e:\pyfluent-parametric
-e e:\pyfluent-visualization
ansys-platform-instancemanagement==1.1.2
asttokens==2.4.1
astunparse==1.6.3
bcrypt==4.0.1
beartype==0.16.4
blinker==1.7.0
cachetools==5.3.2
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.2.0
cryptography==41.0.5
cycler==0.12.1
dash==2.14.1
dash-bootstrap-components==1.5.0
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
decorator==5.1.1
docker==6.1.3
et-xmlfile==1.1.0
exceptiongroup==1.1.3
executing==2.0.1
Flask==3.0.0
flatbuffers==23.5.26
fonttools==4.44.3
gast==0.5.4
google-auth==2.23.4
google-auth-oauthlib==1.1.0
google-pasta==0.2.0
grpcio==1.59.3
grpcio-health-checking==1.48.2
h5py==3.10.0
idna==3.4
imageio==2.33.0
importlib-metadata==6.8.0
ipython==8.17.2
itsdangerous==2.1.2
jedi==0.19.1
Jinja2==3.1.2
joblib==1.3.2
kaleido==0.2.1
keras==2.15.0
kiwisolver==1.4.5
libclang==16.0.6
lxml==4.9.3
Markdown==3.5.1
MarkupSafe==2.1.3
matplotlib==3.8.2
matplotlib-inline==0.1.6
ml-dtypes==0.2.0
nest-asyncio==1.5.8
numpy==1.26.2
oauthlib==3.2.2
openpyxl==3.1.2
opt-einsum==3.3.0
packaging==23.2
pandas==2.1.3
paramiko==3.3.1
paramiko-expect==0.3.5
parso==0.8.3
Pillow==10.1.0
platformdirs==4.0.0
plotly==5.18.0
pooch==1.8.0
prompt-toolkit==3.0.41
protobuf==3.20.3
psutil==5.9.6
pure-eval==0.2.2
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.17.1
PyNaCl==1.5.0
pyparsing==3.1.1
PySide6==6.6.0
PySide6-Addons==6.6.0
PySide6-Essentials==6.6.0
python-dateutil==2.8.2
python-pptx==0.6.23
pytz==2023.3.post1
pyvista==0.42.3
pyvistaqt==0.11.0
pywin32==306
PyYAML==6.0.1
QtPy==2.4.1
requests==2.31.0
requests-oauthlib==1.3.1
retrying==1.3.4
rsa==4.9
scikit-learn==1.3.2
scipy==1.11.4
scooby==0.9.2
seaborn==0.13.0
shiboken6==6.6.0
six==1.16.0
stack-data==0.6.3
tenacity==8.2.3
tensorboard==2.15.1
tensorboard-data-server==0.7.2
tensorflow==2.15.0
tensorflow-estimator==2.15.0
tensorflow-intel==2.15.0
tensorflow-io-gcs-filesystem==0.31.0
termcolor==2.3.0
threadpoolctl==3.2.0
traitlets==5.13.0
typing_extensions==4.8.0
tzdata==2023.3
urllib3==2.1.0
vtk==9.3.20230807rc0
wcwidth==0.2.10
websocket-client==1.6.4
Werkzeug==3.0.1
wrapt==1.14.1
xgboost==2.0.2
XlsxWriter==3.1.9
zipp==3.17.0
velpulagopiraju commented 6 months ago

getting same error. did you find the solution for this?

cj-hodgson commented 6 months ago

@seanpearsonuk @mkundu1 Please could someone take a look at this. Thanks

seanpearsonuk commented 6 months ago

@cj-hodgson @seanpearsonuk this issue also appears in fluent pyconsole

@answillgm, can you clarify this point? This code shouldn't come pre-installed with Fluent.

answillgm commented 6 months ago

@seanpearsonuk my mistake I ran the script in fluent with the pyfluent integration enabled, ignore my previous comment

prmukherj commented 5 months ago

This issue has been resolved in the current pyfluent release.

millerj97 commented 5 months ago

@prmukherj is it fixed in dev9 release? Currently in dev8 we have this issue occurring in regression tests

millerj97 commented 5 months ago

@prmukherj this issue is no longer present in regression tests