Re: Help with a reverse dictionary lookup

2006-03-10 Thread bruno at modulix
rh0dium wrote: > Hi all, > > I have a dict which looks like this.. > > dict={'130nm': {'umc': ['1p6m_1.2-3.3_fsg_ms']}, > '180nm': {'chartered': ['2p6m_1.8-3.3_sal_ms'], 'tsmc': > ['1p6m_1.8-3.3_sal_log', '1p6m_1.8-3.3_sal_ms']}, > '250nm': {'umc': ['2p6m_1.8-3.3_sal_ms'], 'tsmc': > ['1p6m_2.2-3.

Re: Help with a reverse dictionary lookup

2006-03-09 Thread Scott David Daniels
rh0dium wrote: > Basically there are multiple combinatories here - I was hoping someone > could point me to a general approach. Writing the actual funtion is > not necessary - as you pointed out I can certainly do that. Here is my > problem - I did exactly as you and said OK I can > > if Foundry

Re: Help with a reverse dictionary lookup

2006-03-09 Thread Lonnie Princehouse
I made a logic error in that. Must be tired :-( Alas, there is no undo on usenet. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a reverse dictionary lookup

2006-03-09 Thread Lonnie Princehouse
The parsing is good; the structure can be transformed after the parsing is done. The basic problem with the "reverse lookup" search is that you need to iterate over lots of things. If you're only doing one search, that's not too horrible But if you're going to perform multiple searches, you can

Re: Help with a reverse dictionary lookup

2006-03-09 Thread rh0dium
Hey thanks - OK how would you arrange the data structure? I think that is my problem - I can arrange in any order - I just want something which makes sense - this "seemed" logical but can you point me in a better method.. Basically I am parsing a directory structure: TECHROOT/ 130nm/ ts

Re: Help with a reverse dictionary lookup

2006-03-09 Thread rh0dium
Thanks!! I got all of this. The problem that I was trying to figure out was this. Basically there are multiple combinatories here - I was hoping someone could point me to a general approach. Writing the actual funtion is not necessary - as you pointed out I can certainly do that. Here is my pr

Re: Help with a reverse dictionary lookup

2006-03-09 Thread Lonnie Princehouse
Here's the illegible gibberish version of your function. Once you understand completely the following line of code, you will be well on your way to Python nirvana: getNodes = lambda Foundry=None,Process=None: [node for node,foundries in dict.iteritems() if ((Foundry is None) and ((Process is None

Re: Help with a reverse dictionary lookup

2006-03-09 Thread John McMonagle
On Thu, 2006-03-09 at 15:51 -0800, rh0dium wrote: > Hi all, > > I have a dict which looks like this.. > > dict={'130nm': {'umc': ['1p6m_1.2-3.3_fsg_ms']}, > '180nm': {'chartered': ['2p6m_1.8-3.3_sal_ms'], 'tsmc': > ['1p6m_1.8-3.3_sal_log', '1p6m_1.8-3.3_sal_ms']}, > '250nm': {'umc': ['2p6m_1.8-3.

Help with a reverse dictionary lookup

2006-03-09 Thread rh0dium
Hi all, I have a dict which looks like this.. dict={'130nm': {'umc': ['1p6m_1.2-3.3_fsg_ms']}, '180nm': {'chartered': ['2p6m_1.8-3.3_sal_ms'], 'tsmc': ['1p6m_1.8-3.3_sal_log', '1p6m_1.8-3.3_sal_ms']}, '250nm': {'umc': ['2p6m_1.8-3.3_sal_ms'], 'tsmc': ['1p6m_2.2-3.5_sal_log', '1p6m_1.8-3.3_sal_ms'