Skip to content

refactor: enhance sys method type hints and clean up return value #4099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4099.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor: enhance sys method type hints and clean up return value
6 changes: 4 additions & 2 deletions src/ansys/mapdl/core/mapdl_grpc.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ def list_files(self, refresh_cache: bool = True) -> List[str]:
return files

@supress_logging
def sys(self, cmd, **kwargs):
def sys(self, cmd: str, **kwargs) -> str:
"""Pass a command string to the operating system.

APDL Command: /SYS
Expand Down Expand Up @@ -1513,7 +1513,9 @@ def sys(self, cmd, **kwargs):
obj = self._download_as_raw(tmp_file).decode()

self.slashdelete(tmp_file)
return obj

# Remove trailing newline character if present and only once
return obj[:-1] if (len(obj) > 0 and obj[-1] == "\n") else obj

def download_result(
self,
Expand Down
Loading