Python Stack in ADF Modeling Suite¶
The ADF Modeling Suite includes a python stack based on the Enthought Python Distribution. Some of the included modules are:
numpy (1.11.3) and scipy (0.18.1): Big modules with a lot of functionality for math and science, more information on the SciPy website.
ipython4 (5.1.0): An improved interactive python shell, more information can be found on the iPython website. Can be started with:
ase (3.13.0): ASE (Atomistic Simulation Environment) is a python module for atomistic simulations, more information in the ASE documentation.
matplotlib (1.5.1): A library for plotting data in 2D, more information on the Matplotlib website. We do not ship an interactive backend for matplotlib, so make sure to set a non-interactive backend when using it. For example the Agg backend for PNGs:
import matplotlib matplotlib.use('Agg')
pip (9.0.1): The recommended tool for installing packages from the Python Package Index (PyPI). The pip documentation explains in detail how to use this tool, but for the Python stack shipped with the ADF Modelling Suite all pip commands need to be prefixed with $ADFBIN/startpython -m:
$ADFBIN/startpython -m pip list $ADFBIN/startpython -m pip show scipy $ADFBIN/startpython -m pip search rotate-backups $ADFBIN/startpython -m pip install rotate-backups
flexmd: A module for running MD simulations with adaptive QM/MM regions. Details can be found in the FlexMD documentation.
plams: PLAMS (Python Library for Automating Molecular Simulation) is a collection of tools that aim at providing powerful, flexible and easily extendable Python interface to molecular modeling programs. It takes care of input preparation, job execution, file management and output processing as well as helps with building more advanced data workflows. See the PLAMS tutorials and PLAMS documentation for more information.
autografs: AuToGraFS stands for Automatic Topological Generator for Framework Structures. Information and examples can be found in the AuToGraFS documentation.
Using other modules with the ADF Python Stack¶
You can extend the the ADF Python Stack with other modules. You can use pip (see above) to install additional modules if they are available on the Python Package Index (PyPI).
If the module is your own code or you just have a copy of the source code, you can add the location of the source to the SCM_PYTHONPATH variable to make the module available in the ADF Python Stack. To avoid collisions with other python installations on the system, we unload PYTHONPATH and PYTHONHOME from the environment when launching the ADF Python Stack and put the content of SCM_PYTHONPATH into PYTHONPATH.
If you for some reason have to use the PYTHONPATH variable and are unable to use SCM_PYTHONPATH, you can modify $ADFBIN/startpython and $ADFBIN/startipython to not have it cleared when starting python.