Skip to content

Commit

Permalink
fix: Remove exit from settings. (#3300)
Browse files Browse the repository at this point in the history
  • Loading branch information
prmukherj authored Sep 13, 2024
1 parent a10e216 commit 9753e88
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/ansys/fluent/core/solver/flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2080,6 +2080,8 @@ def _process_cls_names(info_dict, names, write_doc=False):
_process_cls_names(children, cls.child_names)

commands = info.get("commands")
if commands:
commands.pop("exit", None)
if commands and not user_creatable:
commands.pop("create", None)
if commands:
Expand Down
14 changes: 12 additions & 2 deletions tests/test_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ def test_generated_code_special_cases(new_solver_session):
@pytest.mark.fluent_version(">=25.1")
def test_child_alias_with_parent_path(mixing_elbow_settings_session):
solver = mixing_elbow_settings_session
solver.solution.initialization.hybrid_initialize()
solver.settings.solution.initialization.hybrid_initialize()
assert (
solver.setup.models.discrete_phase.numerics.node_based_averaging.kernel._child_aliases
solver.settings.setup.models.discrete_phase.numerics.node_based_averaging.kernel._child_aliases
== {"gaussian_factor": "../gaussian_factor", "option": "../kernel_type"}
)
solver.settings.setup.models.discrete_phase.numerics.node_based_averaging.enabled = (
Expand Down Expand Up @@ -470,3 +470,13 @@ def test_child_alias_with_parent_path(mixing_elbow_settings_session):
solver.settings.setup.models.discrete_phase.numerics.node_based_averaging.gaussian_factor()
== 0.6
)


@pytest.mark.fluent_version(">=25.1")
def test_exit_not_in_settings(new_solver_session):
solver = new_solver_session

assert "exit" not in dir(solver.settings)

with pytest.raises(AttributeError):
solver.settings.exit()

0 comments on commit 9753e88

Please sign in to comment.