Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
atravitz committed Jan 27, 2025
1 parent f88c316 commit dc3827c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions openfecli/commands/gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def legacy_get_type(res_fn:os.PathLike|str)->Literal['vacuum','solvent','complex
else:
return 'complex'

def _generate_ddg_bad_legs_error_msg(bad_legs:list[tuple[set[str], tuple[str]]])->str:
def _generate_bad_legs_error_msg(bad_legs:list[tuple[set[str], tuple[str]]])->str:
"""Attempt to determine whether the legs belong to a RHFE or RBFE calculation
and generate an error message accordingly.
Expand Down Expand Up @@ -219,10 +219,8 @@ def _get_ddgs(legs:dict, error_on_missing=True):
from openfe.protocols.openmm_rfe.equil_rfe_methods import RelativeHybridTopologyProtocolResult as rfe_result

DDGs = []
# err_msg = ""
bad_legs = []
for ligpair, vals in sorted(legs.items()):
# import pdb;pdb.set_trace()
leg_types = set(vals)
DDGbind = None
DDGhyd = None
Expand Down Expand Up @@ -252,14 +250,13 @@ def _get_ddgs(legs:dict, error_on_missing=True):
hyd_unc = np.sqrt(np.sum(np.square([DG1_unc.m, DG2_unc.m])))

if not do_rbfe and not do_rhfe:
# err_msg += _generate_ddg_bad_legs_error_msg(leg_types, ligpair) +"\n\n"
bad_legs.append((leg_types, ligpair))
continue
else:
DDGs.append((*ligpair, DDGbind, bind_unc, DDGhyd, hyd_unc))

if bad_legs:
err_msg = _generate_ddg_bad_legs_error_msg(bad_legs)
err_msg = _generate_bad_legs_error_msg(bad_legs)
if error_on_missing:
raise RuntimeError(err_msg)
else:
Expand Down

0 comments on commit dc3827c

Please sign in to comment.