Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Aliasing with common parent #3308

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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(">=24.2")
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
Loading