@@ -61,10 +61,12 @@ class FdmnesXasInput:
6161 struct_type : Union [str , None ] = None #: type of the structure
6262 vmax : Union [float , None ] = None #: maximum potential value for molecules
6363 erange : str = "-20.0 0.1 70.0 1.0 100.0" #: energy range
64- fileout_prefix : str = "job" #: prefix of the output filename for the FDMNES job (extension: .inp)
64+ fileout_prefix : str = (
65+ "job" #: prefix of the output filename for the FDMNES job (extension: .inp)
66+ )
6567 tmplpath : Union [str , Path , None ] = None #: path to the FDMNES input template
6668 params : Union [dict [str , bool ], None ] = None #: enable/disable parameters for FDMNES
67- spacer : str = " " #: spacer for the FDMNES input text
69+ spacer : str = " " #: spacer for the FDMNES input text
6870
6971 def __post_init__ (self ):
7072 """Validate and optimize attributes"""
@@ -320,7 +322,8 @@ def get_input(self, comment: str = "", struct_type: str = None) -> str:
320322 return strict_ascii (template .format (** conf ))
321323
322324 def write_input (
323- self , inputtext : Union [str , None ] = None , outdir : Union [str , Path , None ] = None ) -> Path :
325+ self , inputtext : Union [str , None ] = None , outdir : Union [str , Path , None ] = None
326+ ) -> Path :
324327 """Write the FDMNES input text to disk and return the output directory"""
325328 if inputtext is None :
326329 inputtext = self .get_input ()
@@ -351,6 +354,8 @@ def struct2fdmnes(
351354 frame : int = 0 ,
352355 format : str = "cif" ,
353356 filename : Union [None , str ] = None ,
357+ radius : float = 7 ,
358+ edge : str | None = None ,
354359) -> dict :
355360 """convert CIF/XYZ into a dictionary of {name: text} for FDMNES output files
356361
@@ -388,8 +393,14 @@ def struct2fdmnes(
388393 structs = get_structure_from_text (
389394 inp , absorber , frame = frame , format = format , filename = filename
390395 )
391- fout_name = f"{ filename .replace ('.' , '_' )} _{ absorber .symbol } "
392- fdm = FdmnesXasInput (structs , absorber = absorber , fileout_prefix = fout_name )
393- return {"fdmfile.txt" : f"1\n { fout_name } .inp\n " , fout_name : fdm .get_input ()}
394-
395-
396+ fout_prefix = f"{ filename .replace ('.' , '_' )} _{ absorber .symbol } "
397+ fout_name = f"{ fout_prefix } .inp"
398+ fdm = FdmnesXasInput (
399+ structs ,
400+ absorber = absorber ,
401+ frame = frame ,
402+ edge = edge ,
403+ radius = radius ,
404+ fileout_prefix = fout_prefix ,
405+ )
406+ return {"fdmfile.txt" : f"1\n { fout_name } \n " , fout_name : fdm .get_input ()}
0 commit comments