Installation
You can install dysmalpy
in a number of ways:
Pip install: The quickest and simplest way to install
dysmalpy
is from the pypi repository using pip. This will install the latest stable version and its dependencies.Using anaconda: Installing
dysmalpy
using the Anaconda Python distribution.2.1 Using pip to install the dependencies (default)
2.2 Using conda to install the dependencies
Developement version: If you are more familiar with Python, you can install
dysmalpy
using the development version.MPE group installations: If you are a member of the MPE group, you can install
dysmalpy
using the provided.bat
file or by using the Anaconda environment we have setup.
1. Pip install
To install the latest stable version of dysmalpy
and its dependencies, you can use pip.
Warning
Please note that the C++ extensions are not included in the pypi package and you will need to install them separately. You can find the instructions on how to install them (and test if they can be built) in the Python Environment Setup section.
Once you have installed the extensions, you can install dysmalpy
using pip:
python -m pip install dysmalpy
2. Using Anaconda
To install Anaconda and all the relevant packages and dependencies, please follow the instructions at Python Environment Setup.
After (and only after) your anaconda installation is complete. You can download the latest dysmalpy
package here: tar.gz | zip
(current version: 2.0.0).
From a terminal, change directories to where the package was downloaded, decompress it and navigate inside the directory with:
tar zxvf dysmalpy-N.N.N.tar.gz
cd dysmalpy-N.N.N
(Where N.N.N is the current version)
Note
You can also clone the repository from GitHub with (make sure you have git installed with e.g. conda install git
):
git clone https://github.com/dysmalpy/dysmalpy.git
Now, you can install dysmalpy
and its dependencies in one of the following ways:
2.1 Using pip to install the dependencies (default)
You can use pip to install dysmalpy (and its corresponding dependencies):
python -m pip install .
Alternatively, you can use the following command:
python setup.py install --single-version-externally-managed --root=/
Note
If you would like to specify your specific include
and library
paths you can set them by defining the
C_INCLUDE_PATH
and LD_LIBRARY_PATH
environment variables like this:
export C_INCLUDE_PATH=/your/include/path
export LD_LIBRARY_PATH=/your/lib/path
then you can run the usual installation command.
2.2 Using conda to install the dependencies
If you have chosen to install the python dependencies with conda (following the steps at Python Environment Setup), please use the following command:
python -m pip install . --no-deps
Note
The --no-deps
flag will prevent pip from installing the dependencies that you have already installed with conda in (Python Environment Setup).
3. Development version
To get the most up-to-date development version of dysmalpy
, clone the repository from GitHub.
Within your desired parent directory, clone the repository from GitHub:
git clone https://github.com/dysmalpy/dysmalpy.git
Then add the path to this repository to your python path (e.g.,
PATH/TO/PARENT/DIRECTORY/dysmalpy
to $PYTHONPATH
as defined in
.bashrc or .bash_profile for bash, or the equivalent for your shell).
In order to compile the C++ extensions locally please run:
python setup.py build_ext --inplace
For examples on using git fetch
or git pull
to get updates,
or how to check out other branches, please see e.g. the tutorial here:
https://git-scm.com/docs/gittutorial
Warning
This way of installing dysmalpy
will give you a basic installation with most of the functionality,
but your dysmalpy
installation will not contain the other modules that you may need.
After the installation is complete, you should
be able to run import dysmalpy
within IPython or your Jupyter notebook.
Tip
Especially if working with the development version of dysmalpy
, you can
confirm the location of the package that is imported by checking
the output of
import dysmalpy
print(dysmalpy.__file__)
4. MPE group installations
Windows bat
File
A bat
file, for running DysmalPy with a parameters file (e.g., fitting.params
)
is available for MPE-group specific architecture.
Prior to using DysmalPy with this bat
file, the DysmalPy source code
and dependencies will need to be installed (see Using Anaconda).
AFS Machine
If you are on an AFS machine, dysmalpy
is located at
/afs/mpe.mpg.de/astrosoft/dysmalpy
. We have further setup
an Anaconda environment the contains all of the necessary
Python packages to run dysmalpy
. To activate this environment
as well as set environment variables, run this command in your
terminal:
source /afs/mpe/astrosoft/dysmalpy/dysmalpy_setup.sh
To check whether the setup ran successfully run:
which python
This should return /afs/mpe.mpg.de/astrosoft/dysmalpy/anaconda3/bin/python
.
Keep in mind that using this environment will override any environment
you have setup locally and only Python packages installed in the
dysmalpy
environment will be available. If there is a package you
would like installed in the environment, please contact the maintainers at dysmalpy@mpe.mpg.de.
For those who are more familiar with Python, you can simply add
/afs/mpe.mpg.de/astrosoft/dysmalpy/dysmalpy/
to your PYTHONPATH
environment variable. Be sure to have all of the required packages
installed.