Wiki

Clone wiki

pygad / Installation

home - up - previous next

Quick Installation Guide

In a terminal type:

git clone https://bitbucket.org/broett/pygad
cd pygad
pip install .

If this does not work out of the box or you want to know more, continue reading.

Detailed Installation Information

Requirements

pygad needs Python 3.6+. We have a legacy Python 2 branch called legacy_python2.

Dependencies are listed in requirements.txt and will be installed automatically by pip.

In case you are new to Python or you are unsure how to get the packages, I recommend the Mamba package manager. It installs Python along with the most popular module for science, math, engineering and data analysis with little trouble, is entirely free to use, and is possible and easy to install even if you do not have admin rights (as e.g. on a HPC machine).

Get The Code & Data

Download the git repository of pygad:

git clone https://bitbucket.org/broett/pygad

Some sub-modules of pygad require Cloudy ionization tables, that are provided in the download section as iontbls.tar.gz. They will be automatically downloaded on first import, but you can also grab them yourself.

Get and unpack them:

cd pygad/pygad
wget https://bitbucket.org/broett/pygad/downloads/iontbls.tar.gz
tar -xzf iontbls.tar.gz

Pygad will automatically download the SSP models of Bruzual & Charlot (2003). These are available in the download section as a zipped tar file called bc03.tar.gz. But you can also grab them yourself.

cd pygad/pygad
wget https://bitbucket.org/broett/pygad/downloads/bc03.tar.gz
tar -xzf bc03.tar.gz

You might need to adjust the path to the models in gadget.cfg (see Configuration SSP_dir needs to be path of the unpacked directory).

Install pygad

Standard installation

To make pygad available globally you can install it. This is done by:

git clone https://bitbucket.org/broett/pygad
cd pygad
pip install .

Now pygad is importable from everywhere. Note that changes in the git repository do not affect the installed one, meaning that after a git pull within the repository, for instance, the global pygad installation is unchanged and an import pygad from outside the repository will import the non-updated pygad. To actually update this one as well, redo the installation from above.

Developers' / Frequent Updaters' Installation

If you plan to update pygad often or develop it and if you have installed there is a convenient alternative:

git clone https://bitbucket.org/broett/pygad
cd pygad
pip install -e .

This makes pygad globally available very similar to a python setup.py install, but any changes in the repository will immediately affect the global 'installation'. This implies you cannot delete the repository without breaking the installation.

Technically the following happens: the code is not copied into your side-packages folder (like with the standard installation), but only an egg-link file is created that points to the repository. For more information see here. It is useful to know that this variant comes with an --uninstall option.

Updated