The slowdown is in NetworkX calls during resonance enumeration - the below code runs quickly for larger molecules (C1000) but effectively hangs for yours:
from openff.nagl.molecule._graph.molecule import GraphMolecule
from openff.toolkit import Molecule
from openff.nagl_models import list_available_nagl_models
model = GNNModel.load(list_available_nagl_models()[-1])
molecule = Molecule.from_smiles(1000 * "C")
%%timeit
GraphMolecule.from_openff(
molecule=molecule,
atom_features=model.config.atom_features,
bond_features=model.config.bond_features,
)
When I let this run on your molecule and kill it after a long time (order of hours) the traceback from the KeyboardInterrupt points to enumerate_resonance_forms which itself is dispatching to NetworkX calls.
This is not an optional step in the process of assigning partial charges, so this is only diagnostic (and I'm pretty sure Lily already knew this), but it's the first step towards a solution
Originally posted by @mattwthompson in #192
Originally posted by @mattwthompson in #192