From 249c6d6de9a3ae7d222f09bbad523e954a37ae23 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 23 Jun 2025 16:51:33 -0400 Subject: [PATCH] add emacs local variable tweaks and add some missing docstrings --- python/lammps/__init__.py | 5 +++++ python/lammps/constants.py | 5 +++++ python/lammps/core.py | 8 +++++++- python/lammps/data.py | 5 +++++ python/lammps/formats.py | 5 +++++ python/lammps/numpy_wrapper.py | 5 +++++ python/lammps/pylammps.py | 5 +++++ 7 files changed, 37 insertions(+), 1 deletion(-) diff --git a/python/lammps/__init__.py b/python/lammps/__init__.py index 9f7f2ab62c..b42b0d37b5 100644 --- a/python/lammps/__init__.py +++ b/python/lammps/__init__.py @@ -52,3 +52,8 @@ def get_version_number(): return t.tm_year*10000 + t.tm_mon*100 + t.tm_mday __version__ = get_version_number() + +# Local Variables: +# fill-column: 100 +# python-indent-offset: 2 +# End: diff --git a/python/lammps/constants.py b/python/lammps/constants.py index 2d06ea412d..b7496b4751 100644 --- a/python/lammps/constants.py +++ b/python/lammps/constants.py @@ -65,3 +65,8 @@ def get_ctypes_int(size): if size == 8: return c_int64 return c_int + +# Local Variables: +# fill-column: 100 +# python-indent-offset: 2 +# End: diff --git a/python/lammps/core.py b/python/lammps/core.py index 5ae6896935..cf1a088420 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -37,6 +37,7 @@ from lammps.data import NeighList # ------------------------------------------------------------------------- class MPIAbortException(Exception): + """Exception to use when LAMMPS wants to call MPI_Abort()""" def __init__(self, message): self.message = message @@ -60,6 +61,7 @@ class ExceptionCheck: # ------------------------------------------------------------------------- class command_wrapper: + """Wrapper class to enable using 'lmp.xxx("args")' instead of 'lmp.command("xxx args")'""" def __init__(self, lmp): self.lmp = lmp self.auto_flush = False @@ -1625,12 +1627,14 @@ class lammps: # ------------------------------------------------------------------------- def clearstep_compute(self): + """Call 'lammps_clearstep_compute()' from Python""" with ExceptionCheck(self): return self.lib.lammps_clearstep_compute(self.lmp) # ------------------------------------------------------------------------- def addstep_compute(self, nextstep): + """Call 'lammps_addstep_compute()' from Python""" with ExceptionCheck(self): nextstep = self.c_bigint(nextstep) return self.lib.lammps_addstep_compute(self.lmp, byref(nextstep)) @@ -1638,6 +1642,7 @@ class lammps: # ------------------------------------------------------------------------- def addstep_compute_all(self, nextstep): + """Call 'lammps_addstep_compute_all()' from Python""" with ExceptionCheck(self): nextstep = self.c_bigint(nextstep) return self.lib.lammps_addstep_compute_all(self.lmp, byref(nextstep)) @@ -2894,5 +2899,6 @@ class lammps: return idx # Local Variables: -# fill-column: 80 +# fill-column: 100 +# python-indent-offset: 2 # End: diff --git a/python/lammps/data.py b/python/lammps/data.py index f511ea29b5..7747231bd8 100644 --- a/python/lammps/data.py +++ b/python/lammps/data.py @@ -91,3 +91,8 @@ class NeighList: return numneigh, neighbors return -1, None + +# Local Variables: +# fill-column: 100 +# python-indent-offset: 2 +# End: diff --git a/python/lammps/formats.py b/python/lammps/formats.py index 7ee2e0f9f5..8b3d3f5430 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -231,3 +231,8 @@ class AvgChunkFile: self.timesteps.append(timestep) self.total_count.append(total_count) + +# Local Variables: +# fill-column: 100 +# python-indent-offset: 2 +# End: diff --git a/python/lammps/numpy_wrapper.py b/python/lammps/numpy_wrapper.py index 494d4f7346..6bdde3bac6 100644 --- a/python/lammps/numpy_wrapper.py +++ b/python/lammps/numpy_wrapper.py @@ -526,3 +526,8 @@ class NumPyNeighList(NeighList): if idx == iatom: return neighbors return None + +# Local Variables: +# fill-column: 100 +# python-indent-offset: 2 +# End: diff --git a/python/lammps/pylammps.py b/python/lammps/pylammps.py index 243ebc11bc..f19b2ce78c 100644 --- a/python/lammps/pylammps.py +++ b/python/lammps/pylammps.py @@ -1015,3 +1015,8 @@ class IPyLammps(PyLammps): """ from IPython.display import HTML return HTML("") + +# Local Variables: +# fill-column: 100 +# python-indent-offset: 2 +# End: