First time here? Check out the FAQ!
1

Further auto-completion testing on wing in debug mode for aiida package.

  • retag add tags

Hi,

This is some further tests for using wing to give auto-completion suggestions for aiida package in debug mode.

For testing it, you should still from within virtualbox vm described here: https://ask.wingware.com/question/182...

from aiida import load_profile
load_profile()
from aiida.orm import load_node

node=load_node('be52abbf-8e3a-4e64-afc0-cb6fd471ad94') 
for i in dir(node.inputs): 
     if not i.startswith('_'): 
         print(i)

The above code snippet should gives the following output:

code
kpoints
parameters
parent_folder
pseudos__As
pseudos__Ga
structure

But when I enable the debug mode, I cannot find auto-completions for them. For example, when I input node.inputs.c<tab>, wing won't give code as one of the candidates.

Any hints for this problem?

Regards

hongyi-zhao's avatar
547
hongyi-zhao
asked 2020-04-29 04:25:02 -0600, updated 2020-04-29 07:32:18 -0600
edit flag offensive 0 remove flag close merge delete

Comments

I haven't been able to reproduce (downloading the virtualbox image is taking hours), but could you try checking Allow Calls in Data Inspection on the Debugger: Data Inspection page of the Preferences dialog? This will allow __dir__() methods to be called when getting symbols for autocomplete lists. It's off by default because a __dir__() method could potentially be buggy and you don't want the debugger displaying incorrect info when you're trying to debug something.

Wingware Support's avatar Wingware Support (2020-04-29 13:42:46 -0600) edit

Try this directly in the host's aiida without using virtualbox vm:

$ curl -L 'https://github.com/aiidateam/aiida-core/blob/develop/tests/fixtures/calcjob/arithmetic.add.aiida?raw=true' -o arithmetic.add.aiida

$ verdi import arithmetic.add.aiida

For test, revise the code snippet given by me as following:

change

node=load_node('be52abbf-8e3a-4e64-afc0-cb6fd471ad94')

to

node= load_node('9d3fda4f-6782-4441-a276-b8965aa3f97f')

Side note, I've enable the preference Allow Calls in Data Inspection, but has no effect on this problem. Another note, I also noted that even in ipython, it also not gives suggestions on these names.

hongyi-zhao's avatar hongyi-zhao (2020-04-29 17:59:51 -0600) edit

Did you try changing your Allow Calls in Data Inspection preference? I think there's a good chance that it will fix your problem. I did get the image to download and will be looking at it tomorrow.

Wingware Support's avatar Wingware Support (2020-04-29 18:04:03 -0600) edit

I unchecked the preference Allow Calls in Data Inspection, now only the names begin with _ are suggested. But it's obviously then I don't want these at all. I want to obtain the suggestions starting without _.

hongyi-zhao's avatar hongyi-zhao (2020-04-29 20:56:54 -0600) edit
add a comment see more comments

1 Answer

0

The debugger's inspection of attributes is failing because getattr(node.inputs, '__all__', None) is raising an exception and Wing's debugger isn't handling it. This is arguably a bug in the class of node.inputs and it or something similar may be the reason ipython also has problems. We'll work around this problem in a future Wing release.

Wingware Support's avatar
4.1k
Wingware Support
answered 2020-04-30 14:38:54 -0600, updated 2020-04-30 14:39:35 -0600
edit flag offensive 0 remove flag delete link

Comments

Thanks a lot for your analysis, I've posted this comment on the aiida's google group for their developers' referring on.

hongyi-zhao's avatar hongyi-zhao (2020-04-30 22:58:12 -0600) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer