ITADN

Error exit upon failure to find atom type

#589ClosediGulitch 创建于 2024-10-17
I
iGulitchcommented
**Describe the behavior you would like added to Foyer** When Foyer can't find an atom type in `*.xml` file for an atom during the FF application to a molecule, it exits immediately with error message and big **python** error traceback : ``` >>> mol_ff = ff.apply(mol) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/foyer/foyer/forcefield.py", line 758, in apply typemap = self.run_atomtyping( ^^^^^^^^^^^^^^^^^^^^ File "/foyer/foyer/forcefield.py", line 837, in run_atomtyping typemap = find_atomtypes(structure, forcefield=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/foyer/foyer/atomtyper.py", line 146, in find_atomtypes _resolve_atomtypes(topology_graph, typemap) File "/foyer/foyer/atomtyper.py", line 221, in _resolve_atomtypes raise FoyerError( foyer.exceptions.FoyerError: Found no types for atom numbered 2 which is atomic number 6. Forcefield file is missing this atomtype, so try to add SMARTS definitions to account for this atom. ``` However, there might be other atoms, for which atom types info is missing, which the user won't know about until the current issue is fixed. That would be useful, if all such problems are collected and reported all at once, e.g. : ``` Found no types for atom numbered i1 which is atomic number n1. Found no types for atom numbered i2 which is atomic number n2. ... Found no types for atom numbered i3 which is atomic number n3. ``` Also, perhaps, suppressing the **python** output would also be nice?
关闭于 2025-02-19 4 条评论