diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index 64c890d8ec..b18dc49e38 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -240,9 +240,11 @@ C-style interface, provided in src/library.cpp and src/library.h. See the :doc:`Python library ` doc page for a description of the Python interface to LAMMPS, which wraps the C-style -interface from a shared library through the ctypes python module. +interface from a shared library through the `ctypes python module `_. See the sample codes in examples/COUPLE/simple for examples of C++ and C and Fortran codes that invoke LAMMPS through its library interface. Other examples in the COUPLE directory use coupling ideas discussed on the :doc:`Howto couple ` doc page. + +.. _ctypes: https://docs.python.org/3/library/ctypes.html diff --git a/doc/src/Howto_pylammps.rst b/doc/src/Howto_pylammps.rst index e1694e2062..96d9acd994 100644 --- a/doc/src/Howto_pylammps.rst +++ b/doc/src/Howto_pylammps.rst @@ -6,19 +6,23 @@ PyLammps Tutorial Overview -------- -PyLammps is a Python wrapper class which can be created on its own or -use an existing lammps Python object. It creates a simpler, -Python-like interface to common LAMMPS functionality, in contrast to -the lammps.py wrapper on the C-style LAMMPS library interface which is -written using Python ctypes. The lammps.py wrapper is discussed on -the :doc:`Python library ` doc page. +``PyLammps`` is a Python wrapper class for LAMMPS which can be created +on its own or use an existing lammps Python object. It creates a simpler, +more "pythonic" interface to common LAMMPS functionality, in contrast to +the ``lammps.py`` wrapper for the C-style LAMMPS library interface which +is written using `Python ctypes `_. The ``lammps.py`` wrapper +is discussed on the :doc:`Python library ` doc page. -Unlike the flat ctypes interface, PyLammps exposes a discoverable API. -It no longer requires knowledge of the underlying C++ code -implementation. Finally, the IPyLammps wrapper builds on top of -PyLammps and adds some additional features for IPython integration -into IPython notebooks, e.g. for embedded visualization output from -dump/image. +Unlike the flat ``ctypes`` interface, PyLammps exposes a discoverable +API. It no longer requires knowledge of the underlying C++ code +implementation. Finally, the ``IPyLammps`` wrapper builds on top of +``PyLammps`` and adds some additional features for +`IPython integration `_ into `Jupyter notebooks `_, +e.g. for embedded visualization output from :doc:`dump style image `. + +.. _ctypes: https://docs.python.org/3/library/ctypes.html +.. _ipython: https://ipython.org/ +.. _jupyter: https://jupyter.org/ Comparison of lammps and PyLammps interfaces ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -26,7 +30,7 @@ Comparison of lammps and PyLammps interfaces lammps.lammps """"""""""""" -* uses C-Types +* uses ``ctypes`` * direct memory access to native C++ data * provides functions to send and receive data to LAMMPS * requires knowledge of how LAMMPS internally works (C pointers, etc) @@ -34,7 +38,7 @@ lammps.lammps lammps.PyLammps """"""""""""""" -* higher-level abstraction built on top of original C-Types interface +* higher-level abstraction built on top of original ctypes interface * manipulation of Python objects * communication with LAMMPS is hidden from API user * shorter, more concise Python