Resolve "tab completion of bec and other globals do not work anymore"
Description
Current code initializes BEC and starts IPython, however the BEC globals are not in the same namespace as IPython globals.
As a consequence, completion of bec.<tab>
does not work, even though bec
is found as being part of builtins
module
(just to add more info: doing b=bec
then b.<tab>
in the shell would make completion ok again on the b
object).
New code proposed by this MR, initializes IPython and takes care of command line arguments parsing etc ; then, it executes
a BEC startup script -> in this case, IPython calls exec()
in its global namespace and bec.<tab>
completion is
regained.
Some options have to be passed to the startup script, this is done via bec_client.main
module, which contains a
main_dict
dictionary.
In order to avoid polluting the freshly created IPython environment, some globals from bec_startup.py
are prefixed
with _
.
A test has been added, to prevent this issue from reappearing in the future.
Closes #253 (closed)