# SPDX-FileCopyrightText: 2024 The eminus developers
# SPDX-License-Identifier: Apache-2.0
from collections.abc import Sequence
from typing import Self, TypeAlias

from numpy import floating, integer
from numpy.typing import NDArray

from .utils import BaseObject

_Int: TypeAlias = integer
_Float: TypeAlias = floating
_ArrayReal: TypeAlias = NDArray[_Float]
_Array1D: TypeAlias = Sequence[float] | _ArrayReal
_Array2D: TypeAlias = Sequence[_Array1D] | _ArrayReal
_IntArray: TypeAlias = Sequence[int] | NDArray[_Int]

class KPoints(BaseObject):
    lattice: str
    a: float | _Array2D | None
    is_built: bool
    def __init__(
        self,
        lattice: str,
        a: float | _Array2D | None = ...,
    ) -> None: ...
    @property
    def kmesh(self) -> _IntArray | None: ...
    @kmesh.setter
    def kmesh(self, value: int | _IntArray | None) -> None: ...
    @property
    def wk(self) -> _ArrayReal: ...
    @wk.setter
    def wk(self, value: _Array1D) -> None: ...
    @property
    def k(self) -> _ArrayReal: ...
    @k.setter
    def k(self, value: _Array2D) -> None: ...
    @property
    def Nk(self) -> int: ...
    @Nk.setter
    def Nk(self, value: int) -> None: ...
    @property
    def kshift(self) -> _IntArray: ...
    @kshift.setter
    def kshift(self, value: _Array1D) -> None: ...
    @property
    def gamma_centered(self) -> bool: ...
    @gamma_centered.setter
    def gamma_centered(self, value: bool) -> None: ...
    @property
    def path(self) -> str | None: ...
    @path.setter
    def path(self, value: str | None) -> None: ...
    @property
    def k_scaled(self) -> _ArrayReal: ...
    def build(self) -> Self: ...
    kernel = build
    def trs(self) -> Self: ...

def kpoint_convert(
    k_points: _Array2D,
    lattice_vectors: _Array2D,
) -> _ArrayReal: ...
def monkhorst_pack(nk: _IntArray) -> _ArrayReal: ...
def gamma_centered(nk: _IntArray) -> _ArrayReal: ...
def bandpath(kpts: KPoints) -> _ArrayReal: ...
def kpoints2axis(kpts: KPoints) -> tuple[_ArrayReal, _ArrayReal, list[str]]: ...
def get_brillouin_zone(lattice_vectors: _ArrayReal) -> _ArrayReal: ...
