diff git a/.gitlabci.yml b/.gitlabci.yml
index 5aa60d45b8c7a8b3e5a29fe9eb14a6442ce14340..f460180e52faf6077d8b81658866177b24b214ab 100644
 a/.gitlabci.yml
+++ b/.gitlabci.yml
@@ 39,9 +39,9 @@ test_serial:
script:
 pytest3 q cov=nifty5 test
 >
 python3 m coverage report omit "*plot*,*distributed_do*"
+ python3 m coverage report omit "*plot*,*distributed_do*"  tee coverage.txt
 >
 python3 m coverage report omit "*plot*,*distributed_do*"  grep TOTAL  awk '{ print "TOTAL: "$4; }'
+ grep TOTAL coverage.txt  awk '{ print "TOTAL: "$4; }'
test_mpi:
stage: test
@@ 51,14 +51,16 @@ test_mpi:
 mpiexec n 2 bindto none pytest3 q test
pages:
 # FIXME Build only for main branch and set stage to release
 stage: test
+ stage: release
script:
 sh docs/generate.sh
 mv docs/build/ public/
artifacts:
paths:
 public
+ only:
+  NIFTy_5
+
before_script:
 python3 setup.py install user f
diff git a/demos/getting_started_2.py b/demos/getting_started_2.py
index 3b087170a3f44e03925c692406803c1e6b9fa753..5374731bc0629c8d6f3f62fdc2491d6fae6e28b4 100644
 a/demos/getting_started_2.py
+++ b/demos/getting_started_2.py
@@ 43,22 +43,22 @@ def exposure_2d():
if __name__ == '__main__':
# FIXME All random seeds to 42
 np.random.seed(41)
+ np.random.seed(42)
# Choose space on which the signal field is defined
 mode = 2
+ mode = 1
if mode == 0:
 # Onedimensional regular grid with uniform exposure
+ # Onedimensional regular grid with uniform exposure of 10
position_space = ift.RGSpace(1024)
 exposure = ift.Field.full(position_space, 1.)
+ exposure = ift.Field.full(position_space, 10.)
elif mode == 1:
# Twodimensional regular grid with inhomogeneous exposure
position_space = ift.RGSpace([512, 512])
exposure = exposure_2d()
else:
 # Sphere with uniform exposure
+ # Sphere with uniform exposure of 100
position_space = ift.HPSpace(128)
 exposure = ift.Field.full(position_space, 1.)
+ exposure = ift.Field.full(position_space, 100.)
# Define harmonic space and harmonic transform
harmonic_space = position_space.get_default_codomain()
diff git a/demos/getting_started_3.py b/demos/getting_started_3.py
index a292f8754ef68cc43d5fbf2b4995d0964775746e..59145c408103442ef586dce07997b7b0eeb3add1 100644
 a/demos/getting_started_3.py
+++ b/demos/getting_started_3.py
@@ 17,8 +17,12 @@
############################################################
# Nonlinear tomography
# The data is integrated lines of sight
# Random lines (set mode=0), radial lines (mode=1)
+#
+# The signal is a sigmoidnormal distributed field.
+# The data is the field integrated along lines of sight that are
+# randomly (set mode=0) or radially (mode=1) distributed
+#
+# Demo takes a while to compute
#############################################################
import numpy as np
@@ 28,22 +32,22 @@ import nifty5 as ift
def random_los(n_los):
starts = list(np.random.uniform(0, 1, (n_los, 2)).T)
 ends = list(0.5 + 0*np.random.uniform(0, 1, (n_los, 2)).T)
+ ends = list(np.random.uniform(0, 1, (n_los, 2)).T)
return starts, ends
def radial_los(n_los):
starts = list(np.random.uniform(0, 1, (n_los, 2)).T)
 ends = list(np.random.uniform(0, 1, (n_los, 2)).T)
+ ends = list(0.5 + 0*np.random.uniform(0, 1, (n_los, 2)).T)
return starts, ends
if __name__ == '__main__':
 np.random.seed(420)
+ np.random.seed(420) # picked for a nice field realization
 # Choose between random lineofsight response (mode=1) and radial lines
 # of sight (mode=2)
 mode = 1
+ # Choose between random lineofsight response (mode=0) and radial lines
+ # of sight (mode=1)
+ mode = 0
position_space = ift.RGSpace([128, 128])
harmonic_space = position_space.get_default_codomain()
@@ 62,8 +66,8 @@ if __name__ == '__main__':
# Powerlaw part of spectrum:
'sm': 5, # preferred powerlaw slope
'sv': .5, # low variance of powerlaw slope
 'im': .4, # yintercept mean
 'iv': .3 # relatively high yintercept variance
+ 'im': 0, # yintercept mean, in/decrease for more/less contrast
+ 'iv': .3 # yintercept variance
}
A = ift.SLAmplitude(**dct)
@@ 79,7 +83,7 @@ if __name__ == '__main__':
signal = ift.sigmoid(correlated_field)
# Build the lineofsight response and define signal response
 LOS_starts, LOS_ends = random_los(100) if mode == 1 else radial_los(100)
+ LOS_starts, LOS_ends = random_los(100) if mode == 0 else radial_los(100)
R = ift.LOSResponse(position_space, starts=LOS_starts, ends=LOS_ends)
signal_response = R(signal)
diff git a/demos/polynomial_fit.py b/demos/polynomial_fit.py
index 68a6c677dd6baaeb8cb456da5cd219a63ee6da36..cf5f776d8f09a06878fb733e0c3428d00824dda5 100644
 a/demos/polynomial_fit.py
+++ b/demos/polynomial_fit.py
@@ 44,7 +44,8 @@ def polynomial(coefficients, sampling_points):
class PolynomialResponse(ift.LinearOperator):
 """Calculates values of a polynomial parameterized by input at sampling points.
+ """Calculates values of a polynomial parameterized by input at sampling
+ points.
Parameters

diff git a/docs/generate.sh b/docs/generate.sh
index d8da633f2962fd07c431932c16c8431378888817..4dd659fc27d33e9dd6f1c7a89a520201478512e6 100755
 a/docs/generate.sh
+++ b/docs/generate.sh
@@ 1,3 +1,3 @@
# rm rf docs/build docs/source/mod
+rm rf docs/build docs/source/mod
sphinxapidoc e o docs/source/mod nifty5
sphinxbuild b html docs/source/ docs/build/
diff git a/docs/source/code.rst b/docs/source/code.rst
index 4cc3fc5c7ccde74144d9a7ec7b356cabd0be641b..90e17c376391510238f2eac34adaf511d67e0866 100644
 a/docs/source/code.rst
+++ b/docs/source/code.rst
@@ 41,7 +41,6 @@ Abstract base class
One of the fundamental building blocks of the NIFTy5 framework is the *domain*.
Its required capabilities are expressed by the abstract :py:class:`Domain` class.
A domain must be able to answer the following queries:
m
 its total number of data entries (pixels), which is accessible via the
:attr:`~Domain.size` property
@@ 129,7 +128,7 @@ specify full field domains. In principle, a :class:`~domain_tuple.DomainTuple`
can even be empty, which implies that the field living on it is a scalar.
A :class:`~domain_tuple.DomainTuple` supports iteration and indexing, and also
provides the properties :attr:`~domain_tuple.DomainTuple.shape`,
+provides the properties :attr:`~domain_tuple.DomainTuple.shape` and
:attr:`~domain_tuple.DomainTuple.size` in analogy to the elementary
:class:`~domains.domain.Domain`.
@@ 159,10 +158,11 @@ Contractions (like summation, integration, minimum/maximum, computation of
statistical moments) can be carried out either over an entire field (producing
a scalar result) or over subdomains (resulting in a field defined on a smaller
domain). Scalar products of two fields can also be computed easily.
+See the documentation of :class:`~field.Field` for details.
There is also a set of convenience functions to generate fields with constant
values or fields filled with random numbers according to a userspecified
distribution.
+distribution: :attr:`~sugar.full`, :attr:`~sugar.from_random`.
Like almost all NIFTy objects, fields are immutable: their value or any other
attribute cannot be modified after construction. To manipulate a field in ways
@@ 311,11 +311,15 @@ and ``f1`` and ``f2`` are of type :class:`~field.Field`, writing::
will perform the operation suggested intuitively by the notation, checking
domain compatibility while building the composed operator.
The combined operator infers its domain and target from its constituents,
as well as the set of operations it can support.
The properties :attr:`~LinearOperator.adjoint` and
:attr:`~LinearOperator.inverse` return a new operator which behaves as if it
were the original operator's adjoint or inverse, respectively.
+The combined operator infers its domain and target from its constituents,
+as well as the set of operations it can support.
+Instantiating operator adjoints or inverses by :attr:`~LinearOperator.adjoint`
+and similar methods is to be distinguished from the instant application of
+operators performed by :attr:`~LinearOperator.adjoint_times` and similar
+methods.
.. _minimization:
@@ 368,8 +372,8 @@ failure.
Sensible stopping criteria can vary significantly with the problem being
solved; NIFTy provides one concrete subclass of :class:`IterationController`
called :class:`GradientNormController`, which should be appropriate in many
circumstances, but users have complete freedom to implement custom subclasses
for their specific applications.
+circumstances, but users have complete freedom to implement custom
+:class:`IterationController` subclasses for their specific applications.
Minimization algorithms
@@ 424,11 +428,13 @@ the information propagator whose inverse is defined as:
:math:`D^{1} = \left(R^\dagger N^{1} R + S^{1}\right)`.
It needs to be applied in forward direction in order to calculate the Wiener
filter solution. Only its inverse application is straightforward; to use it in
forward direction, we make use of NIFTy's
+filter solution, but only its inverse application is straightforward.
+To use it in forward direction, we make use of NIFTy's
:class:`~operators.inversion_enabler.InversionEnabler` class, which internally
performs a minimization of a
:class:`~minimization.quadratic_energy.QuadraticEnergy` by means of the
:class:`~minimization.conjugate_gradient.ConjugateGradient` algorithm. An
example is provided in
+applies the (approximate) inverse of the given operator :math:`x = Op^{1} (y)` by
+solving the equation :math:`y = Op (x)` for :math:`x`.
+This is accomplished by minimizing a suitable
+:class:`~minimization.quadratic_energy.QuadraticEnergy`
+with the :class:`~minimization.conjugate_gradient.ConjugateGradient`
+algorithm. An example is provided in
:func:`~library.wiener_filter_curvature.WienerFilterCurvature`.
diff git a/docs/source/ift.rst b/docs/source/ift.rst
index 2c5213cdc67fedd1886772377960f164abc0e35b..5238002c6a8768797f4505595a67f8bcd8fb3ef4 100644
 a/docs/source/ift.rst
+++ b/docs/source/ift.rst
@@ 4,9 +4,6 @@ IFT  Information Field Theory
Theoretical Background

Introduction
............

`Information Field Theory `_ [1]_ (IFT) is information theory, the logic of reasoning under uncertainty, applied to fields.
A field can be any quantity defined over some space, e.g. the air temperature over Europe, the magnetic field strength in the Milky Way, or the matter density in the Universe.
IFT describes how data and knowledge can be used to infer field properties.
diff git a/docs/source/index.rst b/docs/source/index.rst
index dd3df6a2bf5e28aea1dac366c9ff9a08bd29e210..6df9bd1e94a70cb8d9fb49b63410c57c6a2d1274 100644
 a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ 1,14 +1,16 @@
NIFTy  Numerical Information Field Theory
===========================================
**NIFTy** [1]_, [2]_, "\ **N**\umerical **I**\nformation **F**\ield **T**\heor\ **y**\ ", is a versatile library designed to enable the development of signal inference algorithms that are independent of the underlying spatial grid and its resolution.
+**NIFTy** [1]_, [2]_, "\ **N**\umerical **I**\nformation **F**\ield **T**\heor\ **y**\ ", is a versatile library designed to enable the development of signal inference algorithms that are independent of the underlying grids (spatial, spectral, temporal, …) and their resolutions.
Its objectoriented framework is written in Python, although it accesses libraries written in C++ and C for efficiency.
NIFTy offers a toolkit that abstracts discretized representations of continuous spaces, fields in these spaces, and operators acting on fields into classes.
Thereby, the correct normalization of operations on fields is taken care of automatically without concerning the user.
+NIFTy offers a toolkit that abstracts discretized representations of continuous spaces, fields in these spaces, and operators acting on these fields into classes.
This allows for an abstract formulation and programming of inference algorithms, including those derived within information field theory.
Thus, NIFTy permits its user to rapidly prototype algorithms in 1D and then apply the developed code in higherdimensional settings to real world problems.
+NIFTy's interface is designed to resemble IFT formulae in the sense that the user implements algorithms in NIFTy independent of the topology of the underlying spaces and the discretization scheme.
+Thus, the user can develop algorithms on subsets of problems and on spaces where the detailed performance of the algorithm can be properly evaluated and then easily generalize them to other, more complex spaces and the full problem, respectively.
+
The set of spaces on which NIFTy operates comprises point sets, *n*dimensional regular grids, spherical spaces, their harmonic counterparts, and product spaces constructed as combinations of those.
+NIFTy takes care of numerical subtleties like the normalization of operations on fields and the numerical representation of model components, allowing the user to focus on formulating the abstract inference procedures and processspecific model properties.
References

@@ 21,6 +23,7 @@ Contents
........
.. toctree::
+ :maxdepth: 2
ift
volume
diff git a/docs/source/installation.rst b/docs/source/installation.rst
index cc1206d32840c8db52d1aaabc4c3e948d712e0b9..e531b92bb376e258e6f43dbb24d24063cb873f99 100644
 a/docs/source/installation.rst
+++ b/docs/source/installation.rst
@@ 14,12 +14,13 @@ Plotting support is added via::
pip3 install user matplotlib
FFTW support is added via::
+NIFTy uses Numpy's FFT implementation by default. For large problems FFTW may be
+used because of its higher performance. It can be installed via::
sudo aptget install libfftw3dev
pip3 install user pyfftw
To actually use FFTW in your Nifty calculations, you need to call::
+To enable FFTW usage in NIFTy, call::
nifty5.fft.enable_fftw()
diff git a/nifty5/domains/domain.py b/nifty5/domains/domain.py
index de88089718d9577b700ab5cb2adc6e9cacee47cf..c5c332eda249976b0de2495ebdd3de92f0bf7951 100644
 a/nifty5/domains/domain.py
+++ b/nifty5/domains/domain.py
@@ 86,7 +86,10 @@ class Domain(metaclass=NiftyMeta):
@property
def local_shape(self):
 """tuple of int: number of pixels along each axis on the local task
+ """tuple of int: number of pixels along each axis on the local task,
+ mainly relevant for MPI.
+
+ See :meth:`.shape()` for general explanation of property.
The shape of the arraylike object required to store information
defined on part of the domain which is stored on the local MPI task.
diff git a/nifty5/domains/structured_domain.py b/nifty5/domains/structured_domain.py
index be5deb75b23ca6f7bbac1c3160da250557aacd51..491d0aa0f3368fc69b33b460a46818cd4b25aafa 100644
 a/nifty5/domains/structured_domain.py
+++ b/nifty5/domains/structured_domain.py
@@ 87,11 +87,11 @@ class StructuredDomain(Domain):
def get_fft_smoothing_kernel_function(self, sigma):
"""Helper for Gaussian smoothing.
 This method, which is only implemented for harmonic domains, helps
 smoothing fields that are defined on a domain that has this domain as
 its harmonic partner. The returned function multiplies field values of
 a field with a zero centered Gaussian which corresponds to a
 convolution with a Gaussian kernel and sigma standard deviation in
+ This method, which is only implemented for harmonic domains, helps to
+ smoothe fields that are defined on a domain that has this domain as
+ its harmonic partner. The returned function does a pointwise evaluation
+ of a zerocentered Gaussian on the field values, which corresponds to a
+ convolution with a Gaussian kernel with sigma standard deviation in
position space.
Parameters
diff git a/nifty5/extra.py b/nifty5/extra.py
index fb83ba415de4047428c3ed53648d78cf02edaa37..387b41856e02d44b9d11200d030b93d309c259e1 100644
 a/nifty5/extra.py
+++ b/nifty5/extra.py
@@ 171,4 +171,3 @@ def check_jacobian_consistency(op, loc, tol=1e8, ntries=100):
else:
raise ValueError("gradient and value seem inconsistent")
loc = locnext

diff git a/nifty5/library/light_cone_operator.py b/nifty5/library/light_cone_operator.py
index 4c28201e08d3014e400e272b50aecff200c9bb0e..c680d5f0c14086e549636a6732d1bc441b0839fe 100644
 a/nifty5/library/light_cone_operator.py
+++ b/nifty5/library/light_cone_operator.py
@@ 97,24 +97,24 @@ def _cone_arrays(c, domain, sigx, want_gradient):
class LightConeOperator(Operator):
'''Constructs a Light cone from a set of lightspeed parameters.

+
The resulting cone is defined as follows

+
.. math::
\\exp \\left( \\frac{1}{2} \\Re \\left( \\Delta \\right)^2 \\right)

+
with

+
.. math::
\\Delta = \\sqrt{ \\left(t^2  \\frac{x^\\dagger C^{1} x}
{\\sigma_x^2} \\right)}

+
where t and x are the coordinates of the target space. Note that axis zero
of the space is interpreted as the time axis. C denotes the input
paramters of the operator and parametrizes the shape of the cone.
sigx is the width of the asymptotic Gaussian in x necessary for
discretization.

+
Parameters

domain : Domain, tuple of Domain or DomainTuple
diff git a/nifty5/operators/exp_transform.py b/nifty5/operators/exp_transform.py
index 5028ee14f730732f5b00df5fca6819c7109d579b..47e0c7c97a6d629f7cd6cd05e9bb6303dd098200 100644
 a/nifty5/operators/exp_transform.py
+++ b/nifty5/operators/exp_transform.py
@@ 31,8 +31,8 @@ class ExpTransform(LinearOperator):
This operator creates a logspace subject to the degrees of freedom and
and its targetdomain.
 Then it transforms between this logspace and its target, which is defined in
 normal units.
+ Then it transforms between this logspace and its target, which is defined
+ in normal units.
FIXME Write something on t_0 of domain space
diff git a/nifty5/plot.py b/nifty5/plot.py
index 0856a02823347da54b9e37b043a5119711c6aec3..36dd1f4da569334ec627414471af940ec5dbadf2 100644
 a/nifty5/plot.py
+++ b/nifty5/plot.py
@@ 366,8 +366,14 @@ class Plot(object):
fig = plt.figure()
if "title" in kwargs:
plt.suptitle(kwargs.pop("title"))
 nx = kwargs.pop("nx", int(np.ceil(np.sqrt(nplot))))
 ny = kwargs.pop("ny", int(np.ceil(np.sqrt(nplot))))
+ nx = kwargs.pop("nx", 0)
+ ny = kwargs.pop("ny", 0)
+ if nx == ny == 0:
+ nx = ny = int(np.ceil(np.sqrt(nplot)))
+ elif nx == 0:
+ nx = np.ceil(nplot/ny)
+ elif ny == 0:
+ ny = np.ceil(nplot/nx)
if nx*ny < nplot:
raise ValueError(
'Figure dimensions not sufficient for number of plots. '