From 39f49ce1141f3510e285056eb6d2082a95bcb84a Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Thu, 14 Nov 2024 03:12:52 +0100 Subject: [PATCH] Type for ipython var --- src/aiida/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aiida/__init__.py b/src/aiida/__init__.py index 75215240d7..41a3e97dd4 100644 --- a/src/aiida/__init__.py +++ b/src/aiida/__init__.py @@ -20,6 +20,10 @@ """ from aiida.manage.configuration import load_profile +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from IPython.core.interactiveshell import InteractiveShell __copyright__ = ( 'Copyright (c), This file is part of the AiiDA platform. ' @@ -94,7 +98,7 @@ def get_file_header(comment_char: str = '# ') -> str: return '\n'.join(f'{comment_char}{line}' for line in lines) -def load_ipython_extension(ipython): +def load_ipython_extension(ipython: InteractiveShell): """Load the AiiDA IPython extension, using ``%load_ext aiida``.""" from .tools.ipython.ipython_magics import AiiDALoaderMagics