-
Notifications
You must be signed in to change notification settings - Fork 139
fix: improve code quality and numpydoc documentation #4125
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
base: main
Are you sure you want to change the base?
Conversation
- Fix typo in _get_file_name docstring parameter description - Replace bare except clauses with specific OSError exceptions in launcher.py - Remove duplicate logging statement in licensing.py, use LOG.info instead - Add missing Parameters and Returns sections to Information class methods - Fix GL02 docstring formatting issues (closing quotes placement) - Add Returns section to convert.py format_using_autopep8 method
Reviewer's GuideThis PR enhances code quality by refactoring docstrings for NumPy style compliance, tightening exception handling in launcher.py, and cleaning up redundant logging in licensing.py without altering existing behavior. Class diagram for updated Information class documentationclassDiagram
class Information {
+__init__(mapdl: Mapdl)
+_mapdl: Mapdl
+_update() None
+__repr__() str
+product: str
+mapdl_version: str
+mapdl_version_update: str
+pymapdl_version: str
}
%% Note: Only docstrings and documentation were updated, no structural changes to methods or attributes.
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR focuses on improving code quality and numpydoc documentation compliance across multiple MAPDL core files. The changes address docstring formatting issues, enhance exception handling, and clean up logging statements.
- Fixed a typo in docstring parameter description and improved exception handling specificity
- Enhanced numpydoc compliance by adding missing Parameters and Returns sections to documentation
- Cleaned up duplicate logging statements and improved docstring formatting consistency
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/ansys/mapdl/core/mapdl_core.py | Fixed typo in _get_file_name docstring parameter description |
src/ansys/mapdl/core/licensing.py | Removed duplicate logging statement, consolidated to single LOG.info call |
src/ansys/mapdl/core/launcher.py | Replaced bare except clauses with specific OSError exceptions |
src/ansys/mapdl/core/information.py | Added missing Parameters section to class docstring and Returns sections to property methods |
src/ansys/mapdl/core/convert.py | Added missing Returns section to format_using_autopep8 method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4125 +/- ##
=======================================
Coverage 91.30% 91.30%
=======================================
Files 189 189
Lines 15698 15706 +8
=======================================
+ Hits 14333 14341 +8
Misses 1365 1365 🚀 New features to boost your workflow:
|
Skipping coverage since it is minor. @pyansys-ci-bot LGTM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to fix all the numpydocs issues in this PR. But it is waaay to much work for only one PR. So... this is just one. By files
Details
COUNT | LINE
By issues
Details
|
GL02 has been fixed in 920ddc2 |
Related to
#2414
Summary
_get_file_name
docstring parameter descriptionChanges Made
Code Quality Improvements:
mapdl_core.py:3195
- corrected "with our with extension" to "with or without extension"launcher.py
by replacing bareexcept:
clauses with specificexcept OSError:
licensing.py
by removing duplicate print statementNumpydoc Validation Fixes:
mapdl
parameterTest plan
Summary by Sourcery
Improve code quality by replacing broad exception handlers and simplifying logging, and enhance API documentation by completing and correcting Numpydoc docstrings.
Enhancements:
Documentation: