Dear All,
I was a little suprised by this behaviour when making a copy of a molecule.
Is it the expected behaviour?
It isn't a problem for me as I can copy the properties across seperately,
but I thought it could be worth mentioning.
Dave
IPython 1.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from rdkit import Chem
In [2]: import copy
In [3]: mol = Chem.MolFromSmiles("c1ccccc1")
In [4]: mol.SetProp("_Name", "One")
In [5]: mol.SetProp("Prop", "1")
In [6]: mol2 = copy.deepcopy(mol)
In [7]: print mol2.GetProp("_Name")
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-7-9ad92b63b870> in <module>()
----> 1 print mol2.GetProp("_Name")
KeyError: '_Name'
In [8]: print mol2.GetProp("Prop")
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-8-668c3857671a> in <module>()
----> 1 print mol2.GetProp("Prop")
KeyError: 'Prop'
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss