haddocking / pdb-tools

A dependency-free cross-platform swiss army knife for PDB files.
https://haddocking.github.io/pdb-tools/
Apache License 2.0
383 stars 113 forks source link

pdb_mkensemble now opens file by file #9

Closed joaomcteixeira closed 5 years ago

joaomcteixeira commented 5 years ago

Attempting to use pdb_mkensemble in 3000 files output the following error during .check_input():

Traceback (most recent call last):
  File "/home/joao/Programming/pdb-tools/bin/pdb_mkensemble.py", line 134, in <module>
  File "/home/joao/Programming/pdb-tools/bin/pdb_mkensemble.py", line 108, in main
  File "/home/joao/Programming/pdb-tools/bin/pdb_mkensemble.py", line 58, in check_input
OSError: [Errno 24] Too many open files: '_01021.pdb'

pdb_mkensemble was opening pdb files during the .check_input() call, overloading memory.

After discussion with @JoaoRodrigues open was moved to make_ensemble() and check_input() now returns args: a list of file names.

PR passed tests and made ensemble of 3000 frames correctly in my system.

----------------------------------------------------------------------
Ran 241 tests in 0.142s

OK
codecov-io commented 5 years ago

Codecov Report

Merging #9 into master will decrease coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #9      +/-   ##
==========================================
- Coverage   81.83%   81.81%   -0.02%     
==========================================
  Files          39       39              
  Lines        3110     3107       -3     
  Branches      649      649              
==========================================
- Hits         2545     2542       -3     
  Misses        403      403              
  Partials      162      162
Impacted Files Coverage Δ
pdbtools/pdb_mkensemble.py 96.15% <100%> (-0.21%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update abdbb06...d87947f. Read the comment docs.

JoaoRodrigues commented 5 years ago

Thanks! Merged!