Skip to content

Commit

Permalink
refactor: Revert datamodel set_state changes. (#2789)
Browse files Browse the repository at this point in the history
  • Loading branch information
prmukherj authored May 8, 2024
1 parent dc6ff4f commit a3e3f58
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
6 changes: 0 additions & 6 deletions src/ansys/fluent/core/services/datamodel_se.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,9 @@ def set_state(self, state: Optional[Any] = None, **kwargs) -> None:
Raises
------
TypeError
If no arguments are provided to the ``set_state()`` method.
ReadOnlyObjectError
If the object is read-only.
"""
if state is None and not kwargs:
raise TypeError(
"The `set_state()` method requires either 'state' or 'kwargs' arguments."
)
if self.get_attr(Attribute.IS_READ_ONLY.value):
raise ReadOnlyObjectError(type(self).__name__)
self.service.set_state(
Expand Down
15 changes: 0 additions & 15 deletions tests/test_meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,18 +576,3 @@ def test_new_2d_meshing_workflow(new_mesh_session):
# Switch to solution mode
solver = meshing.switch_to_solver()
assert solver


@pytest.mark.fluent_version(">=23.2")
def test_set_state_behavior(new_mesh_session):
meshing = new_mesh_session
assert not meshing.meshing.GlobalSettings.EnableOversetMeshing()
meshing.meshing.GlobalSettings.EnableOversetMeshing.set_state(True)
assert meshing.meshing.GlobalSettings.EnableOversetMeshing()

meshing.meshing.GlobalSettings.set_state(EnableOversetMeshing=False)
assert not meshing.meshing.GlobalSettings.EnableOversetMeshing()
with pytest.raises(TypeError):
meshing.meshing.GlobalSettings.set_state()
with pytest.raises(TypeError):
meshing.meshing.GlobalSettings.EnableOversetMeshing.set_state()

0 comments on commit a3e3f58

Please sign in to comment.