-
Notifications
You must be signed in to change notification settings - Fork 123
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
refactor: Iterate over the dictionary directly instead of using .keys(). #3631
Conversation
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3631 +/- ##
==========================================
- Coverage 87.18% 87.14% -0.05%
==========================================
Files 187 187
Lines 14660 14660
==========================================
- Hits 12782 12775 -7
- Misses 1878 1885 +7 |
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.
LGTM. Thank you a lot for this!!
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Description
Iterate over the dictionary directly instead of using .keys().
If you want to check whether a specific key is in a dictionary, you can write
if key in dictionary
. There's no need to write if key in dictionary.keys(). Furthermore,if key in dictionary
is faster because it uses a hash lookup, whileif key in dictionary.keys()
generates a new list and then does a linear search through that list.Remove some bare except.
Update some docstrings.
Issue linked
Please mention the issue number or describe the problem this pull request addresses.
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)