Skip to content

Commit

Permalink
Merge branch 'main' into feature_website
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jan 20, 2025
2 parents 459a17e + a10cabf commit 8917afe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bin/emle-analyze
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ if args.backend == "mace" and not args.mace_model:

backend = None
if args.backend == "torchani":
from emle._models import ANI2xEMLE
from emle.models import ANI2xEMLE

backend = ANI2xEMLE()
elif args.backend == "mace":
from emle._models import MACEEMLE
from emle.models import MACEEMLE

backend = MACEEMLE(mace_model=args.mace_model)
elif args.backend == "deepmd":
Expand Down
6 changes: 5 additions & 1 deletion bin/emle-stop
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ if [ -f "emle_pid.txt" ]; then
# Get the PID.
pid=$(cat emle_pid.txt)

# Try to kill the emle-server process.
echo "Stopping emle-server: PID $pid"
timeout -vk 5 10 kill $pid > /dev/null 2>&1

else
# Try to kill all of the emle-server processes.
echo "Stopping all emle-server processes..."
timeout -vk 5 10 killall emle-server > /dev/null 2>&1
for pid in $(ps -ef | grep emle-server | grep -v grep | awk '{print $2}'); do
echo "Stopping emle-server: PID $pid"
timeout -vk 5 10 kill $pid > /dev/null 2>&1
done
fi

echo "Done!"
1 change: 1 addition & 0 deletions demo/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ name=emle
sander -O -i ../$name.in -o $name.out -p ../$PARM -c ../$CRD -r $name.ncrst -x $name.nc

# Stop any running emle-server processes.
cd ..
emle-stop
8 changes: 5 additions & 3 deletions emle/_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ def __init__(
)
self.alpha = self._get_mol_alpha(self.A_thole, self.atomic_numbers)

mesh_data = emle_base._get_mesh_data(qm_xyz_bohr, pc_xyz_bohr, self.s)
mask = (self.atomic_numbers > 0).unsqueeze(-1)
mesh_data = emle_base._get_mesh_data(qm_xyz_bohr, pc_xyz_bohr, self.s, mask)
self.e_static = (
emle_base.get_static_energy(
self.q_core, self.q_val, self.pc_charges, mesh_data
Expand All @@ -133,7 +134,7 @@ def __init__(
)
self.e_induced = (
emle_base.get_induced_energy(
self.A_thole, self.pc_charges, self.s, mesh_data
self.A_thole, self.pc_charges, self.s, mesh_data, mask
)
* _HARTREE_TO_KCAL_MOL
)
Expand All @@ -155,6 +156,7 @@ def __init__(
"q_val",
"q_total",
"alpha",
"e_backend",
"e_static",
"e_induced",
"e_static_mbis",
Expand Down Expand Up @@ -184,7 +186,7 @@ def _parse_qm_xyz(filename):
"""

atoms = _ase_io.read(filename, index=":")
atomic_numbers = _pad_to_max([_.get_atomic_numbers() for _ in atoms], -1)
atomic_numbers = _pad_to_max([_.get_atomic_numbers() for _ in atoms], 0)
xyz = _np.array([_.get_positions() for _ in atoms])
return atomic_numbers, xyz

Expand Down
3 changes: 0 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import os
import pytest
import psutil
import shlex
import subprocess


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 8917afe

Please sign in to comment.