refactor: enhance sys method type hints and clean up return value - #4099
Merged
Conversation
Contributor
|
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Contributor
Reviewer's GuideRefactors sys method by adding explicit type hints for cmd and return type and ensures trailing newline is removed from returned output. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Collaborator
Author
|
@pyansys-ci-bot LGTM. |
germa89
enabled auto-merge (squash)
July 14, 2025 10:12
Contributor
There was a problem hiding this comment.
Pull Request Overview
Refactors the sys method by adding type hints and ensuring the returned output doesn’t end with a newline.
- Added
cmd: strand-> strtype annotations tosys - Updated return logic to strip a single trailing newline from the command output
Comments suppressed due to low confidence (2)
src/ansys/mapdl/core/mapdl_grpc.py:1475
- [nitpick] The docstring should mention that the returned string has a trailing newline removed. Document the newline-stripping behavior to keep consumers informed.
def sys(self, cmd: str, **kwargs) -> str:
src/ansys/mapdl/core/mapdl_grpc.py:1475
- [nitpick] The method name
sysshadows Python's built-insysmodule. Consider renaming to reduce confusion or explicitly document its purpose.
def sys(self, cmd: str, **kwargs) -> str:
germa89
commented
Jul 14, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4099 +/- ##
==========================================
+ Coverage 91.82% 91.85% +0.02%
==========================================
Files 187 187
Lines 15033 15033
==========================================
+ Hits 13804 13808 +4
+ Misses 1229 1225 -4 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
As the title.
Issue linked
NA but extracted from #1300.
Checklist
draftif it is not ready to be reviewed yet.feat: adding new MAPDL command)Summary by Sourcery
Refine the sys method by adding type hints and ensuring the returned output has no trailing newline
Enhancements: