diff --git a/doc/changelog.d/3759.fixed.md b/doc/changelog.d/3759.fixed.md new file mode 100644 index 0000000000..0af65ed3eb --- /dev/null +++ b/doc/changelog.d/3759.fixed.md @@ -0,0 +1 @@ +fix: avoid returning output when using input grpc method \ No newline at end of file diff --git a/src/ansys/mapdl/core/mapdl_grpc.py b/src/ansys/mapdl/core/mapdl_grpc.py index cf58088ec3..d196763fdf 100644 --- a/src/ansys/mapdl/core/mapdl_grpc.py +++ b/src/ansys/mapdl/core/mapdl_grpc.py @@ -1966,12 +1966,12 @@ def input( if "CDRE" in orig_cmd.upper(): # Using CDREAD option = kwargs.get("cd_read_option", "COMB") - tmp_dat = f"/OUT,{tmp_out}\n{orig_cmd},'{option}','{filename}'\n" + tmp_dat = f"/OUT,{tmp_out}\n{orig_cmd},'{option}','{filename}'\n/OUT," delete_uploaded_files = False else: # Using default INPUT - tmp_dat = f"/OUT,{tmp_out}\n{orig_cmd},'{filename}'\n" + tmp_dat = f"/OUT,{tmp_out}\n{orig_cmd},'{filename}'\n/OUT," delete_uploaded_files = True if write_to_log and self._apdl_log is not None: @@ -1991,7 +1991,7 @@ def input( self._stored_commands.append(tmp_dat.splitlines()[1]) return None - request = pb_types.InputFileRequest(filename=tmp_name) + request = pb_types.InputFileRequest(filename=tmp_name, opt="MUTE") # even though we don't care about the output, we still # need to check. otherwise, since inputfile is diff --git a/tests/test_grpc.py b/tests/test_grpc.py index b5daebc798..90d110c775 100644 --- a/tests/test_grpc.py +++ b/tests/test_grpc.py @@ -270,12 +270,13 @@ def test_read_input_file_verbose(mapdl, cleared): @pytest.mark.parametrize("file_name", ["full26.dat", "static.dat"]) def test_read_input_file(mapdl, file_name, cleared): + mapdl.prep7() test_file = os.path.join(PATH, "test_files", file_name) response = mapdl.input(test_file) assert ( re.search("\*\*\*\*\* (ANSYS|MAPDL) SOLUTION ROUTINE \*\*\*\*\*", response) - or "PyMAPDL: Simulation Finished." in response + or "***** ROUTINE COMPLETED *****" in response )