Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make load_profile importable from aiida module #6609

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading