You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed while using Espaloma to assign charges to a batch of molecules -- as far as I can tell, any 2-atom molecule results in an indexing error when trying to create a esp.Graph. Example input:
In [1]: %loadmve.pyIn [2]: # %load mve.py
...: importespalomaasesp
...: fromopenff.toolkitimportMolecule
...:
...: molecule=Molecule.from_mapped_smiles("[N:1]#[N:2]")
...:
...: # create an Espaloma Graph object to represent the molecule of interest
...: molecule_graph=esp.Graph(molecule)
...:
...: # load pretrained model
...: espaloma_model=esp.get_model("latest")
...:
...: # apply a trained espaloma model to assign parameters
...: espaloma_model(molecule_graph.heterograph)
...:
...: # create an OpenMM System for the specified molecule
...: openmm_system=esp.graphs.deploy.openmm_system_from_graph(molecule_graph)
...:
LICENSE: Couldnotopenlicensefile"oe_license.txt"inlocaldirectoryLICENSE: N.B. OE_LICENSEenvironmentvariableisnotsetLICENSE: N.B. OE_DIRenvironmentvariableisnotsetLICENSE: Noproductkeys!
LICENSE: Noproductkeys!
LICENSE: Noproductkeys!
LICENSE: Noproductkeys!
TheOpenEyeToolkitsarefoundtobeinstalledbutnotlicensedandthereforewillnotbeused.
TheOpenEyeToolkitsrequirea (freeforacademics) license, seehttps://docs.eyesopen.com/toolkits/python/quickstart-python/license.html/lila/home/lilywang/micromamba/envs/espaloma-0.3.2/lib/python3.11/site-packages/dgl/heterograph.py:92: DGLWarning: Recommendcreatinggraphsby`dgl.graph(data)`insteadof`dgl.DGLGraph(data)`.
dgl_warning(
---------------------------------------------------------------------------IndexErrorTraceback (mostrecentcalllast)
CellIn[2], line85molecule=Molecule.from_mapped_smiles("[N:1]#[N:2]")
7# create an Espaloma Graph object to represent the molecule of interest---->8molecule_graph=esp.Graph(molecule)
10# load pretrained model11espaloma_model=esp.get_model("latest")
File/lila/home/lilywang/micromamba/envs/espaloma-0.3.2/lib/python3.11/site-packages/espaloma/graphs/graph.py:63, inGraph.__init__(self, mol, homograph, heterograph)
60homograph=self.get_homograph_from_mol(mol)
62ifhomographisnotNoneandheterographisNone:
--->63heterograph=self.get_heterograph_from_graph_and_mol(
64homograph, mol65 )
67self.mol=mol68self.homograph=homographFile/lila/home/lilywang/micromamba/envs/espaloma-0.3.2/lib/python3.11/site-packages/espaloma/graphs/graph.py:137, inGraph.get_heterograph_from_graph_and_mol(graph, mol)
131importdgl133assertisinstance(
134graph, dgl.DGLGraph135 ), "graph can only be dgl Graph object."-->137heterograph=esp.graphs.utils.read_heterogeneous_graph.from_homogeneous_and_mol(
138graph, mol139 )
141returnheterographFile/lila/home/lilywang/micromamba/envs/espaloma-0.3.2/lib/python3.11/site-packages/espaloma/graphs/utils/read_heterogeneous_graph.py:150, infrom_homogeneous_and_mol(g, offmol)
136forbig_idxinrange(small_idx+1, 5):
137forpos_idxinrange(big_idx-small_idx+1):
139hg[
140 (
141"n%s"%small_idx,
142"n%s_as_%s_in_n%s"% (small_idx, pos_idx, big_idx),
143"n%s"%big_idx,
144 )
145 ] =np.stack(
146 [
147np.array(
148 [
149idxs_to_ordering["n%s"%small_idx][tuple(x)]
-->150forxinidxs["n%s"%big_idx][
151 :, pos_idx : pos_idx+small_idx152 ]
153 ]
154 ),
155np.arange(idxs["n%s"%big_idx].shape[0]),
156 ],
157axis=1,
158 )
160hg[
161 (
162"n%s"%big_idx,
(...)
178axis=1,
179 )
181# ======================================182# nonbonded terms183# ======================================
(...)
187188# make denseIndexError: toomanyindicesforarray: arrayis1-dimensional, but2wereindexed
Software versions
Espaloma 0.3.2
The text was updated successfully, but these errors were encountered:
Sorry for the delay, @lilyminium . Yes a hydrogen would indeed trigger an error, which was the designed behavior, since we assume that there are always some angles in the system. Maybe we should consider flagging this earlier.
Noticed while using Espaloma to assign charges to a batch of molecules -- as far as I can tell, any 2-atom molecule results in an indexing error when trying to create a
esp.Graph
. Example input:Software versions
Espaloma 0.3.2
The text was updated successfully, but these errors were encountered: