Tab-completion for run-time dynmically loaded modules/packages.




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

According to the instructions here:, 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 pycharm, then the corresponding completions will be disabled. Say for the following code snippets:

from aiida import 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 following heading lines into a file:

from aiida import load_profile

And then export PYTHONSTARTUP=/path/to/, then run python/ipython, the tab-completion will be enabled.

But how to enable the tab-completion for this case within pycharm?

Any hints for this problem?


1 comment
Comment actions Permalink

PyCharm uses static code analysis which doesn't allow generating code completion for dynamically generated code.

As you mentioned, it works in the Console, but this is due to the runtime availability where the types of objects are known.

The following ticket may be relevant to your case


Please sign in to leave a comment.