jensengroup / propka

PROPKA predicts the pKa values of ionizable groups in proteins and protein-ligand complexes based in the 3D structure.
http://propka.org
GNU Lesser General Public License v2.1
256 stars 58 forks source link

Closing dangling file pointers #132

Closed stefdoerr closed 2 years ago

stefdoerr commented 2 years ago

Hi, I was getting lots of warnings about open file pointers so I thought I'd make this PR to resolve the warnings. Also I assume eventually you might hit OS issues if you open too many files while using propka programmatically through python.

speleo3 commented 2 years ago

How about solving this with a context manager (and removing the "TODO - convert this to a context manager" comment)? If you don't mind, I can open a pull request with the solution I have in mind, but I'd also be happy to review yours if you want to give it a try.

intendo commented 2 years ago

How about solving this with a context manager (and removing the "TODO - convert this to a context manager" comment)? If you don't mind, I can open a pull request with the solution I have in mind, but I'd also be happy to review yours if you want to give it a try.

I would vote for the context manager approach.

stefdoerr commented 2 years ago

Sure feel free to open another PR!