-
Notifications
You must be signed in to change notification settings - Fork 638
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
Enable Pylint warning unused-import #4518
base: develop
Are you sure you want to change the base?
Conversation
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.
Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS
as part of this PR.
Linter Bot Results:Hi @vachram97! Thanks for making this PR. We linted your code and found the following: Some issues were found with the formatting of your code.
Please have a look at the Please note: The |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4518 +/- ##
===========================================
- Coverage 93.59% 93.15% -0.44%
===========================================
Files 168 12 -156
Lines 21104 1067 -20037
Branches 3919 0 -3919
===========================================
- Hits 19752 994 -18758
+ Misses 894 73 -821
+ Partials 458 0 -458 ☔ View full report in Codecov by Sentry. |
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.
Hi @vachram97, thanks for your contribution. The linters
failure appears to be un-related to this PR.
LGTM, but given the size of the changes, we will need a few more eyes on this.
Note to self: once this is squashed-merged, the commit will need to be added to .git-blame-ignore-revs
.
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.
Please add yourself in the AUTHORS
file. And I would still add an entry in the CHANGELOG
.
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.
Very quickly review, apologies please take the brief comments as me only having a few minutes to review and not a reflection on the quality of the work (thank you so much for taking this task!) - @RMeli feel free to discard my review once the big things have been addressed (parmed mostly)
@@ -117,7 +117,6 @@ | |||
.. autoexception:: ApplicationError | |||
|
|||
""" |
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.
We have no tests for this module - I would suggest not touching imports here
package/MDAnalysis/analysis/psa.py
Outdated
@@ -61,8 +61,7 @@ | |||
Path, | |||
PSAPair, | |||
PSAnalysis, | |||
) | |||
|
|||
) |
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.
here and everywhere else this is done, please don't remove this extra blank line - it's there for pep8 reasons
WaterOrientationalRelaxation, | ||
AngularDistribution, | ||
MeanSquareDisplacement, | ||
SurvivalProbability, | ||
) | ||
|
||
) |
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.
as above
|
||
from . import base | ||
from .timestep import Timestep |
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.
If I remember correctly, this is an intentional import that isn't used - we import Timestep here to not break the API since we used to have Timestep defined here (if I remember correctly? it's been a while since that happened - the plan was to remove in 3.0)
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.
To be clear to @vachram97 : do not remove the import
@@ -21,7 +21,6 @@ | |||
# J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 | |||
# | |||
import warnings | |||
from ..converters.ParmEdParser import ParmEdParser, squash_identical |
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.
This is an intentional import, the class moved but we're keeping the import here for backwards compatibility
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.
To be clear to @vachram97 : do not remove the import
|
||
# Local imports | ||
from . import tables | ||
from .guessers import ( |
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.
I'm not sure if these are imported as part of the expected API, someone else would have to double check
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.
topology.tables
seems to be expected to be present as part of the API https://docs.mdanalysis.org/stable/documentation_pages/topology/tables.html ; we can change it for 3.0 but for this PR, these imports need to stay
I am not 100% sure about guessers — usage in https://docs.mdanalysis.org/stable/documentation_pages/topology/guessers.html seems ambiguous or indicative that it's not required. I also don't see examples in the User Guide under Guessing using mda.topology.guess_*()
@lilyminium do you happen to know if we are promising anywhere that mda.topology.guess_*()
exists? Could we remove these imports? I'd be in favor of removing them right now if they are not in the API.
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.
I don't think we promise this as an official recommendation of how to use it, although people may still be using the guesser functions and they are publically available. In addition, with #3753 these functions will go away anyway (as they'll come under the DefaultGuesser class) so I am in favour of removing them here.
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.
Thanks!
So then please do the following @vachram97
- Keep
from . import tables
- Remove
from .guessers import ( ... )
@RMeli can you please shepherd this PR? Thank you! |
@vachram97 I edited your issue text so that we don't accidentally close the parent issue #1295 . |
@vachram97 do you still have time to work on this PR? If so, please respond to the reviews. |
add back no_copy_shim import in transformations
I merged and accidentally removed a new import in transformations.py. I added it back in 4cbe32c and hopefully that's now ok. |
I have updated the PR with all comments were addressed as requested and last version MDAnalysis/develop was merged into PR. Tests fail on the |
Contributes to #1295 (unused-import)
Changes made in this Pull Request:
PR Checklist
some tests are skipped on local machine
no changes are needed to docs
as no new functionality/bug fixes were introduced, there is nothing to add to changelog
Developers certificate of origin
📚 Documentation preview 📚: https://mdanalysis--4518.org.readthedocs.build/en/4518/