<jupyter_start><jupyter_text>Example of handling bad moleculesIf you give a bad conformer, of course xTB will not be able to calculate any properties.This is an example of how ppqm handles that<jupyter_code>%load_ext autoreload
%autoreload 2
%matplotlib inline
import logging
import sys
import pandas as pd
from rdkit import Chem
from rdkit.Chem.Draw import MolsToGridImage
try:
    import ppqm
except ModuleNotFoundError:
    import pathlib

    cwd = pathlib.Path().resolve().parent
    sys.path.append(str(cwd))
    import ppqm
from ppqm import jupyter as ppqm_jupyter<jupyter_output><empty_output><jupyter_text>Set logging level<jupyter_code>logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger("ppqm").setLevel(logging.INFO)
logging.getLogger("xtb").setLevel(logging.DEBUG)
show_progress = False<jupyter_output><empty_output><jupyter_text>Define a molecule you like<jupyter_code>smiles = "Cc1cc(NCCO)nc(-c2ccc(Br)cc2)n1"  # CHEMBL1956589
molobj = Chem.MolFromSmiles(smiles)
molobj<jupyter_output><empty_output><jupyter_text>Get a conformer, and make it physically impossible- Get a conformer from rdkit- Change bond length to make it bad<jupyter_code>molobj = ppqm.tasks.generate_conformers(molobj, n_conformers=1)
molobj
coordinates = ppqm.chembridge.get_coordinates(molobj)
atoms = ppqm.chembridge.get_atoms(molobj)
atoms
coordinates[0, :] = 0.0
coordinates[1, :] = 0.0
ppqm.chembridge.molobj_set_coordinates(molobj, coordinates)
ppqm_jupyter.show_molobj(molobj)<jupyter_output><empty_output><jupyter_text>Try to optimize this bad conformer<jupyter_code>xtb = ppqm.XtbCalculator(scr="_tmp_directory_", n_cores=1, cmd="xtb")
calculation = {
    "gfn": 2,
    "alpb": "water",
    "opt": None,
}
results = xtb.calculate(molobj, calculation)
results<jupyter_output><empty_output>