Installation¶
Requirements¶
pyoof has the following strict requirements:
- Python 3.5 or later.
- setuptools: Used for the package installation.
- NumPy 1.11 or later.
- SciPy: 0.15 or later.
- astropy: 1.3 or later (2.0 recommended).
- pytest 2.6 or later.
- matplotlib 1.5 or later: To provide plotting functionality.
- PyYAML 3.11 or later.
Installing pyoof¶
Using pip¶
To install pyoof with pip, simply run
pip install pyoof
Note
Use the --no-deps
flag if you already have dependency packages
installed, since otherwise pip will sometimes try to “help” you
by upgrading your installation, which may not always be desired.
Note
If you get a PermissionError
this means that you do not have the
required administrative access to install new packages to your Python
installation. In this case you may consider using the --user
option
to install the package into your home directory. You can read more
about how to do this in the pip documentation.
We recommend to use a Python distribution, such as Anaconda.
Do not install pyoof or other third-party packages using sudo
unless you are fully aware of the risks.
Installation from source¶
There are two options, if you want to build pyoof from sources. Either, you
install the tar-ball (*.tar.gz
file) from PyPI and extract it to the directory of
your choice, or, if you always want to stay up-to-date, clone the git
repository:
git clone https://github.com/tcassanelli/pyoof
Then go into the pyoof
source directory and run:
python setup.py install
Again, consider the --user
option or even better use a python distribution
such as Anaconda to avoid messing up
the system-wide Python installation.
Testing an installed pyoof¶
The easiest way to test your installed version of pyoof
is running
correctly is to use the test()
function:
import pyoof
pyoof.test()
To run the tests for one sub-package, e.g., aperture
, only:
import pyoof
pyoof.test('aperture')
The tests should run and print out any failures, which you can report at the pyoof issue tracker.
Note
This way of running the tests may not work if you do it in the
pyoof
source distribution directory.
If you prefer testing on the command line and usually work with the source code, you can also do
python setup.py test
# to run tests from a sub-package
python setup.py test -P aperture