pymatgen.io.abinit.abiinspect module¶
This module provides objects to inspect the status of the Abinit tasks at run-time. by extracting information from the main output file (text format).
-
class
D2DEScfCycle(fields)[source]¶ Bases:
pymatgen.io.abinit.abiinspect.ScfCycleResult of the Phonon self-consistent cycle.
-
MAGIC= 'iter 2DEtotal(Ha)'¶
-
last_etotal¶ The 2-nd order derivative of the energy at the last iteration.
-
-
class
GroundStateScfCycle(fields)[source]¶ Bases:
pymatgen.io.abinit.abiinspect.ScfCycleResult of the Ground State self-consistent cycle.
-
MAGIC= 'iter Etot(hartree)'¶
-
last_etotal¶ The total energy at the last iteration.
-
-
class
PhononScfCycle(fields)[source]¶ Bases:
pymatgen.io.abinit.abiinspect.D2DEScfCycleIterations of the DFPT SCF cycle for phonons.
-
class
Relaxation(cycles)[source]¶ Bases:
collections.abc.IterableA list of
GroundStateScfCycleobjects.Note
Forces, stresses and crystal structures are missing. This object is mainly used to analyze the behavior of the Scf cycles during the structural relaxation. A more powerful and detailed analysis can be obtained by using the HIST.nc file.
-
classmethod
from_stream(stream)[source]¶ Extract data from stream. Returns None if some error occurred.
-
history¶ Dictionary of lists with the evolution of the data as function of the relaxation step.
-
plot(axlist=None, **kwargs)[source]¶ Uses matplotlib to plot the evolution of the structural relaxation.
- Args:
- axlist: List of axes. If None a new figure is produced.
- Returns:
- matplotlib figure
keyword arguments controlling the display of the figure:
kwargs Meaning title Title of the plot (Default: None). show True to show the figure (default: True). savefig ‘abc.png’ or ‘abc.eps’ to save the figure to a file. size_kwargs Dictionary with options passed to fig.set_size_inches example: size_kwargs=dict(w=3, h=4) tight_layout True if to call fig.tight_layout (default: False)
-
classmethod
-
class
ScfCycle(fields)[source]¶ Bases:
collections.abc.MappingIt essentially consists of a dictionary mapping string to list of floats containing the data at the different iterations.
-
classmethod
from_stream(stream)[source]¶ Read the first occurrence of ScfCycle from stream.
Returns: None if no ScfCycle entry is found.
-
last_iteration¶ Returns a dictionary with the values of the last iteration.
-
plot(axlist=None, **kwargs)[source]¶ Uses matplotlib to plot the evolution of the SCF cycle. Return matplotlib figure
- Args:
- axlist: List of axes. If None a new figure is produced.
Returns: matplotlib figure
keyword arguments controlling the display of the figure:
kwargs Meaning title Title of the plot (Default: None). show True to show the figure (default: True). savefig ‘abc.png’ or ‘abc.eps’ to save the figure to a file. size_kwargs Dictionary with options passed to fig.set_size_inches example: size_kwargs=dict(w=3, h=4) tight_layout True if to call fig.tight_layout (default: False)
-
classmethod
-
class
YamlDoc(text, lineno, tag=None)[source]¶ Bases:
objectHandy object that stores that YAML document, its main tag and the position inside the file.
Parameters: - text – String with the YAML document.
- lineno – The line number where the document is located.
- tag – The YAML tag associate to the document.
-
lineno¶
-
tag¶
-
text¶
-
text_notag¶ Returns the YAML text without the tag. Useful if we don’t have any constructor registered for the tag (we used the tag just to locate the document).
-
class
YamlTokenizer(filename)[source]¶ Bases:
collections.abc.IteratorProvides context-manager support so you can use it in a with statement.
-
Error¶ alias of
YamlTokenizerError
-
all_yaml_docs()[source]¶ Returns a list with all the YAML docs found in stream. Seek the stream before returning.
Warning
Assume that all the YAML docs (with the exception of the last one) are closed explicitely with the sentinel ‘…’
-
next()[source]¶ Returns the first YAML document in stream.
Warning
Assume that the YAML document are closed explicitely with the sentinel ‘…’
-
next_doc_with_tag(doc_tag)[source]¶ Returns the next document with the specified tag. Empty string is no doc is found.
-
seek(offset[, whence]) → None. Move to new file position.[source]¶ Argument offset is a byte count. Optional argument whence defaults to 0 (offset from start of file, offset should be >= 0); other values are 1 (move relative to current position, positive or negative), and 2 (move relative to end of file, usually negative, although many platforms allow seeking beyond the end of a file). If the file is opened in text mode, only offsets returned by tell() are legal. Use of other offsets causes undefined behavior. Note that not all file objects are seekable.
-
-
exception
YamlTokenizerError[source]¶ Bases:
ExceptionExceptions raised by
YamlTokenizer.
-
plottable_from_outfile(filepath)[source]¶ Factory function that returns a plottable object by inspecting the main output file of abinit Returns None if it is not able to detect the class to instantiate.