Skip to content

Commit

Permalink
add argument to disable run_at_connect in MapdlGrpc (#3049)
Browse files Browse the repository at this point in the history
* add argument to disable run_at_connect in MapdlGrpc

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* formatting

* Apply suggestions from code review on the docstring

Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>

* Update src/ansys/mapdl/core/mapdl_grpc.py

Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>

---------

Co-authored-by: Gryfenfer97 <jamil.hajjar4@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kathy Pippert <84872299+PipKat@users.noreply.github.com>
Co-authored-by: German <28149841+germa89@users.noreply.github.com>
  • Loading branch information
5 people committed May 3, 2024
1 parent b36d1cb commit 1701afb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ansys/mapdl/core/mapdl_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,13 @@ class MapdlGrpc(MapdlBase):
Print the command ``/COM`` arguments to the standard output.
The default is ``False``.
disable_run_at_connect: bool, optional
Whether to disable the housekeeping commands when connecting.
The default is ``False``.
channel : grpc.Channel, optional
gRPC channel to use for the connection. Can be used as an
alternative to the ``ip`` and ``port`` parameters.
gRPC channel to use for the connection. This parameter can be
used as an alternative to the ``ip`` and ``port`` parameters.
remote_instance : ansys.platform.instancemanagement.Instance
The corresponding remote instance when MAPDL is launched through
Expand Down Expand Up @@ -316,6 +320,7 @@ def __init__(
remove_temp_files: Optional[bool] = None,
remove_temp_dir_on_exit: bool = False,
print_com: bool = False,
disable_run_at_connect: bool = False,
channel: Optional[grpc.Channel] = None,
remote_instance: Optional["PIM_Instance"] = None,
**start_parm,
Expand Down Expand Up @@ -437,7 +442,8 @@ def __init__(
self._mesh_rep = MeshGrpc(self)

# Run at connect
self._run_at_connect()
if not disable_run_at_connect:
self._run_at_connect()

# HOUSEKEEPING:
# Set to not abort after encountering errors. Otherwise, many
Expand Down

0 comments on commit 1701afb

Please sign in to comment.