Skip to content

NameError: name 'TYPE_CHECKING' is not defined #1437

@vsolet5

Description

@vsolet5
"""
This module defines convenience types for type hinting purposes.
It extends the types provided by pymatgen with Abipy-specific ones.
"""
from __future__ import annotations

import numpy as np
from pymatgen.util.typing import *

if TYPE_CHECKING:  # needed to avoid circular imports
    from matplotlib.pyplot import Axes
    from matplotlib.figure import Figure
    from abipy.core.kpoints import Kpoint
else:
    Axes = Any
    Figure = Any
    Kpoint = Any

VectorLike = Union[Sequence[float], np.ndarray]

# matplotlib objects
#AxList = list[Axes]

# Abipy objects
KptLike = Union["Kpoint", VectorLike]
KptSelect = Union[int, "Kpoint", "VectorLike"]

Please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: featureDiscussions about new features for Python's type annotations

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions