Open sevyharris opened 9 months ago
This pull request 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 pull request, otherwise it will automatically be closed in 30 days.
This pull request 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 pull request, otherwise it will automatically be closed in 30 days.
This is working with the test code described above, so now I just need to put that into an actual unit test and it'll be ready to go.
Unit tests added, but don't work yet because the SMILES string from the rdkit translator's to_smiles() uses 'Pt' instead of 'X'. Need to figure out where is the most appropriate place to make this final translation, but then it should be ready
Some mission creep: RMG molecule had no way to distinguish between specific Pt atom and more general surface X atom.
I wanted rmgpy.molecule.Molecule(smiles="[Pt]").to_smiles()
to return '[Pt]' and rmgpy.molecule.Molecule(smiles="[X]").to_smiles()
to return '[X]', but there was no good way to do this since the internal RMG molecule adjacency list always converted Pt to X and then converted all X's back to Pt in the to_smiles() function.
So, I added a specific Pt atom type with the intention of being able to add other metals later on.
It passes my simple test cases, but now I need to clean up the PR and look for other places this might cause problems for RMG-cat.
Richard's working on a related PR: https://github.com/ReactionMechanismGenerator/RMG-Py/pull/2701. The rdkit * might be a more elegant way of doing this than the Ar workaround
Motivation or Problem
The issue is described here, https://github.com/ReactionMechanismGenerator/RMG-Py/issues/2603, but basically RDKit complains when you try to make a surface molecule using smiles.
Description of Changes
This PR adds a workaround where you initialize the molecule using Ar as a replacement for X to get the adjacency list and then remove the extra pairs of electrons and change Ar back to X to get the originally intended molecule.
Testing
Run this code to test out instantiating all the species in the Surface family training reactions: NOTE TO SELF -- DON'T FORGET TO REBUILD!