sisl.io.siesta.fdf module¶
Sile object for reading/writing FDF files
-
class
sisl.io.siesta.fdf.
fdfSileSiesta
(filename, mode='r', base=None)[source]¶ Bases:
sisl.io.siesta.sile.SileSiesta
FDF file object
Attributes
file
Return the current file name (without the directory prefix) Methods
ArgumentParser
([parser])ArgumentParser_out
([parser])Appends additional arguments based on the output of the file get
(key[, unit, default, with_unit])Retrieve fdf-keyword from the file includes
(*args, **kwargs)is_keys
(keys)Returns true if isinstance(keys,(list,np.ndarray))
key
(key)Return the key as written in the fdf-file. key2case
(key, case)Converts str/list of keywords to proper case keys2case
(keys, case)Converts str/list of keywords to proper case line_has_key
(line, key[, case])line_has_keys
(line, keys[, case])print
(key, value)Return a string which is pretty-printing the key+value read
(*args, **kwargs)Generic read method which should be overloaded in child-classes read_geom
(*args, **kwargs)Returns Geometry object from the FDF file read_sc
(*args, **kwargs)Returns SuperCell
object from the FDF filereadline
([comment])Reads the next line of the file set
(key, value[, keep])Add the key and value to the FDF file step_either
(keywords[, case])Steps the file-handle until the keyword is found in the input step_to
(keywords[, case])Steps the file-handle until the keyword is found in the input type
(key)Return the type of the fdf-keyword write
(*args, **kwargs)Generic write method which should be overloaded in child-classes write_geom
(*args, **kwargs)Initialize an FDF file from the filename
By supplying base you can reference files in other directories. By default the
base
is the directory given in the file name.Attributes
file
Return the current file name (without the directory prefix) Methods
ArgumentParser
([parser])ArgumentParser_out
([parser])Appends additional arguments based on the output of the file get
(key[, unit, default, with_unit])Retrieve fdf-keyword from the file includes
(*args, **kwargs)is_keys
(keys)Returns true if isinstance(keys,(list,np.ndarray))
key
(key)Return the key as written in the fdf-file. key2case
(key, case)Converts str/list of keywords to proper case keys2case
(keys, case)Converts str/list of keywords to proper case line_has_key
(line, key[, case])line_has_keys
(line, keys[, case])print
(key, value)Return a string which is pretty-printing the key+value read
(*args, **kwargs)Generic read method which should be overloaded in child-classes read_geom
(*args, **kwargs)Returns Geometry object from the FDF file read_sc
(*args, **kwargs)Returns SuperCell
object from the FDF filereadline
([comment])Reads the next line of the file set
(key, value[, keep])Add the key and value to the FDF file step_either
(keywords[, case])Steps the file-handle until the keyword is found in the input step_to
(keywords[, case])Steps the file-handle until the keyword is found in the input type
(key)Return the type of the fdf-keyword write
(*args, **kwargs)Generic write method which should be overloaded in child-classes write_geom
(*args, **kwargs)-
ArgumentParser
(parser=None, *args, **kwargs)¶
-
file
¶ Return the current file name (without the directory prefix)
-
includes
(*args, **kwargs)¶
-
read_geom
(*args, **kwargs)[source]¶ Returns Geometry object from the FDF file
NOTE: Interaction range of the Atoms are currently not read.
-
set
(key, value, keep=True)[source]¶ Add the key and value to the FDF file
Parameters: key :
str
the fdf-key value to be set in the fdf file
value :
str
/list
the value of the string. If a
str
is passed a regular fdf-key is used, if alist
it will be a %block.keep :
bool
whether old flags will be kept in the fdf file.
-
write_geom
(*args, **kwargs)¶
-