diff --git a/src/ansys/fluent/core/solver/flobject.py b/src/ansys/fluent/core/solver/flobject.py index 55ec3a9421a..cb8747505bf 100644 --- a/src/ansys/fluent/core/solver/flobject.py +++ b/src/ansys/fluent/core/solver/flobject.py @@ -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] diff --git a/tests/test_settings_api.py b/tests/test_settings_api.py index 14b668ca12e..e7a9efae298 100644 --- a/tests/test_settings_api.py +++ b/tests/test_settings_api.py @@ -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 @@ -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