Skip to content

NameError: name 'TYPE_CHECKING' is not defined #1437

Closed

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!

Activity

  1. added
    topic: featureDiscussions about new features for Python's type annotations
    on Jul 25, 2023
  2. locked and limited conversation to collaborators on Jul 25, 2023
  3. converted this issue into a discussion #1438 on Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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