Skip to content

Commit

Permalink
if ff mising -> return list of ff included
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Nov 4, 2024
1 parent 08cc401 commit f3b02ac
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mdagent/tools/base_tools/simulation_tools/setup_and_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def setup_system(self):
raise ValueError(str(e))
else:
raise ValueError(
f"Error building system. Please check the forcefield files {str(e)}"
f"Error building system. Please check the forcefield files {str(e)}. Included force fields are: {FORCEFIELD_LIST}"
)

if self.sys_params.get("nonbondedMethod", None) in [
Expand Down Expand Up @@ -1497,8 +1497,10 @@ def check_system_params(cls, values):
else:
for file in forcefield_files:
if file not in FORCEFIELD_LIST:
error_msg += "The forcefield file is not present"

error_msg += (
"The forcefield file is not present: forcefield files are: "
+ str(FORCEFIELD_LIST)
)
save = values.get("save", True)
if not isinstance(save, bool):
error_msg += "save must be a boolean value"
Expand Down Expand Up @@ -1558,7 +1560,10 @@ def create_simulation_input(pdb_path, forcefield_files):
Water_model = Forcefield_files[1]
# check if they are part of the list
if Forcefield not in FORCEFIELD_LIST:
raise Exception("Forcefield not recognized")
raise Exception(
"Forcefield not recognized: Possible forcefields are: "
+ str(FORCEFIELD_LIST)
)
if Water_model not in FORCEFIELD_LIST:
raise Exception("Water model not recognized")

Expand Down

0 comments on commit f3b02ac

Please sign in to comment.