pyfluent: pySystemCoupling example fails with update of pyFluent to 0.30.2
🔍 Before submitting the issue
- I have searched among the existing issues
- I am using a Python virtual environment
🐞 Description of the bug
pySystemCoupling has a doc build dependency on ansys-fluent-core as pyFluent is used in a number of our Sphinx Gallery examples. A dependabot PR was created recently to upgrade the dependency from 0.29.0 to 0.30.2. The doc builds are consistently failing for this update.
The issue is seen in the oscillating_plate example. This couples pyFluent with pyMAPDL. The main solve works fine but some Fluent post-processing facilities are used after the solve to generate a contour plot. The error is in a line that attempts to set the coloring.option value of a contour object to "banded". The error from pyFluent is that the coloring setting is currently “inactive”.
These are the relevant lines of code, for context:
fluent.results.graphics.contour["contour_static_pressure"] = {}
contour = fluent.results.graphics.contour["contour_static_pressure"]
contour.coloring.option = "banded"
This is the traceback:
Traceback (most recent call last):
File "D:\Scratch\pyfluent_issue\oscillating_plate.py", line 234, in <module>
contour.coloring.option = "banded"
^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Scratch\pyfluent_issue\venv\Lib\site-packages\ansys\fluent\core\solver\flobject.py", line 1163, in __setattr__
attr = getattr(self, name)
^^^^^^^^^^^^^^^^^^^
File "D:\Scratch\pyfluent_issue\venv\Lib\site-packages\ansys\fluent\core\solver\flobject.py", line 1133, in __getattribute__
raise InactiveObjectError(self.python_path)
ansys.fluent.core.solver.flobject.InactiveObjectError: '<session>.settings.results.graphics.contour["contour_static_pressure"].coloring' is currently inactive.
📝 Steps to reproduce
Although the GitHub run that fails is using a mixture of 25.1 and 25.2 components (Fluent and MAPDL using 25.1 images and SyC using a 25.2 image) this is not critical. To reproduce the issue on the desktop it was simpler to work with a recent 25.2 unified install so it is assumed in the following that this is available.
Steps are as follows:
- Create a clean directory as a working directory.
- From the pysystem-coupling repo, download the oscillating_plate.py file from examples/00-systemcoupling and copy to the working directory.
- From the pysystem-coupling repo download the ansys-systemcoupling-core-artifacts.zip archive from a recent build on main: (i) Go to Actions “tab”. (ii) Select “GitHub CI” on left sidebar. (iii) Select most recent run on “main” from the list of workflow runs. (iv) Scroll to find ansys-systemcoupling-core-artifacts, and click download icon on right.
- Copy the whl file from the downloaded artifact into the working directory.
- (i) Edit line 94 of oscillating_plate.py to add a version argument as follows:
syc = pysyc.launch(start_output=True, version="25.2")(ii) Edit line 198 to reduce theend_timesetting to 1 (keeps the run time manageable):syc.setup.solution_control.end_time = 1 - Create and activate a virtual environment. NB At this point the working directory should contain only the virtual env subdirectory, the oscillating_plate script and the whl file.
pip installthe PySystemCoupling wheel.pip install ansys-mapdl-core==0.69.3pip install ansys-fluent-core==0.29.0- Run the script (
python oscillating_plate.py) It should run to completion successfully and there should be a file oscplate_pressure_contour.png in the working directory which has been generated using Fluent postprocessing. (Note: Very occasionally, there might be a failure near the beginning of the run where the solvers fail to connect. If this happens try running the script again.) - Clean up the working directory so that it contains only the three items mentioned in (6).
pip uninstall ansys-fluent-corepip install ansys-fluent-core==0.30.2- Repeat the run (
python oscillating_plate.py). This time it fails at line 234 (contour.coloring.option = "banded"). The error isansys.fluent.core.solver.flobject.InactiveObjectError: '<session>.settings.results.graphics.contour["contour_static_pressure"].coloring' is currently inactive.
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
25.2
🐍 Which Python version are you using?
3.11
📦 Installed packages
aiohappyeyeballs==2.6.1
aiohttp==3.11.18
aiosignal==1.3.2
ansys-api-fluent==0.3.35
ansys-api-mapdl==0.5.2
ansys-api-platform-instancemanagement==1.1.3
ansys-api-systemcoupling==0.2.0
ansys-api-tools-filetransfer==0.1.1
ansys-fluent-core==0.30.2
ansys-mapdl-core==0.69.3
ansys-mapdl-reader==0.54.2
ansys-math-core==0.2.2
ansys-platform-instancemanagement==1.1.2
ansys-systemcoupling-core @ file:///D:/Scratch/pyfluent_issue/ansys_systemcoupling_core-0.10.dev0-py3-none-any.whl#sha256=7126decc031f5beaa1f71533e72a90b11203de369eff0e407fac818640c57314
ansys-tools-filetransfer==0.1.1
ansys-tools-path==0.7.1
ansys-tools-visualization-interface==0.9.1
ansys-units==0.4.0
appdirs==1.4.4
attrs==24.2.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
contourpy==1.3.2
cycler==0.12.1
defusedxml==0.7.1
docker==7.1.0
fonttools==4.57.0
frozenlist==1.6.0
geomdl==5.3.1
googleapis-common-protos==1.70.0
grpcio==1.71.0
grpcio-health-checking==1.62.3
grpcio-status==1.62.3
idna==3.10
importlib_metadata==8.6.1
joblib==1.4.2
kiwisolver==1.4.8
lxml==5.4.0
matplotlib==3.10.1
more-itertools==10.7.0
msgpack==1.1.0
multidict==6.4.3
nltk==3.9.1
numpy==2.2.5
packaging==25.0
pandas==2.2.3
pillow==11.2.1
platformdirs==4.3.7
pooch==1.8.2
propcache==0.3.1
protobuf==4.25.6
psutil==7.0.0
pyansys-tools-report==0.8.2
pyansys-tools-versioning==0.6.0
pyiges==0.3.1
pyparsing==3.2.3
python-dateutil==2.9.0.post0
pytz==2025.2
pyvista==0.45.0
pywin32==310
PyYAML==6.0.2
regex==2024.11.6
requests==2.32.3
scipy==1.15.2
scooby==0.10.0
six==1.17.0
tabulate==0.9.0
tqdm==4.67.1
trame==3.8.2
trame-client==3.7.1
trame-server==3.4.0
trame-vtk==2.8.15
trame-vuetify==3.0.1
typing_extensions==4.13.2
tzdata==2025.2
urllib3==2.4.0
vtk==9.4.2
websockets==15.0.1
wslink==2.3.3
yarl==1.20.0
zipp==3.21.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17
@iboyd-ansys You can use either the dictionary approach or the solution suggested by @prmukherj.
You can just change that single line using the solution I have provided. Please update any other instances of the same if they exist. Thank you @iboyd-ansys
Thanks for confirming @prmukherj. I hadn’t been sure if this was a typo.
@iboyd-ansys I have checked above working solution with 25R2 dev area.
Yes, I have confirmed that the inactive error was triggered from the
is_deprecated()call.Actually there are 2 solutions for this:
Please revert if you face further issues.
cc. @iboyd-ansys, @seanpearsonuk, @hpohekar, @mkundu1
@seanpearsonuk @iboyd-ansys
I have tested Fluent part from the
oscillating_plate.pyFollowing modification works fine with Fluent 25.2
oscplate_pressure_contour.png generated successfully.
Tested with
ansys-fluent-core==0.30.2