Closed cj-hodgson closed 2 months ago
I could not reproduce it in the latest PyFluent:
>>> solver.nonsense()
pyfluent.settings_api WARNING: Mismatch between generated file and server object info. Dynamically created settings classes will be used.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\ANSYSDev\PyFluentDev\pyfluent\src\ansys\fluent\core\session_solver.py", line 297, in __getattr__
return getattr(self._settings_api_root, attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SettingsRoot' object has no attribute 'nonsense'
Can you please try with the latest code? That deprecation warning and the AttributeError should be mutually exclusive.
@mkundu1 Did you try in iPython?
IPython shows some extra code around the error line. This is an IPython specific behaviour.
This is a standard ipython behaviour. cc. @mkundu1, @cj-hodgson
π Before submitting the issue
π Description of the bug
In iPython, when an AttributeError occurs the traceback contains DeprecatedSettingsWarning:
π Steps to reproduce
In [1]: import ansys.fluent.core as pyfluent
In [2]: solver = pyfluent.launch_fluent()
In [3]: solver.nonsense() pyfluent.settings_api WARNING: Mismatch between generated file and server object info. Dynamically created settings classes will be used.
AttributeError Traceback (most recent call last) Cell In[3], line 1 ----> 1 solver.nonsense()
File C:\ansysdev\ansys_inc\v251\commonfiles\CPython\3_10\winx64\Release\python\lib\site-packages\ansys\fluent\core\session_solver.py:293, in Solver.getattr(self, attr) 288 if self.get_fluent_version() > FluentVersion.v242: 289 warnings.warn( 290 f"'{attr}' is deprecated. Use 'settings.{attr}' instead.", 291 DeprecatedSettingWarning, 292 ) --> 293 return getattr(self._settings_api_root, attr)
AttributeError: 'SettingsRoot' object has no attribute 'nonsense'
π» Which operating system are you using?
Windows
π Which ANSYS version are you using?
2025R1
π Which Python version are you using?
3.10
π¦ Installed packages