Skip to content

Commit

Permalink
Make load_profile and methods in aiida.__init__ importable from aii…
Browse files Browse the repository at this point in the history
…da module (#6609)
  • Loading branch information
unkcpz authored Dec 2, 2024
1 parent 333992b commit ec52f4e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
25 changes: 20 additions & 5 deletions src/aiida/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. '
Expand All @@ -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
Expand Down Expand Up @@ -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)
1 change: 0 additions & 1 deletion src/aiida/tools/ipython/ipython_magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ec52f4e

Please sign in to comment.