Skip to content

Commit

Permalink
Fixed parsing of external callback functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Dec 5, 2023
1 parent 99d42be commit c158f98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion emle/emle.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def __init__(
# Split the module and function names.
try:
function = external_backend.split(".")[-1]
module = external_backend.strip("." + function)
module = external_backend.replace("." + function, "")
except:
raise ValueError(
f"Unable to parse 'external_backend' callback string: {external_backend}"
Expand Down
2 changes: 1 addition & 1 deletion tests/input/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
EV_TO_HARTREE = 1.0 / ase.units.Hartree


def run_xtb(atoms):
def run_external(atoms):
"""
Internal function to compute in vacuo energies and gradients using
the xtb-python interface. Currently only uses the "GFN2-xTB" method.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_external_local_directory():

# Set environment variables.
os.environ["EMLE_PORT"] = "12345"
os.environ["EMLE_EXTERNAL_BACKEND"] = "external.run_xtb"
os.environ["EMLE_EXTERNAL_BACKEND"] = "external.run_external"

# Create the sander command.
command = "sander -O -i emle_sp.in -p adp.parm7 -c adp.rst7 -o emle.out"
Expand Down Expand Up @@ -70,7 +70,7 @@ def test_external_plugin_directory():

# Set environment variables.
os.environ["EMLE_PORT"] = "12345"
os.environ["EMLE_EXTERNAL_BACKEND"] = "external.run_xtb"
os.environ["EMLE_EXTERNAL_BACKEND"] = "external.run_external"
os.environ["EMLE_PLUGIN_PATH"] = os.getcwd() + "/tests/input"

# Create the sander command.
Expand Down

0 comments on commit c158f98

Please sign in to comment.