Skip to content

Commit

Permalink
fix mypy error in sets.py: cast(Sequence[Sequence[float]], kpoints)
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Mar 29, 2024
1 parent 8137931 commit 4bbee19
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pymatgen/io/vasp/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
import re
import shutil
import warnings
from collections.abc import Sequence
from copy import deepcopy
from dataclasses import dataclass, field
from glob import glob
from itertools import chain
from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal, Union
from typing import TYPE_CHECKING, Any, Literal, Union, cast
from zipfile import ZipFile

import numpy as np
Expand All @@ -58,8 +59,6 @@
from pymatgen.util.due import Doi, due

if TYPE_CHECKING:
from collections.abc import Sequence

from typing_extensions import Self

from pymatgen.core.trajectory import Vector3D
Expand Down Expand Up @@ -3072,9 +3071,7 @@ def _get_ispin(vasprun: Vasprun | None, outcar: Outcar | None) -> int:

def _combine_kpoints(*kpoints_objects: Kpoints) -> Kpoints:
"""Combine k-points files together."""
labels = []
kpoints = []
weights = []
labels, kpoints, weights = [], [], []

for kpoints_object in filter(None, kpoints_objects):
if kpoints_object.style != Kpoints.supported_modes.Reciprocal:
Expand All @@ -3094,7 +3091,7 @@ def _combine_kpoints(*kpoints_objects: Kpoints) -> Kpoints:
comment="Combined k-points",
style=Kpoints.supported_modes.Reciprocal,
num_kpts=len(kpoints),
kpts=kpoints,
kpts=cast(Sequence[Sequence[float]], kpoints),
labels=labels,
kpts_weights=weights,
)
Expand Down

0 comments on commit 4bbee19

Please sign in to comment.