Skip to content

Commit c1ffc2f

Browse files
docs: Update ui_mode doc [skip tests] (#4533)
closes #3886 **Context** Prior to this change, the ui_mode parameter in several parts of the PyFluent codebase had an incomplete or slightly misleading docstring. Users could pass either members of the UIMode enum or specific string literals (e.g. "no_gui", "hidden_gui", etc.), but that flexibility was not well documented. This ambiguity could lead to confusion about which string names are valid and how they map to enum values. **Change Summary** Updated the docstrings in launcher.py, slurm_launcher.py, and session_utilities.py to better describe accepted ui_mode values (both enum and string forms). Clarified which string names correspond to which UIMode values (e.g. "no_gui_or_graphics", "no_gui", "hidden_gui", "gui", etc.). Removed or refined outdated or redundant lines in the existing doc comments. Ensured consistency across the codebase about how ui_mode is explained. Marked the PR to skip tests, since only docstrings were changed. **Rationale** Better user experience / usability: Clear documentation helps users (and maintainers) know exactly what ui_mode values are supported. Reduce confusion / errors: Users may try unsupported strings or misuse the enum; this aims to guide them. Maintain consistency: Before, docstrings in different modules had slight variations or omissions. This change harmonizes those descriptions. Low risk: Since only documentation is modified (no logic changes), this is a safe improvement. **Impact** Documentation / developer experience: Anyone reading or using code involving ui_mode will get more precise information on acceptable values. Minimal to no runtime impact: Because no functional logic was changed, existing behavior remains unchanged. Future maintenance: When extending or deprecating a ui_mode, future contributors can rely on the docstrings being consistent across modules. Testing: No tests should break (and the PR is marked [skip tests]), but doc validation tools (if present) may pick up formatting or lint changes. --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent a59be02 commit c1ffc2f

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update ui_mode doc [skip tests]

src/ansys/fluent/core/launcher/container_launcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ def __init__(
118118
----------
119119
mode : FluentMode
120120
Specifies the launch mode of Fluent to target a specific session type.
121-
ui_mode : UIMode
122-
Defines the user interface mode for Fluent. Options correspond to values in the ``UIMode`` enum.
121+
ui_mode : UIMode or str, optional
122+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
123+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
123124
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
124125
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
125126
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).

src/ansys/fluent/core/launcher/launcher.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,8 @@ def launch_fluent(
240240
Fluent transcript subsequently via the method calls, ``transcript.start()``
241241
and ``transcript.stop()`` on the session object.
242242
ui_mode : UIMode or str, optional
243-
Fluent user interface mode. Options are either the values of the ``UIMode``
244-
enum or any of ``"no_gui_or_graphics"``, ``"no_gui"``, ``"hidden_gui"``,
245-
``"no_graphics"`` or ``"gui"``. The default is ``UIMode.HIDDEN_GUI`` in
246-
Windows and ``UIMode.NO_GUI`` in Linux. ``"no_gui_or_graphics"`` and
247-
``"no_gui"`` user interface modes are supported in Windows starting from Fluent
248-
version 2024 R1.
243+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
244+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
249245
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver or str, optional
250246
Graphics driver of Fluent. In Windows, options are either the values of the
251247
``FluentWindowsGraphicsDriver`` enum or any of ``"null"``, ``"msw"``,

src/ansys/fluent/core/launcher/pim_launcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ def __init__(
9696
----------
9797
mode : FluentMode
9898
Specifies the launch mode of Fluent for targeting a specific session type.
99-
ui_mode : UIMode
100-
Defines the user interface mode for Fluent. Options correspond to values in the ``UIMode`` enum.
99+
ui_mode : UIMode or str, optional
100+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
101+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
101102
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
102103
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
103104
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).

src/ansys/fluent/core/launcher/slurm_launcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,9 @@ def __init__(
316316
----------
317317
mode : FluentMode
318318
Launch mode of Fluent to point to a specific session type.
319-
ui_mode : UIMode
320-
Fluent user interface mode. Options are the values of the ``UIMode`` enum.
319+
ui_mode : UIMode or str, optional
320+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
321+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
321322
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
322323
Graphics driver of Fluent. Options are the values of the
323324
``FluentWindowsGraphicsDriver`` enum in Windows or the values of the

src/ansys/fluent/core/launcher/standalone_launcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ def __init__(
113113
----------
114114
mode : FluentMode
115115
Specifies the launch mode of Fluent to target a specific session type.
116-
ui_mode : UIMode
117-
Defines the user interface mode for Fluent. Options correspond to values in the ``UIMode`` enum.
116+
ui_mode : UIMode or str, optional
117+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
118+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
118119
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
119120
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
120121
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).

src/ansys/fluent/core/session_utilities.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ def from_install(
9090
9191
Parameters
9292
----------
93-
ui_mode : UIMode
94-
Defines the user interface mode for Fluent. Options correspond to values in the ``UIMode`` enum.
93+
ui_mode : UIMode or str, optional
94+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
95+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
9596
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
9697
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
9798
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).
@@ -194,8 +195,9 @@ def from_container(
194195
195196
Parameters
196197
----------
197-
ui_mode : UIMode
198-
Defines the user interface mode for Fluent. Options correspond to values in the ``UIMode`` enum.
198+
ui_mode : UIMode or str, optional
199+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
200+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
199201
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
200202
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
201203
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).
@@ -287,7 +289,8 @@ def from_pim(
287289
Parameters
288290
----------
289291
ui_mode : UIMode or str, optional
290-
Defines the user interface mode for Fluent. Options correspond to values in the ``UIMode`` enum.
292+
Defines the user interface mode for Fluent. Accepts either a ``UIMode`` value
293+
or a corresponding string such as ``"no_gui"``, ``"hidden_gui"``, or ``"gui"``.
291294
graphics_driver : FluentWindowsGraphicsDriver or FluentLinuxGraphicsDriver
292295
Specifies the graphics driver for Fluent. Options are from the ``FluentWindowsGraphicsDriver`` enum
293296
(for Windows) or the ``FluentLinuxGraphicsDriver`` enum (for Linux).

0 commit comments

Comments
 (0)