<div dir="ltr">Never mind. Figured it out<div>Just for documenting:</div><div><br></div><div>I needed to change instantiating qe to this</div><div><span style="color:rgb(0,0,0);font-size:12.8px">qe = IndexQueryEngine(testid=</span><wbr style="color:rgb(0,0,0);font-size:12.8px"><span style="color:rgb(0,0,0);font-size:12.8px">testdict.get)</span><br></div><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12.8px">Thanks,</span></div><div><span style="color:rgb(0,0,0);font-size:12.8px">Swaroop</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 14, 2017 at 12:39 PM, Swaroop Guntupalli <span dir="ltr"><<a href="mailto:swaroopgj@gmail.com" target="_blank">swaroopgj@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I am trying to make a QueryEngine() with a custom dict which takes in some id and returns neighborhood. So, far I have failed. I am pasting my attempt below. Any help would be appreciated.</div><div><br></div><div>Thanks,</div><div>Swaroop</div><div><br></div><div>##</div><div># custom dict that has feature ids as keys and neighborhood as values</div><div>testdict = {i: range(i) for i in range(10)}</div><div>qe = IndexQueryEngine(testid=<wbr>testdict)<br></div><div><br></div><div><br></div><div># fake dataset </div><div>fake_ds = Dataset(samples=np.random.<wbr>rand(5, 10), fa={'testid': range(10)})<br></div><div><br></div><div># training</div><div>qe.train(fake_ds)<br></div><div><div><br></div><div># this works fine</div><div>print qe.ids</div><div><br></div><div># this line below fails with TypeError: 'dict' object is not callable</div><div># in line#572 in mvpa2/misc/neighborhood.py</div><div>qe[0]</div></div><div><br></div></div>
</blockquote></div><br></div>