Skip to content

Commit 4696a5c

Browse files
fix: No warning for None values and remove a doc dependency (#4197)
1. Remove tensorflow dependency as it is supported for Python version <= 3.10. 2. quarto-cli works fine after updating ansys-sphinx-theme. 3. Do not show a warning if graphics_drivers or ui_mode are None. We will merge this PR before creating a release. Earlier - ``` solver = launch_fluent(start_container=True, dry_run=True) /home/hpohekar/pyfluent/src/ansys/fluent/core/launcher/launch_options.py:309: PyFluentUserWarning: User-specified value for graphics driver is ignored while launching Fluent without GUI or without graphics. warnings.warn( pyfluent.launcher WARNING: Configuring Fluent container to mount to /home/hpohekar/pyfluent, with this path available as /home/container/workdir for the Fluent session running inside the container. ``` Now - ``` solver = launch_fluent(start_container=True, dry_run=True) pyfluent.launcher WARNING: Configuring Fluent container to mount to /home/hpohekar/pyfluent, with this path available as /home/container/workdir for the Fluent session running inside the container. ``` --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent bec3013 commit 4696a5c

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

doc/changelog.d/4197.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
No warning for None values and remove a doc dependency

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ docs = [
7272
"quarto-cli==1.7.32",
7373
"pdf2image==1.17.0",
7474
"seaborn>=0.13.2",
75-
"tensorflow>=2.17.0",
7675
]
7776

7877
[tool.flit.module]

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ def _get_graphics_driver(
293293
ui_mode: UIMode | None = None,
294294
):
295295
ui_mode_ = UIMode(ui_mode)
296+
if graphics_driver is not None and ui_mode_ not in {UIMode.GUI, UIMode.HIDDEN_GUI}:
297+
warnings.warn(
298+
"User-specified value for graphics driver is ignored while launching Fluent without GUI or without graphics.",
299+
PyFluentUserWarning,
300+
)
296301
if isinstance(
297302
graphics_driver, (FluentWindowsGraphicsDriver, FluentLinuxGraphicsDriver)
298303
):
@@ -302,14 +307,6 @@ def _get_graphics_driver(
302307
if is_windows()
303308
else FluentLinuxGraphicsDriver(graphics_driver)
304309
)
305-
if graphics_driver.value != "null" and ui_mode_ not in {
306-
UIMode.GUI,
307-
UIMode.HIDDEN_GUI,
308-
}:
309-
warnings.warn(
310-
"User-specified value for graphics driver is ignored while launching Fluent without GUI or without graphics.",
311-
PyFluentUserWarning,
312-
)
313310
if _should_add_driver_null(ui_mode_):
314311
return (
315312
FluentWindowsGraphicsDriver.NULL

tests/test_launcher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,3 +706,9 @@ def test_warning_in_linux():
706706
ui_mode=UIMode.NO_GUI_OR_GRAPHICS,
707707
)
708708
assert driver == FluentLinuxGraphicsDriver.NULL
709+
710+
711+
def test_no_warning_for_none_values(caplog):
712+
driver = _get_graphics_driver(graphics_driver=None, ui_mode=None) # noqa: F841
713+
assert "PyFluentUserWarning" not in caplog.text
714+
caplog.clear()

0 commit comments

Comments
 (0)