Skip to content

Commit

Permalink
tweaking formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
atravitz committed Jan 27, 2025
1 parent dc3827c commit a9ce9e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 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_bad_legs_error_msg(bad_legs:list[tuple[set[str], tuple[str]]])->str:
def _generate_bad_legs_error_message(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 @@ -183,8 +183,8 @@ def _generate_bad_legs_error_msg(bad_legs:list[tuple[set[str], tuple[str]]])->st
msg += (
f"{ligpair}: \n"
"\tUnable to determine whether edge belongs to an RBFE or an RHFE calculation.\n"
f"\tRuns were found for this edge labelled {leg_types}.\n"
f"\tThis edge is missing one of: {(expected_rhfe_types | expected_rbfe_types) - leg_types}.\n"
f"\tRuns labelled {leg_types} were found for this edge,"
f"this edge is missing one of: {(expected_rhfe_types | expected_rbfe_types) - leg_types}.\n"
)
else: # -no-cov-
# this should never happen
Expand Down Expand Up @@ -256,7 +256,7 @@ def _get_ddgs(legs:dict, error_on_missing=True):
DDGs.append((*ligpair, DDGbind, bind_unc, DDGhyd, hyd_unc))

if bad_legs:
err_msg = _generate_bad_legs_error_msg(bad_legs)
err_msg = _generate_bad_legs_error_message(bad_legs)
if error_on_missing:
raise RuntimeError(err_msg)
else:
Expand Down
4 changes: 2 additions & 2 deletions openfecli/tests/commands/test_gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def test_generate_bad_legs_error_message(include):
"'complex'", "'solvent'"),
}[include]
set_vals = {include}
ligpair = {'lig1', 'lig2'}
msg = _generate_bad_legs_error_message(set_vals, ligpair)
ligpair = ('lig1', 'lig2')
msg = _generate_bad_legs_error_message([(set_vals, ligpair)])
for string in expected:
assert string in msg

Expand Down

0 comments on commit a9ce9e3

Please sign in to comment.