Ask Your Question
1

Tab-completion only available when entering the debug mode for some python packages.

asked 2020-04-04 03:13:44 -0500

hongyi-zhao gravatar image

updated 2020-04-07 08:14:35 -0500

Hi,

I try to run the AiiDA-core python package with the example given here.

According to the instructions here: https://aiida.readthedocs.io/projects..., I can use the verdi shell command to invoke a ipython shell which can do the completions correctly.

But when I edit the above mentioned script with wing, then the corresponding completions will be disabled. Say for the following code snippets:

from aiida import load_profile
load_profile()

from aiida.engine import submit
from aiida.orm import load_node, Code, Dict

code = Code.get_from_string("wannier90-3.1.0-wannier-manual")  # REPLACE <CODE LABEL>
# Prepare the builder to launch the calculation
builder = code.get_builder()

All of the builder.* part will not have completion suggestions. On the other hand, if I put the cursor at the end of the above code block and then running the code with Debug to Cursor ( Alt + F5 ). At the end, the corresponding completions will be enabled.

But how to enable the tab-completion without entering the debug mode?

Any hints for this problem?

Regards

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-04-06 07:07:05 -0500

updated 2020-04-06 07:14:51 -0500

If you're not debugging or working in the Python Shell, Wing is using only static analysis to offer completion, and the code where it's failing is created dynamically in a way that resists static analysis. You can get Wing to also use dynamic/runtime analysis by setting a breakpoint and running to it, or working interactively in the Python Shell. That way it should be reporting what is actually there at runtime, as does any shell like iPython.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-04-04 03:13:44 -0500

Seen: 744 times

Last updated: Apr 06