Skip to content

Commit

Permalink
fix: Aliasing with common parent (#3308)
Browse files Browse the repository at this point in the history
* fix: Aliasing with common parent

* fix: fix test
  • Loading branch information
mkundu1 authored Sep 19, 2024
1 parent 68e5321 commit 7307085
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/ansys/fluent/core/solver/flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,7 @@ def _unalias(self, cls, value):
)
outer_set_states.extend(o_set_states)
else:
ret_alias[comp] = {}
ret_alias = ret_alias[comp]
ret_alias = ret_alias.setdefault(comp, {})
else:
if issubclass(cls, Group):
ccls = cls._child_classes[k]
Expand Down
23 changes: 22 additions & 1 deletion tests/test_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test_api_upgrade(new_solver_session, capsys):


@pytest.mark.fluent_version(">=24.2")
def test_deprecated_settings(new_solver_session):
def test_deprecated_settings_with_custom_aliases(new_solver_session):
solver = new_solver_session
if solver.get_fluent_version() >= FluentVersion.v251:
# https://github.com/ansys/pyfluent/issues/3134
Expand Down Expand Up @@ -359,6 +359,27 @@ def test_deprecated_settings(new_solver_session):
}


@pytest.mark.fluent_version(">=25.1")
def test_deprecated_settings_with_settings_api_aliases(new_solver_session):
solver = new_solver_session
case_path = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow")
download_file("mixing_elbow.dat.h5", "pyfluent/mixing_elbow")
solver.settings.file.read_case_data(file_name=case_path)
solver.settings.results.surfaces.iso_clip["clip-1"] = {}
assert solver.settings.results.surfaces.iso_clip["clip-1"].range() == {
"minimum": 0,
"maximum": 0,
}
solver.settings.results.surfaces.iso_clip["clip-1"] = {
"min": -0.0001,
"max": 0.0001,
}
assert solver.settings.results.surfaces.iso_clip["clip-1"].range() == {
"minimum": -0.0001,
"maximum": 0.0001,
}


@pytest.mark.fluent_version(">=23.1")
def test_command_return_type(new_solver_session):
solver = new_solver_session
Expand Down

0 comments on commit 7307085

Please sign in to comment.