Thanks. Just like I thought...

2011/10/14 Tsjerk Wassenaar <tsje...@gmail.com>:
> Hi Андрей,
>
> That is not possible.
>
> You set a new property on a chempy model instance. load_model converts
> that model into an internal representation, simply neglecting the new
> property. get_model creates a fresh chempy model instance, which has
> no .name property.
>
> If you really, really want to do it, you'll have to change the chempy
> model class definition in the code, but also change the internal
> structure and the functions load_model and get_model.
>
> The best solution is just do the bookkeeping yourself in the script.
>
>
> Cheers,
>
> Tsjerk
>
>
> On Fri, Oct 14, 2011 at 12:06 PM, Андрей Гончар <gontc...@gmail.com> wrote:
>> Hello.
>> As an example:
>> I create a chempy model
>> m = chempy.model.Indexed()
>> I add some atoms and bonds to this model
>> I add an attribute 'name' to this model
>> m.name = 'model_name'
>> After that I load this model into PyMOL
>> cmd.load_model(m, 'loaded_model')
>> [I do something] an I want my model back. So I execute
>> m1 = cmd.get_model('loaded_model')
>> But now object m1 does not have the attribute 'name'
>> and m1.name gives an error.
>>
>> Is it possible to add and preserve extra arguments to model objects?
>>
>> --
>>
>> Андрей Гончар
>>
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense.
>> http://p.sf.net/sfu/splunk-d2d-oct
>> _______________________________________________
>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>
>
>
> --
> Tsjerk A. Wassenaar, Ph.D.
>
> post-doctoral researcher
> Molecular Dynamics Group
> * Groningen Institute for Biomolecular Research and Biotechnology
> * Zernike Institute for Advanced Materials
> University of Groningen
> The Netherlands
>



-- 

Андрей Гончар

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to