From 93dd176c31fbb3b1e8ffcab2deaa038ac2816992 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 20 Aug 2024 19:24:04 +0200 Subject: [PATCH] fix: reuploading file on CDREAD (#3355) * fix: reuploading file on CDREAD * chore: adding changelog file 3355.fixed.md --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/3355.fixed.md | 1 + src/ansys/mapdl/core/mapdl_grpc.py | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 doc/changelog.d/3355.fixed.md diff --git a/doc/changelog.d/3355.fixed.md b/doc/changelog.d/3355.fixed.md new file mode 100644 index 0000000000..cda6a43a41 --- /dev/null +++ b/doc/changelog.d/3355.fixed.md @@ -0,0 +1 @@ +fix: reuploading file on CDREAD \ 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 f804ea04dc..c713a5c421 100644 --- a/src/ansys/mapdl/core/mapdl_grpc.py +++ b/src/ansys/mapdl/core/mapdl_grpc.py @@ -1764,9 +1764,20 @@ def input( fname = tmp_modified_file # Running method - # always check if file is present as the grpc and MAPDL errors - # are unclear - filename = self._get_file_path(fname, progress_bar) + # + if "CDRE" in orig_cmd.upper(): + # CDREAD already uploads the file, and since the priority in + # `_get_file_path` is for the files in the python working directory, + # we skip that function here. + self._log.debug( + f"Avoid uploading the file {fname} because `CDREAD` should have upload it already." + ) + filename = fname + + else: + # Always check if file is present as the grpc and MAPDL errors + # are unclear + filename = self._get_file_path(fname, progress_bar) if time_step_stream is not None: if time_step_stream <= 0: