Installation

Dependencies

Required dependencies

The astropy-healpix package works with Python 3.6 and later (on Linux, MacOS and Windows), and requires the following dependencies:

If you use Using pip or Using conda, these will be installed automatically.

Optional dependencies

The following packages are optional dependencies, which can be installed if needed:

  • pytest for testing

  • healpy for testing (but this is not required and the tests that require healpy will be skipped if healpy is not installed)

  • hypothesis for the healpy-related tests.

Stable version

Installing the latest stable version is possible either using pip or conda.

Using pip

To install astropy-healpix with pip from PyPI simply run:

pip install --no-deps astropy-healpix

Note

The --no-deps flag is optional, but highly recommended if you already have Numpy installed, since otherwise pip will sometimes try to “help” you by upgrading your Numpy installation, which may not always be desired.

Using conda

To install healpix with Anaconda from the conda-forge channel on anaconda.org simply run:

conda install -c conda-forge astropy-healpix

Testing installation

To check that you have this package installed and which version you’re using, start Python and execute the following code:

$ python
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:14:59)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import astropy_healpix
>>> astropy_healpix.__version__
0.1

To make sure that all functionality is working OK on your system, you can run the automated tests of this package by executing the test function:

python -c 'import astropy_healpix; astropy_healpix.test()'

Development version

Install the latest development version from https://github.com/astropy/astropy-healpix :

git clone https://github.com/astropy/astropy-healpix
cd astropy-healpix
pip install .

Contributing

This section contains some tips how to hack on astropy-healpix.

One quick way to get a Python environment with everything needed to work on astropy-healpix (code, run tests, build docs) is like this:

git clone https://github.com/astropy/astropy-healpix
cd astropy-healpix
conda env create -f environment-dev.yml
conda activate astropy-healpix

Run this command to do an in-place build and put this local version on your Python sys.path:

python setup.py develop

To run the tests, use pytest directly:

python -m pytest -v astropy_healpix

To build the docs, use this command:

python setup.py build_docs
open docs/_build/html/index.html

If you have any questions, just open an issue on Github and we’ll help.