| 1 |
.. include:: references.txt |
| 2 |
|
| 3 |
.. doctest-skip-all |
| 4 |
|
| 5 |
.. _install: |
| 6 |
|
| 7 |
************ |
| 8 |
Installation |
| 9 |
************ |
| 10 |
|
| 11 |
Dependencies |
| 12 |
============ |
| 13 |
|
| 14 |
Required dependencies |
| 15 |
--------------------- |
| 16 |
|
| 17 |
The **astropy-healpix** package works with Python 3.7 and later (on Linux, MacOS |
| 18 |
and Windows), and requires the following dependencies: |
| 19 |
|
| 20 |
* `Numpy <http://www.numpy.org>`__ 1.11 or later |
| 21 |
* `Astropy <http://www.astropy.org>`__ 2.0 or later |
| 22 |
|
| 23 |
If you use :ref:`pip` or :ref:`conda`, these will be installed automatically. |
| 24 |
|
| 25 |
Optional dependencies |
| 26 |
--------------------- |
| 27 |
|
| 28 |
The following packages are optional dependencies, which can be installed if needed: |
| 29 |
|
| 30 |
* `pytest <http://www.pytest.org>`__ for testing |
| 31 |
* `healpy <https://healpy.readthedocs.io>`__ for testing (but this is not required |
| 32 |
and the tests that require healpy will be skipped if healpy is not installed) |
| 33 |
* `hypothesis <https://hypothesis.readthedocs.io>`__ for the healpy-related tests. |
| 34 |
|
| 35 |
Stable version |
| 36 |
============== |
| 37 |
|
| 38 |
Installing the latest stable version is possible either using pip or conda. |
| 39 |
|
| 40 |
.. _pip: |
| 41 |
|
| 42 |
Using pip |
| 43 |
--------- |
| 44 |
|
| 45 |
To install **astropy-healpix** with `pip <http://www.pip-installer.org/en/latest/>`__ |
| 46 |
from `PyPI <https://pypi.python.org/pypi/astropy-healpix>`__ |
| 47 |
simply run:: |
| 48 |
|
| 49 |
pip install --no-deps astropy-healpix |
| 50 |
|
| 51 |
.. note:: |
| 52 |
|
| 53 |
The ``--no-deps`` flag is optional, but highly recommended if you already |
| 54 |
have Numpy installed, since otherwise pip will sometimes try to "help" you |
| 55 |
by upgrading your Numpy installation, which may not always be desired. |
| 56 |
|
| 57 |
.. _conda: |
| 58 |
|
| 59 |
Using conda |
| 60 |
----------- |
| 61 |
|
| 62 |
To install healpix with `Anaconda <https://www.anaconda.com/download>`_ |
| 63 |
from the `conda-forge channel on anaconda.org <https://anaconda.org/conda-forge/astropy-healpix>`__ |
| 64 |
simply run:: |
| 65 |
|
| 66 |
conda install -c conda-forge astropy-healpix |
| 67 |
|
| 68 |
Testing installation |
| 69 |
-------------------- |
| 70 |
|
| 71 |
To check that you have this package installed and which version you're using, |
| 72 |
start Python and execute the following code: |
| 73 |
|
| 74 |
.. code-block:: bash |
| 75 |
|
| 76 |
$ python |
| 77 |
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:14:59) |
| 78 |
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin |
| 79 |
Type "help", "copyright", "credits" or "license" for more information. |
| 80 |
>>> import astropy_healpix |
| 81 |
>>> astropy_healpix.__version__ |
| 82 |
0.1 |
| 83 |
|
| 84 |
To make sure that all functionality is working OK on your system, you can |
| 85 |
run the automated tests of this package by executing the ``test`` function: |
| 86 |
|
| 87 |
.. code-block:: bash |
| 88 |
|
| 89 |
python -c 'import astropy_healpix; astropy_healpix.test()' |
| 90 |
|
| 91 |
Development version |
| 92 |
=================== |
| 93 |
|
| 94 |
Install the latest development version from https://github.com/astropy/astropy-healpix : |
| 95 |
|
| 96 |
.. code-block:: bash |
| 97 |
|
| 98 |
git clone https://github.com/astropy/astropy-healpix |
| 99 |
cd astropy-healpix |
| 100 |
pip install . |
| 101 |
|
| 102 |
Contributing |
| 103 |
============ |
| 104 |
|
| 105 |
This section contains some tips how to hack on **astropy-healpix**. |
| 106 |
|
| 107 |
One quick way to get a Python environment with everything needed to |
| 108 |
work on ``astropy-healpix`` (code, run tests, build docs) is like this: |
| 109 |
|
| 110 |
.. code-block:: bash |
| 111 |
|
| 112 |
git clone https://github.com/astropy/astropy-healpix |
| 113 |
cd astropy-healpix |
| 114 |
conda env create -f environment-dev.yml |
| 115 |
conda activate astropy-healpix |
| 116 |
|
| 117 |
Run this command to do an in-place build and put this local version on |
| 118 |
your Python ``sys.path``:: |
| 119 |
|
| 120 |
python setup.py develop |
| 121 |
|
| 122 |
To run the tests, use ``pytest`` directly: |
| 123 |
|
| 124 |
python -m pytest -v astropy_healpix |
| 125 |
|
| 126 |
To build the docs, use this command:: |
| 127 |
|
| 128 |
python setup.py build_docs |
| 129 |
open docs/_build/html/index.html |
| 130 |
|
| 131 |
If you have any questions, just open an issue on Github and we'll help. |