mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 14:14:22 +08:00
try more explicit import
This commit is contained in:
@@ -18,7 +18,7 @@ from openff.toolkit import ForceField
|
||||
from openff.units import unit as offunit
|
||||
from openmm import unit as ommunit
|
||||
from rdkit import Chem
|
||||
from rdkit.Chem import AllChem
|
||||
from rdkit.Chem.AllChem import Compute2DCoords
|
||||
|
||||
import openfe
|
||||
from openfe.protocols.openmm_rfe import RelativeHybridTopologyProtocol
|
||||
@@ -117,7 +117,7 @@ def pytest_configure(config):
|
||||
|
||||
def mol_from_smiles(smiles: str) -> Chem.Mol:
|
||||
m = Chem.MolFromSmiles(smiles)
|
||||
AllChem.Compute2DCoords(m)
|
||||
Compute2DCoords(m)
|
||||
|
||||
return m
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# {GUFE_VERSION}
|
||||
|
||||
from rdkit import Chem
|
||||
from rdkit.Chem import AllChem
|
||||
from rdkit.Chem.AllChem import Compute2DCoords
|
||||
|
||||
from openfe import LigandAtomMapping, LigandNetwork, SmallMoleculeComponent
|
||||
|
||||
@@ -27,7 +27,7 @@ writer.close()
|
||||
|
||||
def mol_from_smiles(smiles: str) -> Chem.Mol:
|
||||
m = Chem.MolFromSmiles(smiles)
|
||||
AllChem.Compute2DCoords(m)
|
||||
Compute2DCoords(m)
|
||||
|
||||
return m
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import matplotlib
|
||||
from gufe.visualization.mapping_visualization import (
|
||||
draw_one_molecule_mapping,
|
||||
)
|
||||
from rdkit import Chem
|
||||
from rdkit.Chem.Draw.rdMolDraw2D import MolDraw2DCairo
|
||||
|
||||
from openfe import LigandNetwork, SmallMoleculeComponent
|
||||
from openfe.utils.custom_typing import MPL_MouseEvent
|
||||
@@ -42,7 +42,7 @@ class AtomMappingEdge(Edge):
|
||||
molA_to_molB: Dict[int, int],
|
||||
):
|
||||
# create the image in a format matplotlib can handle
|
||||
d2d = Chem.Draw.rdMolDraw2D.MolDraw2DCairo(300, 300, 300, 300)
|
||||
d2d = MolDraw2DCairo(300, 300, 300, 300)
|
||||
d2d.drawOptions().setBackgroundColour((1, 1, 1, 0.7))
|
||||
# TODO: use a custom draw2d object; figure size from transforms
|
||||
img_bytes = draw_one_molecule_mapping(
|
||||
|
||||
Reference in New Issue
Block a user