Skip to content

Commit

Permalink
feat(pynml): throw error if no appropriate engine is found
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjayankur31 committed Sep 15, 2023
1 parent c1d89d6 commit 7811e3b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyneuroml/pynml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7811e3b

Please sign in to comment.