Skip to content

Commit

Permalink
fix unbound variable bug (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
william-galvin authored Oct 28, 2024
1 parent cf57b33 commit 7ca7c07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion devtools/conda-build/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ requirements:
- python >=3.9
- biopython >=1.84
- dssp
- git
- h5py
- hdf5plugin
- numpy >=1.21.6,<1.28.0 # pinned for scipy
Expand Down
10 changes: 10 additions & 0 deletions tests/struct_info/test_pyrosetta_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ def test_pyrosetta_flag():
os.remove('sinfo_pyrosetta_default.hdf5')


def test_pyrosetta_no_charge_and_sasa():
try:
import pyrosetta
except ModuleNotFoundError:
print("[warning] Cannot import pyrosetta -- skipping pyrosetta test")
return

from zernikegrams.structural_info.pyrosetta_core import get_structural_info_from_protein__pyrosetta
get_structural_info_from_protein__pyrosetta("tests/data/pdbs/1bkx.pdb", False, False, False, False)

if __name__ == '__main__':
test_pyrosetta_flag()

Expand Down
4 changes: 4 additions & 0 deletions zernikegrams/structural_info/pyrosetta_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ def get_structural_info_from_protein__pyrosetta(
element = pose.residue_type(i).element(j).name
if calculate_SASA:
sasa = atom_sasa.get(atom_id)
else:
sasa = 0
curr_coords = coords_rows[k]
if calculate_charge:
charge_pyrosetta = pose.residue_type(i).atom_charge(j)
else:
charge_pyrosetta = 0

res_id = np.array([
aa,
Expand Down

0 comments on commit 7ca7c07

Please sign in to comment.