oqp.utils.geometry

Geometry helpers for OpenQP Python inputs.

Exceptions

GeometryLookupError

Functions

builtin_geometry(query)

pubchem_geometry(query[, timeout])

get_geometry(query[, source, timeout])

geometry_from_sdf(sdf, query)

normalize_system(system[, unit])

Module Contents

exception GeometryLookupError

Bases: ValueError

Raised when a named geometry cannot be resolved.
builtin_geometry(query)
Return a built-in approximate Angstrom geometry for common small molecules.
pubchem_geometry(query, timeout=10)
Fetch a 3D conformer from PubChem PUG-REST and return OpenQP geometry text.
get_geometry(query, source='auto', timeout=10)
Resolve a named molecular geometry to OpenQP inline geometry text.

source="auto" tries OpenQP's small built-in table first, then PubChem.
source="builtin" only uses the local table.
source="pubchem" only uses PubChem PUG-REST.
geometry_from_sdf(sdf, query)
Convert a PubChem-style V2000 SDF string to OpenQP inline geometry text.
normalize_system(system, unit='Angstrom')
Normalize inline molecular geometries for OpenQP input.system.

Coordinates are written in Angstrom because the OpenQP input reader converts
the text geometry into its internal Bohr representation. Bohr inputs can be
passed with unit="Bohr".