Installation

Instructions

From the online svn repository

These steps are to be followed if you want to install the latest version.

First get a local copy of VDAT, you can checkout the repository with:

svn checkout svn://luna.mpe.mpg.de/vdat/trunk vdat

Similarly you can check out any branch. Now you can install with:

pip install /path/to/vdat

or:

cd /path/to/vdat
pip install .

It’s also possible to install vdat directly from the svn repository without checking it out:

pip install svn+svn://luna.mpe.mpg.de/vdat/trunk#egg=vdat

If necessary replace trunk with the desired tag or branch to checkout and install.

Dependances

Mandatory dependences

pyhetdex>=0.12
astropy
colorama
numpy
six
peewee
ginga
pyyaml
qimage2ndarray>=1.5.1
qtpy >= 1.1

Qt bindings

Starting with version 0.9.0, VDAT makes use of the qtpy abstraction layer to communicate with the Qt instead of using directly some of the available python bindings. This allows the user to decide which version of Qt to use and which binding you use. qtpy automatically detects which Qt binding to use and defaults to PyQt5 if multiple are present. It is possible to select a specific binding using the QT_API environment variable; see here for more details.

Available bindings and current status:

  • PyQt4, Qt4 bindings: fully supported. Unfortunately PyQt4 cannot be installed using pip; also SIP library one of his dependences, cannot be installed with pip for python < 3.5. To our knowledge it is possible to obtain PyQt4 in one of the following ways:

    • If you feel brave you can try to install them by hand following e.g. these instructions
    • use a package manager; most, if not all, Linux distributions, as well as Mac packet managers like homebrew and macports, provide PyQt4
    • use tools like the anaconda distribution or the conda package manager
  • PyQt5, Qt5 bindings: fully supported. PyQt5 provides wheels for 32- and 64-bit Windows, 64-bit macOS and 64-bit Linux under python v3.5 or later. Thus it is possible to install Qt5 bindings using:

    pip install pyqt5
    

    PyQt5 is also available in anaconda/conda

  • PySide, Qt4 bindings: not supported. We were not able to run unit test for PySide because of problems with the underlying C/C++ library (see issue #2607). Attempts to run VDAT directly with PySide cause errors (issue #2598 and issue #2606). PySide can be installed using pip (see A note on PySide if there are problems).

  • PySide2, Qt5 bindings: not supported. It is not yet supported by some dependences (issue #2597). PySide2 can be installed using pip:

    pip install --index-url=http://download.qt.io/snapshots/ci/pyside/5.11/latest/ pyside2 --trusted-host download.qt.io
    

Optional dependences

pyds9

pyds9 allows to communicate between python and DS9 and is use to send fits and region files from VDAT to DS9. If the package is not installed, VDAT works.

You can install pyds9 together with the rest of VDAT with:

pip install vdat[ds9]

or alone with:

pip install pyds9

ltl and cure

cure is a C++ code that provides utilities that are executed in subprocesses by most of the VDAT commands and depends on ltl. However VDAT doesn’t depend on cure.

Detailed information on how to install ltl and cure can be found here. Here we report the basic steps for completeness.

Check out and compile ltl:

cd /path/to/project
svn checkout svn://luna.mpe.mpg.de/ltl/trunk ltl
cd ltl
./bootstrap
./configure
make
cd ..

Check out and compile cure:

svn checkout svn://luna.mpe.mpg.de/cure/trunk cure
cd cure
make install

This will install the binaries into bin directory. If you don’t have OpenGL libraries installed, run:

make install HAVE_OPENGL=no

as last step. You can use make -j N to speed up the build process using N cores.

After it is installed, you might want to:

export CUREBIN=/path/to/project/cure/bin

Python dependences

  • testing:

    pytest>=3.3
    pytest-qt>=2.0
    pytest-cov
    pytest-xdist
    coverage
    
    tox  # for automatizing the tests
    
  • documentation:

    sphinx
    numpydoc
    alabaster
    pyhetdex
    
  • automatic documentation build:

    sphinx-autobuild => 0.5.2
    

Development

If you develop pyhetdex and/or vdat we suggest you checkout both svn repositories and install them in “editable” mode . We also recommend installing all of the optional dependances:

cd /path/to/vdat
pip install -e .

It is possible to also install the pyhetdex software in editable mode adding -e in the requirements.txt file before the url or path, e.g.:

~> cat requirements.txt
-e /path/to/pyhetdex

and adding the options -r requirements.txt in the pip call.

See Contribute to VDAT for more information.

Notes and problems

  • It is possible to change the version to install from svn by selecting a specific commit:

    pip install svn+svn://luna.mpe.mpg.de/vdat/trunk@5#egg=vhc
    

    or a different branch/tag:

    pip install svn+svn://luna.mpe.mpg.de/vdat/tag/v0.0.0#egg=vhc
    
  • If the installation gets interrupted with an error like:

    ImportError: No module named 'numpy'
    

    run pip install numpy and then retry vdat installation