diff --git a/src/aiida/__init__.py b/src/aiida/__init__.py index 743c5009ab..88d97aaddc 100644 --- a/src/aiida/__init__.py +++ b/src/aiida/__init__.py @@ -19,8 +19,8 @@ More information at http://www.aiida.net """ -from aiida.common.log import configure_logging # noqa: F401 -from aiida.manage.configuration import get_config_option, get_profile, load_profile, profile_context # noqa: F401 +from aiida.common.log import configure_logging +from aiida.manage.configuration import get_config_option, get_profile, load_profile, profile_context __copyright__ = ( 'Copyright (c), This file is part of the AiiDA platform. ' @@ -35,6 +35,18 @@ ) __paper_short__ = 'S. P. Huber et al., Scientific Data 7, 300 (2020).' +__all__ = [ + 'configure_logging', + 'get_config_option', + 'get_file_header', + 'get_profile', + 'get_strict_version', + 'get_version', + 'load_ipython_extension', + 'load_profile', + 'profile_context', +] + def get_strict_version(): """Return a distutils StrictVersion instance with the current distribution version @@ -94,7 +106,10 @@ def get_file_header(comment_char: str = '# ') -> str: def load_ipython_extension(ipython): - """Load the AiiDA IPython extension, using ``%load_ext aiida``.""" - from .tools.ipython.ipython_magics import AiiDALoaderMagics + """Load the AiiDA IPython extension, using ``%load_ext aiida``. + + :param ipython: InteractiveShell instance. If ``None``, the global InteractiveShell is used. + """ + from aiida.tools.ipython.ipython_magics import load_ipython_extension - ipython.register_magics(AiiDALoaderMagics) + load_ipython_extension(ipython) diff --git a/src/aiida/tools/ipython/ipython_magics.py b/src/aiida/tools/ipython/ipython_magics.py index 486ee50481..342053eb55 100644 --- a/src/aiida/tools/ipython/ipython_magics.py +++ b/src/aiida/tools/ipython/ipython_magics.py @@ -205,7 +205,6 @@ def register_ipython_extension(ipython=None): The %aiida IPython extension provides the same environment as the `verdi shell`. :param ipython: InteractiveShell instance. If omitted, the global InteractiveShell is used. - """ if ipython is None: ipython = get_ipython()