Skip to content

Commit

Permalink
Type for ipython var
Browse files Browse the repository at this point in the history
[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
  • Loading branch information
unkcpz committed Nov 14, 2024
1 parent 3abfe5e commit bb35d26
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/aiida/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
More information at http://www.aiida.net
"""

from aiida.manage.configuration import load_profile
from __future__ import annotations

from typing import TYPE_CHECKING

from aiida.common.log import configure_logging
from aiida.manage.configuration import get_config_option, get_profile, load_profile, profile_context

if TYPE_CHECKING:
from IPython.core.interactiveshell import InteractiveShell

__copyright__ = (
'Copyright (c), This file is part of the AiiDA platform. '
Expand All @@ -34,7 +42,7 @@
)
__paper_short__ = 'S. P. Huber et al., Scientific Data 7, 300 (2020).'

__all__ = ['load_profile']
__all__ = ['load_profile', 'configure_logging', 'get_config_option', 'get_profile', 'profile_context']


def get_strict_version():
Expand Down Expand Up @@ -94,7 +102,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

Expand Down
3 changes: 2 additions & 1 deletion src/aiida/common/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import enum
import io
import logging
from pathlib import Path
import types
import typing as t

Expand Down Expand Up @@ -164,7 +165,7 @@ def evaluate_logging_configuration(dictionary):
return result


def configure_logging(with_orm=False, daemon=False, daemon_log_file=None):
def configure_logging(with_orm: bool = False, daemon: bool = False, daemon_log_file: None | Path = None) -> None:
"""Setup the logging by retrieving the LOGGING dictionary from aiida and passing it to
the python module logging.config.dictConfig. If the logging needs to be setup for the
daemon, set the argument 'daemon' to True and specify the path to the log file. This
Expand Down

0 comments on commit bb35d26

Please sign in to comment.