dauparas / ProteinMPNN

Code for the ProteinMPNN paper
MIT License
1.05k stars 307 forks source link

Git head call in protein_mpnn_run.py #119

Closed matteoferla closed 1 week ago

matteoferla commented 1 week ago

(Raising and issue and closing, just for recordkeeping in case someone else has a similar error)

There's a subprocess call in protein_mpnn_run.py that in my arcane set-up caused issues:

commit_str = subprocess.check_output(
                                            f'git --git-dir {script_dir}/.git rev-parse HEAD', shell=True,
                                            stderr=subprocess.DEVNULL).decode().strip()

where script_dir is the parent of __file__. This call for me raises OSError: [Errno 12] Cannot allocate memory, which is not caught by the try-except clause. This is just to get extra info for the logs. As it is just for fluff, I changed it to commit_str = 'unknown'.

The reason this is happening is that my script is in $CONDA_PREFIX/bin, so even if the script's parent is not a git folder, the index.lock business still gets tried.