-
Notifications
You must be signed in to change notification settings - Fork 666
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
[fmt] core #4874
[fmt] core #4874
Conversation
Hello @RMeli! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2025-01-07 17:15:32 UTC |
The test failure here seems real. I'm not very familiar with this part of the code, but I think it is due to the following assumption: mdanalysis/package/MDAnalysis/core/topologyattrs.py Lines 226 to 227 in 453be6c
From black documentation:
|
The following change appears to fix things: - # The first line of the original docstring is not indented, but the
- # subsequent lines are. We want to dedent the whole docstring.
- first_line, other_lines = method.__doc__.split("\n", 1)
- stub_method.__doc__ = (
- first_line + "\n" + textwrap.dedent(other_lines) + "\n\n" + annotation
- )
+ # The original docstring is arrumed to be formatted with black
+ stub_method.__doc__ = textwrap.dedent(method.__doc__) + "\n\n" + annotation |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4874 +/- ##
===========================================
- Coverage 93.66% 93.63% -0.03%
===========================================
Files 177 189 +12
Lines 21796 22861 +1065
Branches 3067 3067
===========================================
+ Hits 20415 21407 +992
- Misses 929 1002 +73
Partials 452 452 ☔ View full report in Codecov by Sentry. |
This one is also good to go IMO. Please check the change described in #4874 (comment). |
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 am updating the comment on the doc-dedent code change (good that you found this interaction — in a way that's been pretty brittle as it required that doc strings were written in a specific way).
Otherwise I did spot checks and believe it's fine.
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.
Retrospective LGTM (except for one trailing comma, but it's non-blocking especially given that PR is already merged)
[2, 1, 1], | ||
[3, 1, 1]], | ||
dtype=np.float32) | ||
coords = np.array([[1, 1, 1], [2, 1, 1], [3, 1, 1]], dtype=np.float32) |
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.
perhaps should be this:
coords = np.array([[1, 1, 1], [2, 1, 1], [3, 1, 1],], dtype=np.float32)
(with a trailing comma to maintain 3x3 format)
📚 Documentation preview 📚: https://mdanalysis--4874.org.readthedocs.build/en/4874/