Skip to content

Commit

Permalink
specify type of EmbedMolecule (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
bddap authored Jul 28, 2023
1 parent ab2e09f commit 1ef5b21
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
24 changes: 23 additions & 1 deletion rdkit-stubs/Chem/rdDistGeom.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from typing import Any, ClassVar

from rdkit.Chem import Mol
from rdkit.Geometry import Point3D

class EmbedParameters:
__instance_size__: ClassVar[int] = ...
ETversion: Any
Expand Down Expand Up @@ -38,7 +41,26 @@ def ETDG() -> Any: ...
def ETKDG() -> Any: ...
def ETKDGv2() -> Any: ...
def ETKDGv3() -> Any: ...
def EmbedMolecule(RDKit) -> Any: ...
def EmbedMolecule(
mol: Mol,
maxAttempts: int = 0,
randomSeed: int = -1,
clearConfs: bool = True,
useRandomCoords: bool = False,
boxSizeMult: float = 2.0,
randNegEig: bool = True,
numZeroFail: int = 1,
coordMap: dict[int, Point3D] = {},
forceTol: float = 0.001,
ignoreSmoothingFailures: bool = False,
enforceChirality: bool = True,
useExpTorsionAnglePrefs: bool = True,
useBasicKnowledge: bool = True,
printExpTorsionAngles: bool = False,
useSmallRingTorsions: bool = False,
useMacrocycleTorsions: bool = False,
ETversion: int = 1,
) -> int: ...
def EmbedMultipleConfs(*args, **kwargs) -> Any: ...
def GetMoleculeBoundsMatrix(RDKit) -> Any: ...
def KDG() -> Any: ...
Expand Down
10 changes: 8 additions & 2 deletions test/test_stubs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from rdkit import Chem
import io

from rdkit.Chem import Mol, SDWriter
from rdkit import Chem
from rdkit.Chem import Mol, SDWriter, rdDistGeom


def sample_mol() -> Mol:
Expand Down Expand Up @@ -41,6 +41,12 @@ def sdwriter():
writer.SetProps(("asdf",))


def embed():
mol = sample_mol()
rdDistGeom.EmbedMolecule(mol)


def test_frob():
frob(sample_mol())
sdwriter()
embed()

0 comments on commit 1ef5b21

Please sign in to comment.