Skip to content

Commit 673466e

Browse files
fix: Update argument names as per Fluent change. (#4752)
## Context Argument name of global list-properties command has been changed in Fluent during 26.1 (PR 620650). This results in inconsistent behavior in PyFluent. Corresponding Fluent bug - 1385223 ## Change Summary Update argument names in PyFluent as per latest Fluent code. ## Rationale list-properties should be called with correct argument names from PyFluent. ## Impact Fix inconsistent behavior, unintended warnings. --------- Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent cbd98a2 commit 673466e

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

doc/changelog.d/4752.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update argument names as per Fluent change.

src/ansys/fluent/core/codegen/print_fluent_version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
"""Module to write Fluent version information."""
2424

25-
from ansys.fluent.core import FluentVersion, config, launch_fluent
25+
from ansys.fluent.core import FluentVersion, __version__, config, launch_fluent
2626

2727

2828
def print_fluent_version(app_utilities):
@@ -36,6 +36,7 @@ def print_fluent_version(app_utilities):
3636
f.write(f'FLUENT_BUILD_ID = "{build_info.build_id}"\n')
3737
f.write(f'FLUENT_REVISION = "{build_info.vcs_revision}"\n')
3838
f.write(f'FLUENT_BRANCH = "{build_info.vcs_branch}"\n')
39+
f.write(f'PYFLUENT_VERSION = "{__version__}"\n')
3940

4041

4142
if __name__ == "__main__":

src/ansys/fluent/core/services/settings.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -345,17 +345,11 @@ def get_static_info(self) -> dict[str, Any]:
345345

346346
@_trace
347347
def execute_cmd(self, path: str, command: str, **kwds) -> Any:
348-
"""Execute a given command with the provided keyword arguments.
349-
350-
If `path` is in kwds, rename it to `path_1` to avoid conflict with
351-
the `path` argument.
352-
"""
348+
"""Execute a given command with the provided keyword arguments."""
353349
request = _get_request_instance_for_path(
354350
SettingsModule.ExecuteCommandRequest, path
355351
)
356352
request.command = command
357-
if "path_1" in kwds:
358-
kwds["path"] = kwds.pop("path_1")
359353
self._set_state_from_value(request.args, kwds)
360354

361355
response = self._service_impl.execute_cmd(request)

src/ansys/fluent/core/solver/flobject.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,8 +1536,7 @@ def list_properties(self, object_name):
15361536
Name of the object whose properties are to be listed.
15371537
"""
15381538
if FluentVersion(self._version) >= FluentVersion.v261:
1539-
# The generated parameter name is path_1 as the name path clashes with existing property.
1540-
return self._root.list_properties(path_1=self.path, name=object_name)
1539+
return self._root.list_properties(object_path=f"{self.path}/{object_name}")
15411540
else:
15421541
return self.list_properties_1(object_name=object_name)
15431542

0 commit comments

Comments
 (0)