from_geometry()
The AMChI string of a species, with its connectivity and candidates derived.
Usage
from_geometry(
geometry,
*,
stereo=True,
)Raises the errors of string.
Examples
>>> import amchi
>>> from types import SimpleNamespace
>>> # CHFClBr and its mirror image
>>> chfclbr = SimpleNamespace(
... symbols=["C", "H", "F", "Cl", "Br"],
... coordinates=[
... [0, 0, 0], [0, 0, 1.09], [1.31, 0, -0.46],
... [-0.83, 1.44, -0.59], [-0.91, -1.58, -0.65],
... ],
... )
>>> amchi.from_geometry(chfclbr)'AMChI=2S/CHBrClF/c2-1(3)4/h1H/t1-/m1/s1'
>>> chfclbr.coordinates = [[-x, y, z] for x, y, z in chfclbr.coordinates]
>>> amchi.from_geometry(chfclbr)'AMChI=2S/CHBrClF/c2-1(3)4/h1H/t1-/m0/s1'
>>> amchi.from_geometry(chfclbr, stereo=False)'AMChI=2S/CHBrClF/c2-1(3)4/h1H'