ReactionMechanismGenerator / RMG-Py

Python version of the amazing Reaction Mechanism Generator (RMG).
http://reactionmechanismgenerator.github.io/RMG-Py/
Other
400 stars 228 forks source link

Reaction simulation with boron is throwing an error like KeyError: 'B' #2566

Closed joel-brelson closed 9 months ago

joel-brelson commented 1 year ago

I was trying a simulation with two compounds in which one of the compounds is containing boron when i ran the script it is throwing an error like Traceback (most recent call last): File "rmg.py", line 118, in main() File "rmg.py", line 112, in main rmg.execute(kwargs) File "/rmg/RMG-py/rmgpy/rmg/main.py", line 751, in execute self.initialize(kwargs) File "/rmg/RMG-py/rmgpy/rmg/main.py", line 508, in initialize self.load_input(self.input_file) File "/rmg/RMG-py/rmgpy/rmg/main.py", line 259, in load_input read_input_file(path, self) File "/rmg/RMG-py/rmgpy/rmg/input.py", line 1558, in read_input_file exec(f.read(), global_context, local_context) File "", line 26, in File "/rmg/RMG-py/rmgpy/rmg/input.py", line 231, in smiles return Molecule().from_smiles(string) File "rmgpy/molecule/molecule.py", line 1772, in rmgpy.molecule.molecule.Molecule.from_smiles def from_smiles(self, smilesstr, backend='try-all', raise_atomtype_exception=True): File "rmgpy/molecule/molecule.py", line 1776, in rmgpy.molecule.molecule.Molecule.from_smiles translator.from_smiles(self, smilesstr, backend, raise_atomtype_exception=raise_atomtype_exception) File "rmgpy/molecule/translator.py", line 328, in rmgpy.molecule.translator.from_smiles def from_smiles(mol, smilesstr, backend='try-all', raise_atomtype_exception=True): File "rmgpy/molecule/translator.py", line 334, in rmgpy.molecule.translator.from_smiles return _read(mol, smilesstr, 'smi', backend, raise_atomtype_exception=raise_atomtype_exception) File "rmgpy/molecule/translator.py", line 516, in rmgpy.molecule.translator._read mol = _openbabel_translator(identifier, identifier_type, mol) File "rmgpy/molecule/translator.py", line 426, in rmgpy.molecule.translator._openbabel_translator output = from_ob_mol(mol, obmol) File "rmgpy/molecule/converter.py", line 279, in rmgpy.molecule.converter.from_ob_mol def from_ob_mol(mol, obmol, raise_atomtype_exception=True): File "rmgpy/molecule/converter.py", line 337, in rmgpy.molecule.converter.from_ob_mol mol.update_atomtypes(log_species=True, raise_exception=raise_atomtype_exception) File "rmgpy/molecule/molecule.py", line 1437, in rmgpy.molecule.molecule.Molecule.update_atomtypes self.update_lone_pairs() File "rmgpy/molecule/molecule.py", line 2270, in rmgpy.molecule.molecule.Molecule.update_lone_pairs atom1.lone_pairs = (elements.PeriodicSystem.valence_electrons[atom1.symbol] KeyError: 'B'

Could some one explain why am i getting this error and how could i solve it. I am attaching the input.py file that i used for simulation input.txt

JacksonBurns commented 1 year ago

Hi @joel-brelson we are currently working on adding support for Boron to RMG (like in PR #2383) but it is not ready for general use at the moment. I can't currently estimate how long it would be to get this out into production. I'll link this issue to that PR so that once it is merged this issue will automatically be updated, and then you can try using the main branch of RMG.

If you are up for it, you could do a source installation based on the branch that @ssun30 has been developing over in #2383 but that might not be fully working at the moment and require some hacking.

github-actions[bot] commented 10 months ago

This issue is being automatically marked as stale because it has not received any interaction in the last 90 days. Please leave a comment if this is still a relevant issue, otherwise it will automatically be closed in 30 days.