Commit 9aa58afa authored by Jait Dixit's avatar Jait Dixit

Enable coverage report

parent cd593c77
Pipeline #9668 failed with stage
in 28 minutes and 54 seconds
...@@ -15,3 +15,4 @@ ...@@ -15,3 +15,4 @@
build build
.idea .idea
.coverage
...@@ -64,7 +64,11 @@ test_mpi_fftw_hdf5: ...@@ -64,7 +64,11 @@ test_mpi_fftw_hdf5:
- ci/install_libsharp.sh - ci/install_libsharp.sh
- ci/install_pyfftw.sh - ci/install_pyfftw.sh
- python setup.py build_ext --inplace - python setup.py build_ext --inplace
- nosetests -vv - >
nosetests -vv --with-coverage --cover-package=nifty --cover-inclusive
--cover-branches
- >
coverage report | grep TOTAL | awk '{ print "TOTAL: "$6; }'
release_image_master: release_image_master:
image: docker:latest image: docker:latest
......
NIFTY - Numerical Information Field Theory NIFTY - Numerical Information Field Theory
========================================== ==========================================
[![build status](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/master/build.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/master)
[![coverage report](https://gitlab.mpcdf.mpg.de/ift/NIFTy/badges/master/coverage.svg)](https://gitlab.mpcdf.mpg.de/ift/NIFTy/commits/master)
**NIFTY** project homepage: `<http://www.mpa-garching.mpg.de/ift/nifty/>`_ **NIFTY** project homepage:
[http://www.mpa-garching.mpg.de/ift/nifty/](http://www.mpa-garching.mpg.de/ift/nifty/)
Summary Summary
------- -------
Description ### Description
...........
**NIFTY**, "**N**umerical **I**nformation **F**ield **T**heor**y**", is
**NIFTY**, "\ **N**\umerical **I**\nformation **F**\ield **T**\heor\ **y**\ ", a versatile library designed to enable the development of signal
is a versatile library designed to enable the development of signal inference inference algorithms that operate regardless of the underlying spatial
algorithms that operate regardless of the underlying spatial grid and its grid and its resolution. Its object-oriented framework is written in
resolution. Its object-oriented framework is written in Python, although it Python, although it accesses libraries written in Cython, C++, and C for
accesses libraries written in Cython, C++, and C for efficiency. efficiency.
NIFTY offers a toolkit that abstracts discretized representations of continuous NIFTY offers a toolkit that abstracts discretized representations of
spaces, fields in these spaces, and operators acting on fields into classes. continuous spaces, fields in these spaces, and operators acting on
Thereby, the correct normalization of operations on fields is taken care of fields into classes. Thereby, the correct normalization of operations on
automatically without concerning the user. This allows for an abstract fields is taken care of automatically without concerning the user. This
formulation and programming of inference algorithms, including those derived allows for an abstract formulation and programming of inference
within information field theory. Thus, NIFTY permits its user to rapidly algorithms, including those derived within information field theory.
prototype algorithms in 1D, and then apply the developed code in Thus, NIFTY permits its user to rapidly prototype algorithms in 1D, and
higher-dimensional settings of real world problems. The set of spaces on which then apply the developed code in higher-dimensional settings of real
NIFTY operates comprises point sets, *n*-dimensional regular grids, spherical world problems. The set of spaces on which NIFTY operates comprises
spaces, their harmonic counterparts, and product spaces constructed as point sets, *n*-dimensional regular grids, spherical spaces, their
combinations of those. harmonic counterparts, and product spaces constructed as combinations of
those.
Class & Feature Overview
........................ ### Class & Feature Overview
The NIFTY library features three main classes: **spaces** that represent The NIFTY library features three main classes: **spaces** that represent
certain grids, **fields** that are defined on spaces, and **operators** that certain grids, **fields** that are defined on spaces, and **operators**
apply to fields. that apply to fields.
* `Spaces <http://www.mpa-garching.mpg.de/ift/nifty/space.html>`_ - [Spaces](http://www.mpa-garching.mpg.de/ift/nifty/space.html)
- `point_space` - unstructured list of points
* ``point_space`` - unstructured list of points - `rg_space` - *n*-dimensional regular Euclidean grid
* ``rg_space`` - *n*-dimensional regular Euclidean grid - `lm_space` - spherical harmonics
* ``lm_space`` - spherical harmonics - `gl_space` - Gauss-Legendre grid on the 2-sphere
* ``gl_space`` - Gauss-Legendre grid on the 2-sphere - `hp_space` - [HEALPix](http://sourceforge.net/projects/healpix/)
* ``hp_space`` - `HEALPix <http://sourceforge.net/projects/healpix/>`_
grid on the 2-sphere grid on the 2-sphere
* ``nested_space`` - arbitrary product of grids - `nested_space` - arbitrary product of grids
- [Fields](http://www.mpa-garching.mpg.de/ift/nifty/field.html)
* `Fields <http://www.mpa-garching.mpg.de/ift/nifty/field.html>`_ - `field` - generic class for (discretized) fields
* ``field`` - generic class for (discretized) fields <!-- -->
::
field.cast_domain field.hat field.power field.smooth field.cast_domain field.hat field.power field.smooth
field.conjugate field.inverse_hat field.pseudo_dot field.tensor_dot field.conjugate field.inverse_hat field.pseudo_dot field.tensor_dot
field.dim field.norm field.set_target field.transform field.dim field.norm field.set_target field.transform
field.dot field.plot field.set_val field.weight field.dot field.plot field.set_val field.weight
* `Operators <http://www.mpa-garching.mpg.de/ift/nifty/operator.html>`_ - [Operators](http://www.mpa-garching.mpg.de/ift/nifty/operator.html)
- `diagonal_operator` - purely diagonal matrices in a specified
* ``diagonal_operator`` - purely diagonal matrices in a specified basis basis
* ``projection_operator`` - projections onto subsets of a specified basis - `projection_operator` - projections onto subsets of a specified
* ``vecvec_operator`` - matrices derived from the outer product of a basis
- `vecvec_operator` - matrices derived from the outer product of a
vector vector
* ``response_operator`` - exemplary responses that include a convolution, - `response_operator` - exemplary responses that include a
masking and projection convolution, masking and projection
* ``propagator_operator`` - information propagator in Wiener filter theory - `propagator_operator` - information propagator in Wiener filter
* ``explicit_operator`` - linear operators with an explicit matrix theory
- `explicit_operator` - linear operators with an explicit matrix
representation representation
* (and more) - (and more)
- (and more)
* (and more) *Parts of this summary are taken from* [1] *without marking them
explicitly as quotations.*
*Parts of this summary are taken from* [1]_ *without marking them explicitly as
quotations.*
Installation Installation
------------ ------------
Requirements ### Requirements
............
* `Python <http://www.python.org/>`_ (v2.7.x)
* `NumPy <http://www.numpy.org/>`_ - [Python](http://www.python.org/) (v2.7.x)
* `SciPy <http://www.scipy.org/>`_ - [NumPy](http://www.numpy.org/)
* `Cython <http://cython.org/>`_ - [SciPy](http://www.scipy.org/)
* `matplotlib <http://matplotlib.org/>`_ - [Cython](http://cython.org/)
- [matplotlib](http://matplotlib.org/)
* `GFFT <https://github.com/mrbell/gfft>`_ (v0.1.0) - Generalized Fast - [GFFT](https://github.com/mrbell/gfft) (v0.1.0) - Generalized Fast
Fourier Transformations for Python - **optional** Fourier Transformations for Python - **optional**
- [HEALPy](https://github.com/healpy/healpy) (v1.8.1 without openmp) -
A Python wrapper for
[HEALPix](http://sourceforge.net/projects/healpix/) -**optional,
only needed for spherical spaces**
- [libsharp-wrapper](https://github.com/mselig/libsharp-wrapper)
(v0.1.2 without openmp) - A Python wrapper for the
[libsharp](http://sourceforge.net/projects/libsharp/) library
-**optional, only needed for spherical spaces**
* `HEALPy <https://github.com/healpy/healpy>`_ (v1.8.1 without openmp) - A ### Download
Python wrapper for `HEALPix <http://sourceforge.net/projects/healpix/>`_ -
**optional, only needed for spherical spaces**
* `libsharp-wrapper <https://github.com/mselig/libsharp-wrapper>`_ (v0.1.2
without openmp) - A Python wrapper for the
`libsharp <http://sourceforge.net/projects/libsharp/>`_ library -
**optional, only needed for spherical spaces**
Download The latest release is tagged **v1.0.7** and is available as a source
........ package at [](https://gitlab.mpcdf.mpg.de/ift/NIFTy/tags). The current
version can be obtained by cloning the repository:
The latest release is tagged **v1.0.7** and is available as a source package
at `<https://gitlab.mpcdf.mpg.de/ift/NIFTy/tags>`_. The current
version can be obtained by cloning the repository::
git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
Installation on Ubuntu ### Installation on Ubuntu
......................
This is for you if you want to install NIFTy on your personal computer
running with an Ubuntu-like linux system were you have root priviledges.
Starting with a fresh Ubuntu installation move to a folder like
`~/Downloads`:
This is for you if you want to install NIFTy on your personal computer running - Install basic packages like python, python-dev, gsl and others:
with an Ubuntu-like linux system were you have root priviledges. Starting with
a fresh Ubuntu installation move to a folder like ``~/Downloads``:
* Install basic packages like python, python-dev, gsl and others::
sudo apt-get install curl git autoconf sudo apt-get install curl git autoconf
sudo apt-get install python-dev python-pip gsl-bin libgsl0-dev libfreetype6-dev libpng-dev libatlas-base-dev gfortran sudo apt-get install python-dev python-pip gsl-bin libgsl0-dev libfreetype6-dev libpng-dev libatlas-base-dev gfortran
* Install matplotlib:: - Install matplotlib:
sudo apt-get install python-matplotlib sudo apt-get install python-matplotlib
* Using pip install numpy, scipy, etc...:: - Using pip install numpy, scipy, etc...:
sudo pip install numpy scipy cython pyfits healpy sudo pip install numpy scipy cython pyfits healpy
* Now install the 'non-standard' dependencies. First of all gfft:: - Now install the 'non-standard' dependencies. First of all gfft:
curl -LOk https://github.com/mrbell/gfft/tarball/master curl -LOk https://github.com/mrbell/gfft/tarball/master
tar -xzf master tar -xzf master
...@@ -135,7 +131,7 @@ a fresh Ubuntu installation move to a folder like ``~/Downloads``: ...@@ -135,7 +131,7 @@ a fresh Ubuntu installation move to a folder like ``~/Downloads``:
sudo python setup.py install sudo python setup.py install
cd .. cd ..
* Libsharp:: - Libsharp:
git clone http://git.code.sf.net/p/libsharp/code libsharp-code git clone http://git.code.sf.net/p/libsharp/code libsharp-code
cd libsharp-code cd libsharp-code
...@@ -144,7 +140,7 @@ a fresh Ubuntu installation move to a folder like ``~/Downloads``: ...@@ -144,7 +140,7 @@ a fresh Ubuntu installation move to a folder like ``~/Downloads``:
sudo make sudo make
cd .. cd ..
* Libsharpwrapper:: - Libsharpwrapper:
git clone http://github.com/mselig/libsharp-wrapper.git libsharp-wrapper git clone http://github.com/mselig/libsharp-wrapper.git libsharp-wrapper
cd libsharp-wrapper cd libsharp-wrapper
...@@ -152,50 +148,57 @@ a fresh Ubuntu installation move to a folder like ``~/Downloads``: ...@@ -152,50 +148,57 @@ a fresh Ubuntu installation move to a folder like ``~/Downloads``:
sudo python setup.py install sudo python setup.py install
cd .. cd ..
* Finally, NIFTy:: - Finally, NIFTy:
git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
cd nifty cd nifty
sudo python setup.py install sudo python setup.py install
cd .. cd ..
Installation on a linux cluster ### Installation on a linux cluster
...............................
This is for you if you want to install NIFTy on a HPC machine or cluster that is hosted by your university or institute. Most of the dependencies will most likely already be there, but you won't have superuser priviledges. In this case, instead:: This is for you if you want to install NIFTy on a HPC machine or cluster
that is hosted by your university or institute. Most of the dependencies
will most likely already be there, but you won't have superuser
priviledges. In this case, instead:
sudo python setup.py install sudo python setup.py install
use:: use:
python setup.py install --user python setup.py install --user
or:: or:
python setup.py install --install-lib=/SOMEWHERE python setup.py install --install-lib=/SOMEWHERE
in the instruction above. This will install the python packages into
your local user directory.
in the instruction above. This will install the python packages into your local user directory. ### Installation on OS X 10.11
Installation on OS X 10.11 We advice to install the following packages in the order as they appear
.......................... below. We strongly recommend to install all needed packages via
MacPorts. Please be aware that not all packages are available on
MacPorts, missing ones need to be installed manually. It may also be
mentioned that one should only use one package manager, as multiple ones
may cause trouble.
We advice to install the following packages in the order as they appear below. We strongly recommend to install all needed packages via MacPorts. Please be aware that not all packages are available on MacPorts, missing ones need to be installed manually. It may also be mentioned that one should only use one package manager, as multiple ones may cause trouble. - Install basic packages python, scipy, matplotlib and cython:
* Install basic packages python, scipy, matplotlib and cython:: sudo port install py27-numpy
sudo port install py27-scipy
sudo port install py27-matplotlib
sudo port install py27-cython
sudo port install py27-numpy - Install gfft. **Depending where you installed GSL you may need to
sudo port install py27-scipy change the path in setup.py!**:
sudo port install py27-matplotlib
sudo port install py27-cython
* Install gfft. **Depending where you installed GSL you may need to change the path in setup.py!**::
sudo port install gsl sudo port install gsl
git clone https://github.com/mrbell/gfft.git}{https://github.com/mrbell/gfft.git git clone https://github.com/mrbell/gfft.git}{https://github.com/mrbell/gfft.git
sudo python setup.py install sudo python setup.py install
* Install healpy:: - Install healpy:
sudo port install py27-pyfits sudo port install py27-pyfits
git clone https://github.com/healpy/healpy.git git clone https://github.com/healpy/healpy.git
...@@ -203,37 +206,37 @@ We advice to install the following packages in the order as they appear below. W ...@@ -203,37 +206,37 @@ We advice to install the following packages in the order as they appear below. W
sudo python setup.py install sudo python setup.py install
cd .. cd ..
* Install libsharp and therefore autoconf, automake and libtool. - Install libsharp and therefore autoconf, automake and libtool.
Installations instructions for libsharp may be found here: Installations instructions for libsharp may be found here:
https://sourceforge.net/p/libsharp/code/ci/master/tree/:: <https://sourceforge.net/p/libsharp/code/ci/master/tree/>:
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
tar -xzf autoconf-2.69.tar.gz tar -xzf autoconf-2.69.tar.gz
cd autoconf-2.69 cd autoconf-2.69
./configure && make && sudo make install ./configure && make && sudo make install
cd .. cd ..
curl -OL http://ftpmirror.gnu.org/automake/automake-1.14.tar.gz curl -OL http://ftpmirror.gnu.org/automake/automake-1.14.tar.gz
tar -xzf automake-1.14.tar.gz tar -xzf automake-1.14.tar.gz
cd automake-1.14 cd automake-1.14
./configure && make && sudo make install ./configure && make && sudo make install
cd .. cd ..
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2 cd libtool-2.4.2
./configure && make && sudo make install ./configure && make && sudo make install
cd .. cd ..
git clone http://git.code.sf.net/p/libsharp/code libsharp-code git clone http://git.code.sf.net/p/libsharp/code libsharp-code
cd libsharp-code cd libsharp-code
sudo autoconf sudo autoconf
./configure --enable-pic --disable-openmp ./configure --enable-pic --disable-openmp
sudo make sudo make
cd .. cd ..
* Install libsharp-wrapper. - Install libsharp-wrapper. **Adopt the path of the libsharp
**Adopt the path of the libsharp installation in setup.py** :: installation in setup.py** :
sudo port install gcc sudo port install gcc
sudo port select gcc mp-gcc5 sudo port select gcc mp-gcc5
...@@ -242,60 +245,56 @@ We advice to install the following packages in the order as they appear below. W ...@@ -242,60 +245,56 @@ We advice to install the following packages in the order as they appear below. W
sudo python setup.py install sudo python setup.py install
cd .. cd ..
* Install NIFTy:: - Install NIFTy:
git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git git clone https://gitlab.mpcdf.mpg.de/ift/NIFTy.git
cd nifty cd nifty
sudo python setup.py install sudo python setup.py install
cd .. cd ..
Installation using pypi ### Installation using pypi
.......................
NIFTY can be installed using `PyPI <https://pypi.python.org/pypi>`_ and **pip** NIFTY can be installed using [PyPI](https://pypi.python.org/pypi) and
by running the following command:: **pip** by running the following command:
pip install ift_nifty pip install ift_nifty
Alternatively, a private or user specific installation can be done by:: Alternatively, a private or user specific installation can be done by:
pip install --user ift_nifty pip install --user ift_nifty
### First Steps
First Steps For a quickstart, you can browse through the [informal
........... introduction](http://www.mpa-garching.mpg.de/ift/nifty/start.html) or
dive into NIFTY by running one of the demonstrations, e.g.:
For a quickstart, you can browse through the >>> run -m nifty.demos.demo_wf1
`informal introduction <http://www.mpa-garching.mpg.de/ift/nifty/start.html>`_
or dive into NIFTY by running one of the demonstrations, e.g.::
>>> run -m nifty.demos.demo_wf1
Acknowledgement Acknowledgement
--------------- ---------------
Please, acknowledge the use of NIFTY in your publication(s) by using a phrase Please, acknowledge the use of NIFTY in your publication(s) by using a
such as the following: phrase such as the following:
*"Some of the results in this publication have been derived using the NIFTY
package [Selig et al., 2013]."*
References > *"Some of the results in this publication have been derived using the
.......... > NIFTY package [Selig et al., 2013]."*
.. [1] Selig et al., "NIFTY - Numerical Information Field Theory - a ### References
versatile Python library for signal inference",
`A&A, vol. 554, id. A26 <http://dx.doi.org/10.1051/0004-6361/201321236>`_,
2013; `arXiv:1301.4499 <http://www.arxiv.org/abs/1301.4499>`_
Release Notes Release Notes
------------- -------------
The NIFTY package is licensed under the The NIFTY package is licensed under the
`GPLv3 <http://www.gnu.org/licenses/gpl.html>`_ and is distributed *without any [GPLv3](http://www.gnu.org/licenses/gpl.html) and is distributed
warranty*. *without any warranty*.
---- * * * * *
**NIFTY** project homepage: `<http://www.mpa-garching.mpg.de/ift/nifty/>`_ **NIFTY** project homepage:
[](http://www.mpa-garching.mpg.de/ift/nifty/)
[1] Selig et al., "NIFTY - Numerical Information Field Theory - a
versatile Python library for signal inference", [A&A, vol. 554, id.
A26](http://dx.doi.org/10.1051/0004-6361/201321236), 2013;
[arXiv:1301.4499](http://www.arxiv.org/abs/1301.4499)
...@@ -3,6 +3,7 @@ scipy ...@@ -3,6 +3,7 @@ scipy
cython cython
nose nose
nose-parameterized nose-parameterized
coverage
git+https://gitlab.mpcdf.mpg.de/ift/mpi_dummy.git git+https://gitlab.mpcdf.mpg.de/ift/mpi_dummy.git
git+https://gitlab.mpcdf.mpg.de/ift/keepers.git git+https://gitlab.mpcdf.mpg.de/ift/keepers.git
git+https://gitlab.mpcdf.mpg.de/ift/D2O.git git+https://gitlab.mpcdf.mpg.de/ift/D2O.git
...@@ -55,7 +55,7 @@ from spaces import * ...@@ -55,7 +55,7 @@ from spaces import *
from operators import * from operators import *
from probing import * #from probing import *
from sugar import * from sugar import *
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from prober import Prober
from diagonal_prober import * from diagonal_prober import *
from trace_prober import * from trace_prober import *
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from prober import Prober # from prober import Prober
#
#
class DiagonalProber(Prober): # class DiagonalProber(Prober):
#
# ---Mandatory properties and methods--- # # ---Mandatory properties and methods---
def finish_probe(self, probe, pre_result): # def finish_probe(self, probe, pre_result):
return probe[1].conjugate()*pre_result # return probe[1].conjugate()*pre_result
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from prober import Prober # from prober import Prober
#
#
class TraceProber(Prober): # class TraceProber(Prober):