Skip to content

Commit

Permalink
Make sure there is data for SOMD2 too.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Nov 18, 2024
1 parent 78bd7d0 commit 8f8c2b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/BioSimSpace/FreeEnergy/_relative.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,7 @@ def _analyse_amber(work_dir=None, estimator="MBAR", method="alchemlyb", **kwargs
for part in file.parts:
if "lambda" in part:
lambdas.append(float(part.split("_")[-1]))

if len(lambdas) == 0:
raise ValueError(
"No lambda windows were detected from the output directory names! "
Expand Down Expand Up @@ -1903,6 +1904,13 @@ def _analyse_somd2(work_dir=None, estimator="MBAR", method="alchemlyb", **kwargs
temperatures = [x for _, x in sorted(zip(lambdas, temperatures))]
lambdas = sorted(lambdas)

if len(lambdas) == 0:
raise ValueError(
"No lambda windows were detected from the output directory names! "
"Ensure that the directory being analysed contains sub-directories"
"name e.g `lambda_0`, `lambda_1` containing the output files."
)

# Check that the temperatures at the end states match.
if temperatures[0] != temperatures[-1]:
raise ValueError("The temperatures at the endstates don't match!")
Expand Down

0 comments on commit 8f8c2b9

Please sign in to comment.