Commit 74b271ba authored by Martin Reinecke's avatar Martin Reinecke

cosmetics

parent 39a0aa47
......@@ -18,7 +18,8 @@
from ..minimization.energy_adapter import EnergyAdapter
from ..multi_field import MultiField
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.simple_linear_operators import ducktape
......@@ -72,7 +73,8 @@ def make_adjust_variances(a,
if scaling is not None:
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,
......
......@@ -138,7 +138,8 @@ def SLAmplitude(*, target, n_pix, a, k0, sm, sv, im, iv, keys=['tau', 'phi']):
of the linear function.
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
----------
......
......@@ -24,7 +24,8 @@ from .linear_operator import 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`
to a :class:`DomainTuple` which contains the former as a subset.
......
......@@ -21,8 +21,8 @@ from .linear_operator import LinearOperator
class EndomorphicOperator(LinearOperator):
"""Represents a :class:`LinearOperator` which is endomorphic, i.e. one which
has identical domain and target.
"""Represents a :class:`LinearOperator` which is endomorphic, i.e. one
which has identical domain and target.
"""
@property
def target(self):
......
......@@ -53,9 +53,8 @@ class LinearInterpolator(LinearOperator):
# FIXME This needs to be removed as soon as the bug below is fixed.
if dims.count(dims[0]) != len(dims):
raise TypeError(
'This is a bug. Please extend LinearInterpolators functionality!'
)
raise TypeError("This is a bug. Please extend"
"LinearInterpolator's functionality!")
shp = sampling_points.shape
if not (isinstance(sampling_points, np.ndarray) and len(shp) == 2):
......
......@@ -38,10 +38,10 @@ class SamplingEnabler(EndomorphicOperator):
The iteration controller to use for the iterative numerical inversion
done by a :class:`ConjugateGradient` object.
approximation : :class:`LinearOperator`, optional
if not None, this linear operator should be an approximation to the operator, which
supports the operation modes that the operator doesn't have. It is used as a
preconditioner during the iterative inversion, to accelerate
convergence.
if not None, this linear operator should be an approximation to the
operator, which supports the operation modes that the operator doesn't
have. It is used as a preconditioner during the iterative inversion,
to accelerate convergence.
"""
def __init__(self, likelihood, prior, iteration_controller,
......
......@@ -187,7 +187,7 @@ class GeometryRemover(LinearOperator):
domain: Domain, tuple of Domain, or DomainTuple:
the full input domain of the operator.
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.
Notes
......
......@@ -290,8 +290,8 @@ def _plot(f, ax, **kwargs):
if not isinstance(f[0], Field):
raise TypeError("incorrect data type")
dom1 = f[0].domain
if (len(dom1)==1 and
(isinstance(dom1[0],PowerSpace) or
if (len(dom1) == 1 and
(isinstance(dom1[0], PowerSpace) or
(isinstance(dom1[0], (RGSpace, LogRGSpace)) and
len(dom1[0].shape) == 1))):
_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