mooonpy.thermospace.thermospace module

class mooonpy.thermospace.thermospace.Thermospace(**kwargs)[source]

Bases: ColTable

Class to hold data found in LAMMPS logs. Data is organized into columns

classmethod basic_read(file: Path | str, silence_error_line: bool = False) Thermospace[source]
join_restart(restart, step_col='Step', restart_step_ind=0, this_step_ind=None)[source]

Appends data from a restarted thermospace to the current one. Uses (step_col, restart_step_ind) as the start of the appended section, and finds the last matching (step_col, this_step_ind) and overwrites after that

step_col is the column used for indexing, defaults to ‘Step’ but ‘v_Time’ may also be used

restart_step_ind = 0 uses 0th index step, and so on this_step_ind = None uses last matching value

sect(sect_string: str | range | list | int | None = None, priority='off') ColTable[source]
mooonpy.thermospace.thermospace.readlog_basic(file: [<class 'mooonpy.tools.file_utils.Path'>, <class 'str'>], silence_error_line: bool = False) Thermospace[source]

Read a single log file into a Thermospace object. Only reads thermo table, no timing or variable information.

Parameters:
  • file ([Path,str]) – path to a log file

  • silence_error_line (bool) – silences error line and warnings if True (default False)

Returns:

Thermospace object

Return type:

Thermospace

Example:
>>> import mooonpy
>>> file = mooonpy.Path('somepath.log.lammps')
>>> MyLog = mooonpy.readlog_basic(file)
>>> MyLog.csv(file.new_ext('.csv'))

See also

thermospace.Thermospace, tables.ColTable

Warning

Files with no thermo data, or incorrect format, will raise a warning, then return an empty Thermospace object.

Note

This function is capable reading logs with pauses for XRD, and changes to ‘LAMMMPS thermo_style’_. Columns with missing data from style changes are padded with np.nan values in a float array. Complete columns that are intergers are converted to int arrays.

Todo

  • Unit tests for failure modes and column changes