-
Notifications
You must be signed in to change notification settings - Fork 51
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
Pylint alerts corrections as part of intervention experiment #420
Closed
Conversation
This file contains 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
Made line shorter, its end wasn't readable
Function plot_dF_state had 42 branches, while it is recommended not to have more than 12. The function is structured with clear blocks by logic and documentation. I extracted methods to encapsulate the logical blocks, reducing complexity.
Both methods generate_result and estimate had a bit too many branches. I extracted methods to reduce complexity and make code clearer.
Two functions, extract_u_nk and _get_lambdas had too many branches. Smaller functions were extracted.
Made two readable lines shorter
Made a readable line shorter
The function plot_ti_dhdl had 81 statements, while it is recommended not to have more than 50. I extracted few smaller functions, reducing the length and increasing structure.
The value of mnb is not set in the case of landscape orientation. It was like that even before extracting get_determine_orientation. However, now that this is a separated function, the test fails due to returning an unset variable. This might detect a bigger bug regarding not setting it unintentionally.
_fit_estimators fails on E UnboundLocalError: cannot access local variable 'u_nk' where it is not associated with a value Since the goal is to reduce branches I revert that and extract the more isolated check_estimators_availability instead
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #420 +/- ##
==========================================
- Coverage 98.89% 98.82% -0.07%
==========================================
Files 28 28
Lines 1982 2035 +53
Branches 436 355 -81
==========================================
+ Hits 1960 2011 +51
Misses 2 2
- Partials 20 22 +2 ☔ View full report in Codecov by Sentry. |
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.
Makes the interventions describe in intervention issue.
Each intervention was done in a dedicated commit with a message explaining it.
Some of the change are too long lines and they are minor.
In cases of too many barnches or statments, I extracted functions to reduce the compelxity.
These are done in the files: src\alchemlyb\visualisation\dF_state.py, src\alchemlyb\workflows\abfe.py, src\alchemlyb\parsing\namd.py, src\alchemlyb\visualisation\ti_dhdl.py