8
8
from fleur input files (http://flapw.de).
9
9
"""
10
10
import warnings
11
- from typing import Union , Any
11
+ from typing import Optional , Union , Any
12
12
from pathlib import Path
13
13
from monty .io import zopen
14
14
from monty .json import MSONable
@@ -42,8 +42,8 @@ class FleurInput(MSONable):
42
42
def __init__ (
43
43
self ,
44
44
structure : Structure ,
45
- title : str = None ,
46
- lapw_parameters : dict = None ,
45
+ title : Optional [ str ] = None ,
46
+ lapw_parameters : Optional [ dict ] = None ,
47
47
** kwargs : Any ,
48
48
):
49
49
"""
@@ -98,7 +98,7 @@ def from_string(data: Union[str, bytes], inpgen_input: bool = True, **kwargs) ->
98
98
parameters = get_parameter_data (xmltree , schema_dict )
99
99
title_in = parameters .pop ("title" , "" )
100
100
101
- positions , elements , _ = zip (* atoms )
101
+ positions , elements = zip (* [( site . position , site . symbol ) for site in atoms ] )
102
102
# create lattice and structure object
103
103
lattice_in = Lattice (cell , pbc = pbc )
104
104
structure_in = Structure (lattice_in , elements , positions , coords_are_cartesian = True )
@@ -128,7 +128,7 @@ def from_file(filename: PathLike) -> "FleurInput":
128
128
return FleurInput .from_string (data , inpgen_input = inpgen_input , base_url = filename )
129
129
130
130
def get_inpgen_file_content (
131
- self , parameters : dict = None , ignore_set_parameters : bool = False , ** kwargs : Union [int , bool ]
131
+ self , parameters : Optional [ dict ] = None , ignore_set_parameters : bool = False , ** kwargs : Union [int , bool ]
132
132
):
133
133
"""
134
134
Produce the inpgen input file corresponding to the given information
@@ -143,6 +143,7 @@ def get_inpgen_file_content(
143
143
returns: str of the inpgen input file
144
144
"""
145
145
from masci_tools .io .fleur_inpgen import write_inpgen_file
146
+ from masci_tools .io .common_functions import AtomSiteProperties
146
147
147
148
if parameters is None :
148
149
parameters = {}
@@ -153,7 +154,10 @@ def get_inpgen_file_content(
153
154
if "title" not in parameters :
154
155
parameters ["title" ] = self .title
155
156
156
- atom_sites = [(site .coords , site .specie .symbol , site .specie .symbol ) for site in self .structure .sites ]
157
+ atom_sites = [
158
+ AtomSiteProperties (position = site .coords , symbol = site .specie .symbol , kind = site .specie .symbol )
159
+ for site in self .structure .sites
160
+ ]
157
161
158
162
return write_inpgen_file (
159
163
self .structure .lattice .matrix ,
0 commit comments