diff --git a/nifty5/library/adjust_variances.py b/nifty5/library/adjust_variances.py index 7cbc98c9fe7afe357404fc2384696cc79abe95e5..6089a6882af10c2fce1583ee05f56831549fdaff 100644 --- a/nifty5/library/adjust_variances.py +++ b/nifty5/library/adjust_variances.py @@ -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, diff --git a/nifty5/library/smooth_linear_amplitude.py b/nifty5/library/smooth_linear_amplitude.py index 1b525b2607bcad3da5dcb40bc6a993f3470e58bc..5421cc09b4814932f83a1b5f747c9e1e147257b4 100644 --- a/nifty5/library/smooth_linear_amplitude.py +++ b/nifty5/library/smooth_linear_amplitude.py @@ -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 ---------- diff --git a/nifty5/operators/contraction_operator.py b/nifty5/operators/contraction_operator.py index 2a2a2e557c248ad173a63b5c12933c543439de56..e790cc47945aedd31c5af4523608ced1e59d2164 100644 --- a/nifty5/operators/contraction_operator.py +++ b/nifty5/operators/contraction_operator.py @@ -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. diff --git a/nifty5/operators/endomorphic_operator.py b/nifty5/operators/endomorphic_operator.py index 16afb73749479c58fab9abe1fd52f5c32824aab9..008f94c2907888b3ac99ff43a707404a5d8e267c 100644 --- a/nifty5/operators/endomorphic_operator.py +++ b/nifty5/operators/endomorphic_operator.py @@ -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): diff --git a/nifty5/operators/linear_interpolation.py b/nifty5/operators/linear_interpolation.py index 652419b8e26ce4f42c889efd2fcca12ecdd7c3d3..b6c1b89ddb48befba65450ee39ee596d8de4d727 100644 --- a/nifty5/operators/linear_interpolation.py +++ b/nifty5/operators/linear_interpolation.py @@ -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): diff --git a/nifty5/operators/sampling_enabler.py b/nifty5/operators/sampling_enabler.py index 57327368ea201059d31bf2a5de2e32b08333502e..25d28131982d188570f0f9fab35b5588f18cf868 100644 --- a/nifty5/operators/sampling_enabler.py +++ b/nifty5/operators/sampling_enabler.py @@ -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, diff --git a/nifty5/operators/simple_linear_operators.py b/nifty5/operators/simple_linear_operators.py index c98a9c20f00035325a8d36aa13f30f77df6392a3..e5dc2e4f48a896612de04475bf8703c724aa1863 100644 --- a/nifty5/operators/simple_linear_operators.py +++ b/nifty5/operators/simple_linear_operators.py @@ -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 diff --git a/nifty5/plot.py b/nifty5/plot.py index e6d869a7145cf48804ab723369d5612f093bfa01..0856a02823347da54b9e37b043a5119711c6aec3 100644 --- a/nifty5/plot.py +++ b/nifty5/plot.py @@ -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)