diff --git a/doc/src/Python_properties.rst b/doc/src/Python_properties.rst index d8e772379c..031461660a 100644 --- a/doc/src/Python_properties.rst +++ b/doc/src/Python_properties.rst @@ -53,6 +53,7 @@ against invalid accesses. * :py:meth:`version() `: return the numerical version id, e.g. LAMMPS 2 Sep 2015 -> 20150902 * :py:meth:`get_thermo() `: return current value of a thermo keyword + * :py:meth:`last_thermo() `: return a dictionary of the last thermodynamic output * :py:meth:`get_natoms() `: total # of atoms as int * :py:meth:`reset_box() `: reset the simulation box size * :py:meth:`extract_setting() `: return a global setting @@ -60,6 +61,10 @@ against invalid accesses. * :py:meth:`extract_box() `: extract box info * :py:meth:`create_atoms() `: create N atoms with IDs, types, x, v, and image flags + **Properties**: + + * :py:attr:`last_thermo_step `: the last timestep thermodynamic output was computed + .. tab:: PyLammps/IPyLammps API In addition to the functions provided by :py:class:`lammps `, :py:class:`PyLammps ` objects diff --git a/python/lammps/core.py b/python/lammps/core.py index cf613fcbf4..84a80e77a3 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -748,6 +748,11 @@ class lammps(object): # ------------------------------------------------------------------------- @property def last_thermo_step(self): + """ Get the last timestep where thermodynamic data was computed + + :return: the timestep or a negative number if there has not been any thermo output yet + :rtype: int + """ with ExceptionCheck(self): ptr = self.lib.lammps_last_thermo(self.lmp, c_char_p("step".encode()), 0) return cast(ptr, POINTER(self.c_bigint)).contents.value @@ -760,7 +765,7 @@ class lammps(object): data from the last timestep into a dictionary. The return value is None, if there has not been any thermo output yet. - :return: value of thermo keyword + :return: a dictionary containing the last computed thermo output values :rtype: dict or None """