@@ -697,7 +697,7 @@ def add_oxidation_state_by_guess(self, **kwargs) -> Self:
697
697
**kwargs: parameters to pass into oxi_state_guesses()
698
698
"""
699
699
oxi_guess = self .composition .oxi_state_guesses (** kwargs )
700
- oxi_guess = oxi_guess or [{e .symbol : 0 for e in self .composition }]
700
+ oxi_guess = oxi_guess or [{e .symbol : 0 for e in self .composition }] # type:ignore[assignment]
701
701
self .add_oxidation_state_by_element (oxi_guess [0 ])
702
702
703
703
return self
@@ -749,7 +749,7 @@ def remove_spin(self) -> Self:
749
749
new_sp : dict [Element , float ] = defaultdict (float )
750
750
for sp , occu in site .species .items ():
751
751
oxi_state = getattr (sp , "oxi_state" , None )
752
- new_sp [Species (sp .symbol , oxidation_state = oxi_state )] += occu
752
+ new_sp [Species (sp .symbol , oxidation_state = oxi_state )] += occu # type:ignore[index]
753
753
site .species = Composition (new_sp )
754
754
755
755
return self
@@ -1014,9 +1014,9 @@ class IStructure(SiteCollection, MSONable):
1014
1014
1015
1015
def __init__ (
1016
1016
self ,
1017
- lattice : ArrayLike | Lattice ,
1017
+ lattice : NDArray [ np . float64 ] | Lattice ,
1018
1018
species : Sequence [CompositionLike ],
1019
- coords : Sequence [ArrayLike ],
1019
+ coords : Sequence [NDArray [ np . float64 ] ],
1020
1020
charge : float | None = None ,
1021
1021
validate_proximity : bool = False ,
1022
1022
to_unit_cell : bool = False ,
@@ -1352,7 +1352,7 @@ def from_spacegroup(
1352
1352
props = {} if site_properties is None else site_properties
1353
1353
1354
1354
all_sp : list [str | Element | Species | DummySpecies | Composition ] = []
1355
- all_coords : list [list [ float ]] = []
1355
+ all_coords : list [NDArray [ np . float64 ]] = []
1356
1356
all_site_properties : dict [str , list ] = defaultdict (list )
1357
1357
all_labels : list [str | None ] = []
1358
1358
for idx , (sp , c ) in enumerate (zip (species , frac_coords , strict = True )):
@@ -3106,7 +3106,7 @@ def from_str( # type:ignore[override]
3106
3106
from pymatgen .io .cssr import Cssr
3107
3107
3108
3108
cssr = Cssr .from_str (input_string , ** kwargs )
3109
- struct = cssr .structure
3109
+ struct = cssr .structure # type:ignore[assignment]
3110
3110
elif fmt_low == "json" :
3111
3111
dct = json .loads (input_string )
3112
3112
struct = Structure .from_dict (dct )
@@ -3125,7 +3125,7 @@ def from_str( # type:ignore[override]
3125
3125
elif fmt == "aims" :
3126
3126
from pymatgen .io .aims .inputs import AimsGeometryIn
3127
3127
3128
- struct = AimsGeometryIn .from_str (input_string ).structure
3128
+ struct = AimsGeometryIn .from_str (input_string ).structure # type:ignore[assignment]
3129
3129
# fleur support implemented in external namespace pkg https://github.com/JuDFTteam/pymatgen-io-fleur
3130
3130
elif fmt == "fleur-inpgen" :
3131
3131
from pymatgen .io .fleur import FleurInput
@@ -3190,7 +3190,7 @@ def from_file( # type:ignore[override]
3190
3190
3191
3191
fname = os .path .basename (filename )
3192
3192
with zopen (filename , mode = "rt" , errors = "replace" , encoding = "utf-8" ) as file :
3193
- contents : str = file .read ()
3193
+ contents : str = file .read () # type:ignore[assignment]
3194
3194
if fnmatch (fname .lower (), "*.cif*" ) or fnmatch (fname .lower (), "*.mcif*" ):
3195
3195
return cls .from_str (
3196
3196
contents ,
@@ -3257,7 +3257,7 @@ def from_file( # type:ignore[override]
3257
3257
elif fnmatch (fname , "input*.xml" ):
3258
3258
from pymatgen .io .exciting import ExcitingInput
3259
3259
3260
- return ExcitingInput .from_file (fname , ** kwargs ).structure
3260
+ return ExcitingInput .from_file (fname , ** kwargs ).structure # type:ignore[assignment]
3261
3261
elif fnmatch (fname , "*rndstr.in*" ) or fnmatch (fname , "*lat.in*" ) or fnmatch (fname , "*bestsqs*" ):
3262
3262
return cls .from_str (
3263
3263
contents ,
@@ -3270,7 +3270,7 @@ def from_file( # type:ignore[override]
3270
3270
elif fnmatch (fname , "CTRL*" ):
3271
3271
from pymatgen .io .lmto import LMTOCtrl
3272
3272
3273
- return LMTOCtrl .from_file (filename = filename , ** kwargs ).structure
3273
+ return LMTOCtrl .from_file (filename = filename , ** kwargs ).structure # type:ignore[assignment]
3274
3274
elif fnmatch (fname , "geometry.in*" ):
3275
3275
return cls .from_str (
3276
3276
contents ,
@@ -5228,7 +5228,7 @@ def insert( # type:ignore[override]
5228
5228
self ,
5229
5229
idx : int ,
5230
5230
species : CompositionLike ,
5231
- coords : ArrayLike ,
5231
+ coords : NDArray [ np . float64 ] ,
5232
5232
validate_proximity : bool = False ,
5233
5233
properties : dict | None = None ,
5234
5234
label : str | None = None ,
0 commit comments