[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] Physical.values



Thanks :) it isn't slow - I just wondered if I'd missed something in the docs that would do it for me!

-----Original Message-----
From: Modeller Caretaker [">mailto:] 
Sent: 30 October 2014 19:32
To: Wood, Chris (STFC,RAL,SC); 
Subject: Re: [modeller_usage] Physical.values

On 10/30/14, 11:55 AM,  wrote:
> In the modeller.physical module, is there a way to select to select 
> the physical types given the index?

No. They are treated as a dict at the Python level. Why do you want to?

> I see that each modeller.physical.<restraint type> has a _num method 
> which returns the index

Actually that's a private member variable, so you shouldn't rely on it. 
Use the get_type() method instead.

> I'd like to avoid looping through all the object types if possible!

Just loop the first time you need to do a lookup, and cache the list for future calls. I can't imagine it would be slow!

	Ben Webb, Modeller Caretaker
-- 
             http://www.salilab.org/modeller/
Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage
-- 
Scanned by iCritical.