Package: polypy
This is the documentation for the open-source Python project -polypy,
A library designed to facilitate the analysis ofDL_POLYandDL_MONTEcalculations.
polypy is built on existing Python packages that those in the solid state physics/chemistry community should already be familiar with.
It is hoped that this tool will bring some benfits to the solid state community and facilitate data analysis and the generation of publication ready plots (powered by Matplotlib.)The main features include:Method to analyse the number denisty of a given species in one and two dimensions.Generate a plot of the total number of species in bins perpendicular to a specified direction.Generate a plot of the total number of species in cuboids parallel to a specified direction.Method calculate the charge density from the number density.Convert number densities of all species in bins perpendicular to a specified direction into the charge density.Calculate the electric field and electrostatic potential from the charge density.Solves the Poisson Boltzmann equation to convert the charge density into the electric field and the electrostatic potential.Calculate the diffusion coefficient for a given species from a mean squared displacement.Carries out a mean squared displacement on an MD trajectory.Calculates the diffusion coefficient.Uses the density analysis and the diffusion coefficient to calculate the ionic conductivity.(a) Mean squared displacement for calcuim fluoride. (b) System volume of calcium fluoride during a molecular dynamics simulation. (c) Cerium and oxygen number density at a grain boundary. (d) Electrostatic potential across a grain boundary of cerium oxide. (e) Center of mass of cerium (blue) and oxygen (orange) in a cerium oxide grain boundary in two dimensions.The code has been developed to analyse DL_POLY and DL_MONTE calculations however other codes can be incorporated if there is user demand. Other formats, such as pdb or xyz can be converted toDL_POLYformat with codes such asatomskand then analysed withpolypy. Users are welcome to increase the file coverage by adding a reading function for a different format. This can be accomplished by adding to thereadmodule which has a class for each unique file type that converts it to apolypy.read.trajectoryobject.polypywas developed during a PhD project and as such the functionality focuses on the research questions encountered during that project, which we should clarify are wide ranging. Code contributions aimed at expanding the code to new of problems are encouraged.polypyis free to use.UsageA full list of examples can be found in the examples folder of the git repository, these include both the Python scripts and jupyter notebook tutorials which combine the full theory with code examples. It should be noted however that DL_POLY HISTORY files and DL_MONTE ARCHIVE files are sizable (1-5GB) and as such only short example trajectories are included in this repository. Notebooks are provided here to illustrate the theory but are not practicle.Installationpolypyis a Python 3 package and requires a typical scientific Python stack. Use of the tutorials requires Anaconda/Jupyter to be installed.To build from source:pip install -r requirements.txt

python setup.py build

python setup.py installOr alternatively install with pippip install polypyUsing conda,conda skeleton pypi polypy

conda build polypy

conda install --use-local polypyTestsTests can be run by typing:python setup.py testin the root directory.DocumentationTo build the documentation from scratchcd docs
make htmlAn online version of the documentation can be foundhere. The documentation contains an extensive explanation of the underlying theory, function documentation and tutorials.Licensepolypyis made available under the MIT License.Detailed requirementspolypyis compatible with Python 3.5+ and relies on a number of open source Python packages, specifically:matplotlibnumpyscipycoverallscoverageseabornpandasjupyternbsphinxjupyter-sphinx==0.2.4sphinx_rtd_themeContributingContactIf you have questions regarding any aspect of the software then please get in touch with the developer Adam Symington via email -ars44@bath.ac.uk.
Alternatively you can create an issue on theIssue Tracker.BugsThere may be bugs. If you think you've caught one, please report it on theIssue Tracker.
This is also the place to propose new ideas for features or ask questions about the design ofpolypy. Poor documentation is considered a bug
so feel free to request improvements.Code contributionsWe welcome help in improving and extending the package. This is managed through Github pull requests; for external contributions we prefer the"fork and pull"workflow while core developers use branches in the main repository:First open an Issue to discuss the proposed contribution. This
discussion might include how the changes fit polypy's scope and a
general technical approach.Make your own project fork and implement the changes
there. Please keep your code style compliant with PEP8.Open a pull request to merge the changes into the main
project. A more detailed discussion can take place there before
the changes are accepted.For further information please contact Adam Symington,ars44@bath.ac.ukFutureListed below are a series of useful additions that we would like to make to the codebase. Users are encouraged to fork the repository and work on any of these problems. Indeed, if functionality is not listed below you are more than welcome to add it.RDFDiagonal slicesRegional MSDs in a cubeAuthorAdam R.SymingtonResearchDefect segregation facilitates oxygen transport at fluorite UO2 grain boundariesThe role of dopant segregation on the oxygen vacancy distribution and oxygen diffusion in CeO2 grain boundariesQuantifying the impact of disorder on Li-ion and Na-ion transport in perovskite titanate solid electrolytes for solid-state batteriesAcknowledgementsThis package was written during a PhD project that was funded by AWE and EPSRC (EP/R010366/1). Thepolypysoftware package was developed to analyse data generated using the Balena HPC facility at the University of Bath and the ARCHER UK National Supercomputing Service (http://www.archer.ac.uk) via our membership of the UK's HEC Ma-terials Chemistry Consortium funded by EPSRC (EP/L000202).The author would like to thank Andrew R. McCluskey, Benjamin Morgan, Marco Molinari, James Grant and Stephen C. Parker for their help and guidance during this PhD project.