Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ansys/fluent/core/launcher/fluent_launcher_options.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"2d"
],
"default": "3d",
"required": true,
"fluent_required": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-). OK, so it means that Fluent requires that this argument be included onto the command line.

Can you put comments in a json file? Maybe document each entry at the top?

Copy link
Contributor Author

@mkundu1 mkundu1 May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, all fields starting within "fluent_" are fluent-specific in the json.

The json format doesn't have a syntax for adding comments. If we need to add comments, we need to add a field named "comment". Alternatively, the json can be replaced with yaml or toml which supports inline comments (Python 3.11 will natively support toml - link).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Mainak. Makes sense.

"fluent_format": " {}"
},
"precision": {
Expand All @@ -16,7 +16,7 @@
"double"
],
"default": "double",
"required": true,
"fluent_required": true,
"fluent_map": {
"single": "",
"double": "dp"
Expand Down
22 changes: 11 additions & 11 deletions src/ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _build_fluent_launch_args_string(**kwargs) -> str:
for k, v in all_options.items():
argval = kwargs.get(k)
default = v.get("default")
if argval is None and v.get("required") is True:
if argval is None and v.get("fluent_required") is True:
argval = default
if argval is not None:
allowed_values = v.get("allowed_values")
Expand Down Expand Up @@ -128,16 +128,17 @@ def launch_fluent(
port: int = None,
cleanup_on_exit: bool = True,
) -> Session:
"""Start Fluent locally in server mode.
"""Start Fluent locally in server mode or connect to a running Fluent
server instance.

Parameters
----------
version : str, optional
Whether to use the ``"2d"`` or ``"3d"`` version of Fluent.
Selects either the ``"2d"`` or ``"3d"`` version of Fluent.
Default is ``"3d"``.

precision : str, optional
Whether to use the ``"single"`` precision or ``"double"``
Selects either the ``"single"`` precision or ``"double"``
precision version of Fluent. Default is ``"double"`` precision.

processor_count : int, optional
Expand All @@ -162,20 +163,19 @@ def launch_fluent(

start_instance : bool, optional
When False, connect to an existing Fluent instance at ``ip``
and ``port``, which default to ``'127.0.0.1'`` at 63084.
Otherwise, launch a local instance of Fluent. Default is True
which can be overwritten by the environment variable
and ``port``. Otherwise, launch a local instance of Fluent.
Defaults to True and can also be set by the environment variable
``PYFLUENT_START_INSTANCE=<0 or 1>``.

ip : str, optional
IP address to connect to existing Fluent instance. Used only
when ``start_instance`` is ``False``. Defaults to
``'127.0.0.1'`` which can be overwritten by the environment
variable ``PYFLUENT_FLUENT_IP=<ip>``.
``"127.0.0.1"`` and can also be set by the environment variable
``PYFLUENT_FLUENT_IP=<ip>``.

port : int, optional
Port to connect to existing Fluent instance. Used only
when ``start_instance`` is ``False``. Defaults value can be set
Port to connect to existing Fluent instance. Used only when
``start_instance`` is ``False``. Default value can be set
by the environment variable ``PYFLUENT_FLUENT_PORT=<port>``.

cleanup_on_exit : bool, optional
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/fluent/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def __init__(
----------
ip : str, optional
IP address to connect to existing Fluent instance. Used only
when ``channel`` is ``None``. Defaults to ``'127.0.0.1'``
which can be overwritten by the environment variable
when ``channel`` is ``None``. Defaults to ``"127.0.0.1"``
and can also be set by the environment variable
``PYFLUENT_FLUENT_IP=<ip>``.
port : int, optional
Port to connect to existing Fluent instance. Used only
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tui_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def test_report_system_proc_stats_tui(new_solver_session, capsys) -> None:
new_solver_session.start_transcript()
# Issue: Transcript missing for the first TUI command
new_solver_session.tui.solver.report.system.proc_stats()
new_solver_session.tui.solver.report.system.proc_stats()
new_solver_session.tui.solver.report.system.sys_stats()
new_solver_session.tui.solver.report.system.sys_stats()
captured = capsys.readouterr()
assert "Virtual Mem Usage" in captured.out
assert "CPU/Memory Usage" in captured.out