diff --git a/src/ansys/fluent/core/session.py b/src/ansys/fluent/core/session.py index 19a194901bc..5864aa603ef 100644 --- a/src/ansys/fluent/core/session.py +++ b/src/ansys/fluent/core/session.py @@ -100,11 +100,11 @@ def __init__( fluent_connection (:ref:`ref_fluent_connection`): Encapsulates a Fluent connection. file_transfer_service: Supports file upload and download. """ - BaseSession.build_from_fluent_connection( + BaseSession._build_from_fluent_connection( self, fluent_connection, file_transfer_service ) - def build_from_fluent_connection( + def _build_from_fluent_connection( self, fluent_connection: FluentConnection, file_transfer_service: Optional[Any] = None, diff --git a/src/ansys/fluent/core/session_solver.py b/src/ansys/fluent/core/session_solver.py index e30c3eb57d6..1903f085011 100644 --- a/src/ansys/fluent/core/session_solver.py +++ b/src/ansys/fluent/core/session_solver.py @@ -119,11 +119,6 @@ def _build_from_fluent_connection(self, fluent_connection): self._settings_api_root = None self.fields.solution_variable_data = self._solution_variable_data() - def build_from_fluent_connection(self, fluent_connection): - """Build a solver session object from fluent_connection object.""" - super(Solver, self).build_from_fluent_connection(fluent_connection) - self._build_from_fluent_connection(fluent_connection) - def _solution_variable_data(self) -> SolutionVariableData: """Return the SolutionVariableData handle.""" return service_creator("svar_data").create( @@ -236,7 +231,10 @@ def _sync_from_future(self, fut: Future): except Exception as ex: raise RuntimeError("Unable to read mesh") from ex state = self.settings.get_state() - self.build_from_fluent_connection(fut_session._fluent_connection) + super(Solver, self)._build_from_fluent_connection( + fut_session._fluent_connection + ) + self._build_from_fluent_connection(fut_session._fluent_connection) # TODO temporary fix till set_state at settings root is fixed _set_state_safe(self.settings, state) diff --git a/src/ansys/fluent/core/session_solver.pyi b/src/ansys/fluent/core/session_solver.pyi index ea4411d207a..72ee7448d46 100644 --- a/src/ansys/fluent/core/session_solver.pyi +++ b/src/ansys/fluent/core/session_solver.pyi @@ -16,7 +16,6 @@ from ansys.fluent.core.solver.tui_241 import main_menu from ansys.fluent.core.systemcoupling import SystemCoupling class Solver: - def build_from_fluent_connection(self, fluent_connection): ... @property def version(self): ... @property diff --git a/tests/test_session.py b/tests/test_session.py index 64c7fab7d84..4630b39e60f 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -369,7 +369,7 @@ def test_build_from_fluent_connection(make_new_session): assert solver2.health_check.is_serving health_check_service1 = solver1.health_check cortex_pid2 = solver2._fluent_connection.connection_properties.cortex_pid - solver1.build_from_fluent_connection(solver2._fluent_connection) + solver1._build_from_fluent_connection(solver2._fluent_connection) assert solver1.health_check.is_serving assert solver2.health_check.is_serving assert not health_check_service1.is_serving