Skip to content

Commit

Permalink
refactor name?
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium committed Mar 21, 2022
1 parent 1608727 commit 54bec35
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
File renamed without changes.
8 changes: 4 additions & 4 deletions rdkit_utilities/rdDistGeom.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def SelectDiverseConformers(
"""
from .rdMolAlign import GetBestConformerRMS
from .rdmolops import KeepConformerIds
from .utils import get_maximally_diverse_indices
from ._utils import get_maximally_diverse_indices

rms_matrix = GetBestConformerRMS(mol, heavyAtomsOnly=True)
diverse_indices = get_maximally_diverse_indices(
Expand Down Expand Up @@ -335,13 +335,13 @@ def CalculateElectrostaticEnergy(
forcefield: Literal["MMFF94", "MMFF94s"] = "MMFF94",
) -> np.ndarray:
"""Calculate electrostatic energy of all conformers using force field
Returns
-------
energies: numpy.ndarray
Array of energies, one for each conformer
"""
from .utils import compute_atom_distance_matrix
from ._utils import compute_atom_distance_matrix

conformers = np.array([c.GetPositions() for c in mol.GetConformers()])
distances = compute_atom_distance_matrix(conformers)
Expand Down Expand Up @@ -381,7 +381,7 @@ def RemoveConformersOutsideEnergyWindow(
ffIgnoreInterfragInteractions: bool = True,
) -> int:
"""Remove conformers outside energy window using force field, in-place
The window covers an energy range from the conformer with the lowest
energy. The molecule also has its conformers sorted by force field
energy.
Expand Down
2 changes: 2 additions & 0 deletions rdkit_utilities/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ def ethane():
rdChem.SanitizeMol(mol)
AllChem.EmbedMolecule(mol)
return mol


8 changes: 4 additions & 4 deletions rdkit_utilities/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


def test_compute_distance_matrix():
from rdkit_utilities import utils
from rdkit_utilities import _utils
arr = np.arange(24).reshape((2, 4, 3))
rms = utils.compute_atom_distance_matrix(arr)
rms = _utils.compute_atom_distance_matrix(arr)
assert rms.shape == (2, 4, 4)

first_row = [0, 5.19615242, 10.39230485, 15.58845727]
Expand All @@ -27,14 +27,14 @@ def test_compute_distance_matrix():
(5.4, 4, [0, 3, 1]),
])
def test_get_maximally_diverse_indices(threshold, n_indices, indices):
from rdkit_utilities import utils
from rdkit_utilities import _utils
arr = np.array([
[ 0. , 5.49615242 ,10.39230485 ,15.58845727],
[ 5.49615242 , 0. , 5.19615242 ,10.39230485],
[10.39230485 , 5.19615242 , 0. , 5.19615242],
[15.58845727 ,10.39230485 , 5.19615242 , 0. ],
])
computed = utils.get_maximally_diverse_indices(
computed = _utils.get_maximally_diverse_indices(
arr,
distance_threshold=threshold,
n_indices=n_indices,
Expand Down

0 comments on commit 54bec35

Please sign in to comment.