diff --git a/pyneuroml/pynml.py b/pyneuroml/pynml.py index f7bab4b5..65e9e802 100644 --- a/pyneuroml/pynml.py +++ b/pyneuroml/pynml.py @@ -1330,11 +1330,17 @@ def run_lems_with(engine: str, *args: typing.Any, **kwargs: typing.Any): """ function_tuple = inspect.getmembers(sys.modules[__name__], inspect.isfunction) + found = False for fname, function in function_tuple: if fname.startswith("run_lems_with") and fname.endswith(engine): print(f"Running with {fname}") + found = True return function(*args, **kwargs) + if found is False: + logger.error(f"Could not find engine {engine}. Exiting.") + return False + def run_lems_with_jneuroml_neuron( lems_file_name: str,