Skip to content
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] Format topology module and tests #4849

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

RMeli
Copy link
Member

@RMeli RMeli commented Dec 20, 2024

Format topology module and tests. Some files from active PRs might be excluded (see #4815).


📚 Documentation preview 📚: https://mdanalysis--4849.org.readthedocs.build/en/4849/

@pep8speaks
Copy link

Hello @RMeli! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 63:80: E501 line too long (80 > 79 characters)
Line 64:80: E501 line too long (80 > 79 characters)

Line 103:80: E501 line too long (82 > 79 characters)

Line 112:80: E501 line too long (139 > 79 characters)

Line 230:26: E203 whitespace before ':'
Line 452:55: E203 whitespace before ':'

Line 270:9: E731 do not assign a lambda expression, use a def
Line 384:46: E203 whitespace before ':'

Line 597:25: E203 whitespace before ':'
Line 664:43: E203 whitespace before ':'

Line 164:80: E501 line too long (87 > 79 characters)
Line 343:59: E713 test for membership should be 'not in'

Line 191:38: E203 whitespace before ':'

Line 168:50: E203 whitespace before ':'
Line 920:80: E501 line too long (98 > 79 characters)

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 91.87500% with 26 lines in your changes missing coverage. Please review.

Project coverage is 93.63%. Comparing base (4f143fd) to head (22dd13c).

Files with missing lines Patch % Lines
package/MDAnalysis/topology/GSDParser.py 16.66% 10 Missing ⚠️
package/MDAnalysis/topology/HoomdXMLParser.py 71.42% 2 Missing and 2 partials ⚠️
package/MDAnalysis/topology/ITPParser.py 93.10% 2 Missing and 2 partials ⚠️
package/MDAnalysis/topology/PSFParser.py 82.35% 3 Missing ⚠️
package/MDAnalysis/topology/CRDParser.py 90.90% 1 Missing ⚠️
package/MDAnalysis/topology/LAMMPSParser.py 97.72% 0 Missing and 1 partial ⚠️
package/MDAnalysis/topology/MOL2Parser.py 94.11% 1 Missing ⚠️
package/MDAnalysis/topology/PQRParser.py 91.66% 0 Missing and 1 partial ⚠️
package/MDAnalysis/topology/guessers.py 94.73% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4849      +/-   ##
===========================================
- Coverage    93.65%   93.63%   -0.03%     
===========================================
  Files          177      189      +12     
  Lines        21779    22845    +1066     
  Branches      3064     3064              
===========================================
+ Hits         20398    21391     +993     
- Misses         929     1002      +73     
  Partials       452      452              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member Author

@RMeli RMeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The web UI was really slow with this one. I hope all the review comments were saved.

Comment on lines -64 to -85
F_BONDS, F_G96BONDS, F_MORSE, F_CUBICBONDS,
F_CONNBONDS, F_HARMONIC, F_FENEBONDS, F_TABBONDS,
F_TABBONDSNC, F_RESTRBONDS, F_ANGLES, F_G96ANGLES, F_RESTRANGLES,
F_LINEAR_ANGLES, F_CROSS_BOND_BONDS, F_CROSS_BOND_ANGLES, F_UREY_BRADLEY,
F_QUARTIC_ANGLES, F_TABANGLES, F_PDIHS, F_RBDIHS, F_RESTRDIHS, F_CBTDIHS,
F_FOURDIHS, F_IDIHS, F_PIDIHS, F_TABDIHS,
F_CMAP, F_GB12, F_GB13, F_GB14,
F_GBPOL, F_NPSOLVATION, F_LJ14, F_COUL14,
F_LJC14_Q, F_LJC_PAIRS_NB, F_LJ, F_BHAM,
F_LJ_LR, F_BHAM_LR, F_DISPCORR, F_COUL_SR,
F_COUL_LR, F_RF_EXCL, F_COUL_RECIP, F_LJ_RECIP, F_DPD,
F_POLARIZATION, F_WATER_POL, F_THOLE_POL, F_ANHARM_POL,
F_POSRES, F_FBPOSRES, F_DISRES, F_DISRESVIOL, F_ORIRES,
F_ORIRESDEV, F_ANGRES, F_ANGRESZ, F_DIHRES,
F_DIHRESVIOL, F_CONSTR, F_CONSTRNC, F_SETTLE, F_VSITE1,
F_VSITE2, F_VSITE2FD, F_VSITE3, F_VSITE3FD, F_VSITE3FAD,
F_VSITE3OUT, F_VSITE4FD, F_VSITE4FDN, F_VSITEN,
F_COM_PULL, F_DENSITYFITTING, F_EQM, F_EPOT, F_EKIN,
F_ETOT, F_ECONSERVED, F_TEMP, F_VTEMP_NOLONGERUSED,
F_PDISPCORR, F_PRES, F_DHDL_CON, F_DVDL,
F_DKDL, F_DVDL_COUL, F_DVDL_VDW, F_DVDL_BONDED,
F_DVDL_RESTRAINT, F_DVDL_TEMPERATURE, F_NRE) = list(range(95))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does formatting here has a special meaning?

F_DVDL_RESTRAINT,
F_DVDL_TEMPERATURE,
F_NRE,
) = list(range(95))

#: Function types from ``<gromacs_dir>/src/gmxlib/tpxio.c``
ftupd = [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does formatting here has a special meaning?

Comment on lines +287 to +316
[
"N",
"C",
"C",
"O",
"C",
"C",
"O",
"N",
"H",
"H",
"H",
"H",
"H",
"H",
"H",
"H",
"Cu",
"Fe",
"Mg",
"Ca",
"S",
"O",
"C",
"C",
"S",
"O",
"C",
"C",
],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great, not terrible.

Comment on lines +421 to +457
[
0,
0,
0,
0,
0,
0,
0,
-1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great, not terrible.

Comment on lines +536 to +573
[
"H",
"O",
"C",
"H",
"H",
"C",
"H",
"O",
"C",
"H",
"N",
"C",
"H",
"N",
"C",
"C",
"O",
"N",
"H",
"C",
"N",
"H",
"H",
"N",
"C",
"C",
"H",
"C",
"H",
"H",
"O",
"P",
"O",
"O",
"O",
"C",
],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great, not terrible.

Comment on lines +452 to +473
[
"O",
"H",
"H",
"",
"O",
"H",
"H",
"",
"O",
"H",
"H",
"",
"O",
"H",
"H",
"",
"Na",
"Na",
"Na",
"Na",
],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the trick above?

Comment on lines -133 to -138
@pytest.fixture(params=[TPR400, TPR402, TPR403, TPR404, TPR405, TPR406,
TPR407, TPR450, TPR451, TPR452, TPR453, TPR454,
TPR455, TPR502, TPR504, TPR505, TPR510, TPR2016,
TPR2018, TPR2019B3, TPR2020, TPR2020Double,
TPR2021, TPR2021Double, TPR2022RC1, TPR2023,
TPR2024])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind, but not everyone will like this.

Comment on lines +443 to +446
"H,C,H,H,C,H,H,H,C,H,H,H,C,O,N,H,C,H,C,H,H,C,H,C,H,H,H,C,H,H,"
"H,C,O,N,H,C,H,H,C,O,O,O,H,H,,O,H,H,,O,H,H,,O,H,H,,O,H,H,,O,H"
",H,,O,H,H,,O,H,H,,O,H,H,,O,H,H,,O,H,H,,O,H,H,,O,H,H,,O,H,H,,"
"O,H,H"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice trick, could be applied elsewhere. Here just list("HCHHC") should work since they are all single-letter elements, but this will work elsewhere.

Comment on lines -31 to -42
TPR400, TPR402, TPR403, TPR404, TPR405, TPR406, TPR407,
TPR450, TPR451, TPR452, TPR453, TPR454, TPR455, TPR455Double,
TPR460, TPR461, TPR502, TPR504, TPR505, TPR510, TPR510_bonded,
TPR2016, TPR2018, TPR2019B3, TPR2020B2, TPR2020, TPR2020Double,
TPR2021, TPR2021Double, TPR2022RC1, TPR2023, TPR2024,
TPR2016_bonded, TPR2018_bonded, TPR2019B3_bonded,
TPR2020B2_bonded, TPR2020_bonded, TPR2020_double_bonded,
TPR2021_bonded, TPR2021_double_bonded, TPR334_bonded,
TPR2022RC1_bonded, TPR2023_bonded, TPR2024_bonded,
TPR_EXTRA_2021, TPR_EXTRA_2020, TPR_EXTRA_2018,
TPR_EXTRA_2016, TPR_EXTRA_407, TPR_EXTRA_2022RC1,
TPR_EXTRA_2023, TPR_EXTRA_2024,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some meaning here?

Comment on lines +577 to +595
[
"C",
"C",
"H",
"C",
"H",
"H",
"O",
"P",
"O",
"O",
"O",
"C",
"H",
"H",
"C",
"H",
"O",
"C",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone judge in terms of LOC, this is a win. =P

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blanket LGTM — please merge when you're happy with it @RMeli

🎄 🎁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants