Commit bab4d8c1 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'mr_cosmetics' into 'NIFTy_5'

cosmetics

See merge request ift/nifty-dev!203
parents 39a0aa47 74b271ba
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
from ..minimization.energy_adapter import EnergyAdapter from ..minimization.energy_adapter import EnergyAdapter
from ..multi_field import MultiField from ..multi_field import MultiField
from ..operators.distributors import PowerDistributor from ..operators.distributors import PowerDistributor
from ..operators.energy_operators import StandardHamiltonian, InverseGammaLikelihood from ..operators.energy_operators import (StandardHamiltonian,
InverseGammaLikelihood)
from ..operators.scaling_operator import ScalingOperator from ..operators.scaling_operator import ScalingOperator
from ..operators.simple_linear_operators import ducktape from ..operators.simple_linear_operators import ducktape
...@@ -72,7 +73,8 @@ def make_adjust_variances(a, ...@@ -72,7 +73,8 @@ def make_adjust_variances(a,
if scaling is not None: if scaling is not None:
x = ScalingOperator(scaling, x.target)(x) x = ScalingOperator(scaling, x.target)(x)
return StandardHamiltonian(InverseGammaLikelihood(d_eval/2.)(x), ic_samp=ic_samp) return StandardHamiltonian(InverseGammaLikelihood(d_eval/2.)(x),
ic_samp=ic_samp)
def do_adjust_variances(position, def do_adjust_variances(position,
......
...@@ -138,7 +138,8 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, keys=['tau', 'phi']): ...@@ -138,7 +138,8 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, keys=['tau', 'phi']):
of the linear function. of the linear function.
The prior on the smooth component is parametrized by two real numbers: the The prior on the smooth component is parametrized by two real numbers: the
strength and the cutoff of the smoothness prior (see :class:`CepstrumOperator`). strength and the cutoff of the smoothness prior
(see :class:`CepstrumOperator`).
Parameters Parameters
---------- ----------
......
...@@ -24,7 +24,8 @@ from .linear_operator import LinearOperator ...@@ -24,7 +24,8 @@ from .linear_operator import LinearOperator
class ContractionOperator(LinearOperator): class ContractionOperator(LinearOperator):
"""A :class:`LinearOperator` which sums up fields into the direction of subspaces. """A :class:`LinearOperator` which sums up fields into the direction of
subspaces.
This Operator sums up a field with is defined on a :class:`DomainTuple` This Operator sums up a field with is defined on a :class:`DomainTuple`
to a :class:`DomainTuple` which contains the former as a subset. to a :class:`DomainTuple` which contains the former as a subset.
......
...@@ -21,8 +21,8 @@ from .linear_operator import LinearOperator ...@@ -21,8 +21,8 @@ from .linear_operator import LinearOperator
class EndomorphicOperator(LinearOperator): class EndomorphicOperator(LinearOperator):
"""Represents a :class:`LinearOperator` which is endomorphic, i.e. one which """Represents a :class:`LinearOperator` which is endomorphic, i.e. one
has identical domain and target. which has identical domain and target.
""" """
@property @property
def target(self): def target(self):
......
...@@ -53,9 +53,8 @@ class LinearInterpolator(LinearOperator): ...@@ -53,9 +53,8 @@ class LinearInterpolator(LinearOperator):
# FIXME This needs to be removed as soon as the bug below is fixed. # FIXME This needs to be removed as soon as the bug below is fixed.
if dims.count(dims[0]) != len(dims): if dims.count(dims[0]) != len(dims):
raise TypeError( raise TypeError("This is a bug. Please extend"
'This is a bug. Please extend LinearInterpolators functionality!' "LinearInterpolator's functionality!")
)
shp = sampling_points.shape shp = sampling_points.shape
if not (isinstance(sampling_points, np.ndarray) and len(shp) == 2): if not (isinstance(sampling_points, np.ndarray) and len(shp) == 2):
......
...@@ -38,10 +38,10 @@ class SamplingEnabler(EndomorphicOperator): ...@@ -38,10 +38,10 @@ class SamplingEnabler(EndomorphicOperator):
The iteration controller to use for the iterative numerical inversion The iteration controller to use for the iterative numerical inversion
done by a :class:`ConjugateGradient` object. done by a :class:`ConjugateGradient` object.
approximation : :class:`LinearOperator`, optional approximation : :class:`LinearOperator`, optional
if not None, this linear operator should be an approximation to the operator, which if not None, this linear operator should be an approximation to the
supports the operation modes that the operator doesn't have. It is used as a operator, which supports the operation modes that the operator doesn't
preconditioner during the iterative inversion, to accelerate have. It is used as a preconditioner during the iterative inversion,
convergence. to accelerate convergence.
""" """
def __init__(self, likelihood, prior, iteration_controller, def __init__(self, likelihood, prior, iteration_controller,
......
...@@ -187,7 +187,7 @@ class GeometryRemover(LinearOperator): ...@@ -187,7 +187,7 @@ class GeometryRemover(LinearOperator):
domain: Domain, tuple of Domain, or DomainTuple: domain: Domain, tuple of Domain, or DomainTuple:
the full input domain of the operator. the full input domain of the operator.
space: int, optional space: int, optional
The index of the subdomain on which the operator should act. Default is None. The index of the subdomain on which the operator should act.
If None, it acts on all spaces. If None, it acts on all spaces.
Notes Notes
......
...@@ -290,8 +290,8 @@ def _plot(f, ax, **kwargs): ...@@ -290,8 +290,8 @@ def _plot(f, ax, **kwargs):
if not isinstance(f[0], Field): if not isinstance(f[0], Field):
raise TypeError("incorrect data type") raise TypeError("incorrect data type")
dom1 = f[0].domain dom1 = f[0].domain
if (len(dom1)==1 and if (len(dom1) == 1 and
(isinstance(dom1[0],PowerSpace) or (isinstance(dom1[0], PowerSpace) or
(isinstance(dom1[0], (RGSpace, LogRGSpace)) and (isinstance(dom1[0], (RGSpace, LogRGSpace)) and
len(dom1[0].shape) == 1))): len(dom1[0].shape) == 1))):
_plot1D(f, ax, **kwargs) _plot1D(f, ax, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment