Installation

Python 2 vs Python 3

particles is currently compatible with both Python 2 and Python 3. When Python 2 gets deprecated (around 2020) Python 2 support may be dropped.

Requirements

The short version: install The Anaconda distribution to get all the scientific computing libraries you may ever need in one go.

The long version: particles requires the following libraries:

In addition, it is strongly recommended to install the following plotting libraries:

Most of the examples require these libraries to plot results.

Again, the easiest way to install all these libraries in one go is to simply install the Anaconda distribution. Manual installation is of course also possible; e.g. on Ubuntu/Debian:

sudo apt install python-numpy python-scipy python-numba python-matplotlib python-seaborn

However, in the maintainer’s experience, conda is usually less hassle, and runs faster (because it install a more efficient version of low-level libraries such as BLAS).

Basic installation

The package is available on PyPI (the Python package index), so you may install it by running pip. On a Linux machine:

pip install --user particles

It is best to install any package from PyPI without root privilege. Option --user lets you install the package in your home directory, rather than globally for all users.

Manual/Editable installation

The package is available on Github and may be installed using git:

cd some_folder_of_your_choosing
git clone https://github.com/nchopin/particles.git
pip install -e --user .

Option -e installs the package in editable mode: i.e. it keeps files in the folder you chose, and you may edit any file directly.

Troubleshooting

If the two methods above fail, you may try this:

cd some_folder_of_your_choosing
git clone https://github.com/nchopin/particles.git
python setup.py --force

This will install the package, without compiling the little bit of Fortran code that is used in module qmc. At this stage, you may already use the package if you do not use anything related to quasi-Monte Carlo (i.e. option qmc in class SMC). In addition, you may compile manually the said piece of Fortran as follows:

pip show particles  # tells you the folder where the package is installed
cd where_particles_is_installed/particles
f2py -c ../src/LowDiscrepancy.f -m lowdiscrepancy

(Utility f2py is part of Numpy; see here.)