==========================
Installing MDAnalysisTests
==========================

The MDAnalysisTests package contains trajectories and structures
that are used in the test suite of the MDAnalysis package
https://www.mdanalysis.org. They should be installed together
with MDAnalysis.

However, the test files change less frequently, take up about 70 MB
of space, and are not needed for daily use of MDAnalysis so they are
distributed separately from the main package.


Help
====

If you have any problems please read through the files INSTALL (this
file) and README and check the MDAnalysis project pages at

      https://www.mdanalysis.org

in particular https://github.com/MDAnalysis/mdanalysis/wiki/INSTALL and
related pages.

You can always ask questions on GitHub Discussions:

      https://github.com/MDAnalysis/mdanalysis/discussions/categories/installation

People there are very happy to help. When posting please remember to mention
the release of MDAnalysis you are trying to install (e.g. "tar file
MDAnalysis-0.7.3 from website" or "git commit deadbee3"), all the commands that
you typed to install the package, and the full output (typically right from
``python setup.py build``). You should also mention your operating system
(e.g. Ubuntu 16.04) and Python version (output from ``python --version``) so
that we can better diagnose the problem.


Getting the source 
==================

Download a tar ball from https://pypi.org/project/MDAnalysisTests; these
instructions apply to versions 0.7.4 or higher.

Alternatively, check out the MDAnalysis directory from the git
repository at https://github.com/MDAnalysis/mdanalysis. In most cases
simply do ::

  git clone https://github.com/MDAnalysis/mdanalysis
  cd mdanalysis/testsuite


Installation from source
========================

In principle, installation should be as simple as unpacking the source
and executing from the top directory ::

   python setup.py install

This installs MDAnalysisTests in the system wide python directory;
this may require administrative privileges.

It is also possible to use ``--prefix``, ``--home``, or ``--user`` options for
``setup.py`` to install in a different (probably your private) python directory
hierarchy. ``python setup.py install --help`` should show you your options.

If you have problem at this stage then have a look at the operating
system specific notes at the end of this file or look in the issue
tracker --- maybe the problem is recognized and a work around can be
found in the comments


Running tests
=============

See https://github.com/MDAnalysis/mdanalysis/wiki/UnitTests for details.


From sources
------------

From the top directory of the checked out sources:

  pytest --numprocesses 4 --disable-pytest-warnings testsuite/MDAnalysisTests/ 

Use ``--numprocesses 4`` if you have 4 cores available to run in
parallel or adapt to available cores. To run tests in parallel you
will need to have *pytest-xdist>=1.18.1* installed (``pip install
pytest-xdist``).


