The following code used to work in Mathematica Version 12.1.1
:
ClearAll[mol];
mol = Molecule["NC(Cc1ccc(O)c(I)c1)C(=O)O", IncludeHydrogens -> True];
{mol, {"DeleteAtom", 2}} //
Apply[MoleculeModify] //
ConnectedMoleculeComponents
The atom with index 2 is highlighted below:
In Mathematica Version 12.2.0
, the code works up to the call to Apply[MoleculeModify]
. But on invoking ConnectedMoleculeComponents
I get the following errors:
During evaluation of In[415]:= KeyMap::invak: The argument >LibraryFunctionError[LIBRARY_FUNCTION_ERROR,6][atomPropertyAssociation] is not a >valid Association.
During evaluation of In[415]:= KeySort::invrl: The argument KeyMap[FromDigits][LibraryFunctionError[LIBRARY_FUNCTION_ERROR,6][atomPropertyAssociation]] is not a valid Association or a list of rules.
During evaluation of In[415]:= KeyValueMap::invak: The argument KeySort[KeyMap[FromDigits][LibraryFunctionError[LIBRARY_FUNCTION_ERROR,6][atomPropertyAssociation]]] is not a valid Association.
During evaluation of In[415]:= Molecule::nintrp: Unable to interpret LibraryFunctionError[LIBRARY_FUNCTION_ERROR,6][Atom[Missing[KeyAbsent,getAtomsList]]] as a name or chemical identifier.
Out[417]= MoleculeModify[Molecule[{ "N", "C", "C", "C", "C", "C", "O", "C", "I", "C", "C", "O", "O", "H", "H", "H", "H", "H", "H", "H", "H", "H"}, { Bond[{2, 3}, "Single"], Bond[{3, 4}, "Aromatic"], Bond[{4, 5}, "Aromatic"], Bond[{5, 6}, "Aromatic"], Bond[{6, 7}, "Single"], Bond[{6, 8}, "Aromatic"], Bond[{8, 9}, "Single"], Bond[{8, 10}, "Aromatic"], Bond[{11, 12}, "Double"], Bond[{11, 13}, "Single"], Bond[{10, 3}, "Aromatic"], Bond[{1, 14}, "Single"], Bond[{1, 15}, "Single"], Bond[{2, 16}, "Single"], Bond[{2, 17}, "Single"], Bond[{4, 18}, "Single"], Bond[{5, 19}, "Single"], Bond[{7, 20}, "Single"], Bond[{10, 21}, "Single"], Bond[{13, 22}, "Single"]}, {}], {"ExtractParts", {{2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 20, 21}, {11, 12, 13, 22}, {1, 14, 15}}}, ValenceErrorHandling -> False]
The last time I complained about breaking changes in the latest version, which was then Mathematica Version 12.1.0
, I was admonished to first check the notice on incompatible changes. This time, I did check the link. But there is nothing at that link on ConnectedMoleculeComponents
.
So, my questions are:
- Is there a workaround for this problem?
- Is there any hope of influencing Wolfram Research to publish a more thorough list of breaking changes, preferably weeks before the new version is out?
Thanks in advance for your help.
bugs
tag. And I want to clarify that I meant "admonished" more as a recommendation than a reprimand. I was happy to learn of that list. It's just that I have a rather large code base that uses all of your chemistry packages extensively. But you've been very helpful in the past, so I don't doubt this will get fixed. $\endgroup$Part
orFirst
or similar functions on aMolecule
, in the same way you cannot use those functions on aGraph
. This was a good change going forward, but I am worried about its potential to break code. $\endgroup$mol // {Apply[Sequence], myMolFunc} // Through
, which I had to replace withmol // {{AtomList, BondList} /* Through /* Splice, myMolFunc} // Through
. $\endgroup$