File to be executed by IPython in order to register the line magic %aiida
This file can be put into the startup folder in order to have the line magic available at startup. The start up folder is usually at .ipython/profile_default/startup/
.ipython/profile_default/startup/
An IPython extension that provides a magic command to load basic aiida commands.
This makes it much easier to start.
Produces output in:
Plaintext (IPython [qt]console)
HTML (IPython notebook, nbconvert --to html, --to slides)
nbconvert --to html
--to slides
JSON (IPython notebook .ipynb files)
.ipynb
LaTeX (e.g. ipython nbconvert example.ipynb --to LaTeX --post PDF)
ipython nbconvert example.ipynb --to LaTeX --post PDF
Notes on how to load it at start: https://ipython.org/ipython-doc/3/config/intro.html
In [1]: %load_ext aiida_magic In [2]: %aiida
aiida.tools.ipython.ipython_magics.
AiiDALoaderMagics
Bases: IPython.core.magic.Magics
IPython.core.magic.Magics
AiiDA magic loader.
__module__
_repr_html_
Output in HTML format.
_repr_json_
Output in JSON format.
_repr_latex_
Output in LaTeX format.
_repr_pretty_
Output in text format.
_trait_default_generators
aiida
Load AiiDA in ipython (checking if it was already loaded), and inserts in the namespace the main AiiDA classes (the same that are loaded in verdi shell.
verdi shell
Usage:
%aiida [optional parameters]
magics
registered
add_to_ns
Add a new variable with name name and value obj to the namespace local_ns, optionally showing a warning if we are hiding an existing variable.
name
obj
local_ns
Example:
# assuming that local_ns is a dictionary, e.g. from locals() import sys add_to_ns(local_ns, 'sys', sys)
load_ipython_extension
Triggers the load of all the AiiDA magic commands.