Skip to content

Commit

Permalink
Added len valueerror checking for list pdb files in simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
JatGreer committed Sep 18, 2024
1 parent cbd42f4 commit 6b84fc1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/roodmus/simulation/run_parakeet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,14 @@ def get_pdb_files(pdb_dir: str) -> List[str]:
elif file.endswith(".cif.gz"):
# untested as to whether parakeet can unpack .cif.gz
pdb_files.append(os.path.join(pdb_dir, file))

# ensure list is not empty to avoid zero divs in get_instances
if len(pdb_files) == 0:
raise ValueError(
"Found 0 atomic structure (pdb/cif/mmcif/cif.gz) files in"
" directory {}!".format(pdb_dir)
)

return pdb_files


Expand Down

0 comments on commit 6b84fc1

Please sign in to comment.