Electrostatics / pdb2pqr

PDB2PQR - determining titration states, adding missing atoms, and assigning charges/radii to biomolecules.
http://www.poissonboltzmann.org/
Other
125 stars 34 forks source link

Fix `io.test_for_file` failing for editable installs #372

Closed sphuber closed 11 months ago

sphuber commented 11 months ago

Fixes #6

The io.test_for_file function would fail to find files that are actually present in the pdb2pqr/dat folder if the package was installed in editable mode. The reason is that in editable mode the files are not actually copied to a path that is in the PYTHONPATH but the source tree is simply symlinked. Since the code was only checking base directories that are the current working directory or part of sys.path, files were never found.

There the absolute path of pdb2pqr/dat is determined by simply getting the filepath of the pdb2pqr.io module and then getting the dat folder through relative path operations. This should work for all manner of installing.

codecov[bot] commented 11 months ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (8db8d94) 65.40% compared to head (372161f) 65.40%.

:exclamation: Current head 372161f differs from pull request most recent head 6646e48. Consider uploading reports for the commit 6646e48 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #372 +/- ## ======================================= Coverage 65.40% 65.40% ======================================= Files 30 30 Lines 7796 7796 ======================================= Hits 5099 5099 Misses 2697 2697 ``` | [Files](https://app.codecov.io/gh/Electrostatics/pdb2pqr/pull/372?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Electrostatics) | Coverage Δ | | |---|---|---| | [pdb2pqr/io.py](https://app.codecov.io/gh/Electrostatics/pdb2pqr/pull/372?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Electrostatics#diff-cGRiMnBxci9pby5weQ==) | `78.77% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.