Skip to content

Commit

Permalink
MAINT: improve __init__ docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
adler-j committed Jul 11, 2016
1 parent 3f064d3 commit 806ef49
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions odl/discr/diff_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PartialDerivative(PointwiseTensorFieldOperator):

def __init__(self, space, axis=0, method='forward', padding_method=None,
padding_value=0, edge_order=None):
"""Initialize an operator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -188,7 +188,7 @@ class Gradient(PointwiseTensorFieldOperator):

def __init__(self, domain=None, range=None, method='forward',
padding_method='constant', padding_value=0):
"""Initialize a `Gradient` operator instance.
"""Initialize a new instance.
Zero padding is assumed for the adjoint of the `Gradient`
operator to match negative `Divergence` operator.
Expand Down Expand Up @@ -369,7 +369,7 @@ class Divergence(PointwiseTensorFieldOperator):

def __init__(self, domain=None, range=None, method='forward',
padding_method='constant', padding_value=0):
"""Initialize a `Divergence` operator instance.
"""Initialize a new instance.
Zero padding is assumed for the adjoint of the `Divergence`
operator to match the negative `Gradient` operator.
Expand Down Expand Up @@ -545,7 +545,7 @@ class Laplacian(PointwiseTensorFieldOperator):
"""

def __init__(self, space, padding_method='constant', padding_value=0):
"""Initialize a `Laplacian` operator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion odl/discr/discr_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Resampling(Operator):
"""

def __init__(self, domain, range):
"""Initialize a Resampling.
"""Initialize a new instance.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion odl/discr/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class TensorGrid(Set):
"""

def __init__(self, *coord_vectors):
"""Initialize a TensorGrid instance.
"""Initialize a new instance.
Parameters
----------
Expand Down
16 changes: 8 additions & 8 deletions odl/operator/default_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ScalingOperator(Operator):
"""Operator of multiplication with a scalar."""

def __init__(self, space, scalar):
"""Initialize a ScalingOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -136,7 +136,7 @@ class ZeroOperator(ScalingOperator):
"""Operator mapping each element to the zero element."""

def __init__(self, space):
"""Initialize a ZeroOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand All @@ -159,7 +159,7 @@ class IdentityOperator(ScalingOperator):
"""Operator mapping each element to itself."""

def __init__(self, space):
"""Initialize an IdentityOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -187,7 +187,7 @@ class LinCombOperator(Operator):
"""

def __init__(self, space, a, b):
"""Initialize a LinCombOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -260,7 +260,7 @@ class MultiplyOperator(Operator):
"""

def __init__(self, y, domain=None, range=None):
"""Initialize a MultiplyOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -385,7 +385,7 @@ class PowerOperator(Operator):
"""

def __init__(self, domain, exponent):
"""Initialize a PowerOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -495,7 +495,7 @@ class InnerProductOperator(Operator):
"""

def __init__(self, vector):
"""Initialize a InnerProductOperator instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -587,7 +587,7 @@ class ConstantOperator(Operator):
"""

def __init__(self, vector, domain=None):
"""Initialize an instance.
"""Initialize a new instance.
Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions odl/operator/pspace_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class ComponentProjection(Operator):
"""

def __init__(self, space, index):
"""Initialize an instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -903,7 +903,7 @@ class DiagonalOperator(ProductSpaceOperator):
"""

def __init__(self, *operators, **kwargs):
"""Initialize a DiagonalOperator.
"""Initialize a new instance.
Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions odl/set/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LinearSpace(Set):
"""

def __init__(self, field):
"""Initialize a LinearSpace.
"""Initialize a new instance.
This method should be called by all inheriting methods so that the
field property of the space is set properly.
Expand Down Expand Up @@ -815,7 +815,7 @@ class UniversalSpace(LinearSpace):
"""

def __init__(self):
"""Initialize a universal space."""
"""Initialize a new instance."""
LinearSpace.__init__(self, field=UniversalSet())

def element(self, inp=None):
Expand Down
10 changes: 5 additions & 5 deletions odl/solvers/advanced/proximal_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class ProxOpBoxConstraint(Operator):
"""Proximal operator for G(x) = ind(a <= x <= b)."""

def __init__(self, tau):
"""Initialize the proximal operator.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -632,7 +632,7 @@ class ProximalL2(Operator):
"""Proximal operator of the l2-norm/distance."""

def __init__(self, sigma):
"""Initialize the proximal operator.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -721,7 +721,7 @@ class ProximalCConjL2Squared(Operator):
"""Proximal operator of the convex conj of the squared l2-norm/dist."""

def __init__(self, sigma):
"""Initialize the proximal operator.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -867,7 +867,7 @@ class ProximalCConjL1(Operator):
"""Proximal operator of the convex conj of the l1-norm/distance."""

def __init__(self, sigma):
"""Initialize the proximal operator.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -1037,7 +1037,7 @@ class ProximalCConjKL(Operator):
"""Proximal operator of the convex conjugate of the KL divergence."""

def __init__(self, sigma):
"""Initialize the proximal operator.
"""Initialize a new instance.
Parameters
----------
Expand Down
12 changes: 6 additions & 6 deletions odl/solvers/util/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class _CallbackAnd(SolverCallback):
"""Callback used for combining several callbacks."""

def __init__(self, *callbacks):
"""Initialize an instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -116,7 +116,7 @@ class CallbackStore(SolverCallback):
"""

def __init__(self, results=None, function=None):
"""Initialize an instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -189,7 +189,7 @@ class CallbackApply(SolverCallback):
"""Simple object for applying a function to each iterate."""

def __init__(self, function):
"""Initialize an instance.
"""Initialize a new instance.
Parameters
----------
Expand Down Expand Up @@ -219,7 +219,7 @@ class CallbackPrintIteration(SolverCallback):
_default_text = 'iter ='

def __init__(self, text=None):
"""Initialize an instance.
"""Initialize a new instance.
Parameters
----------
Expand All @@ -245,7 +245,7 @@ class CallbackPrintTiming(SolverCallback):
"""Print the time elapsed since the previous iteration."""

def __init__(self):
"""Initialize an instance."""
"""Initialize a new instance."""
self.time = time.time()

def __call__(self, _):
Expand All @@ -264,7 +264,7 @@ class CallbackPrintNorm(SolverCallback):
"""Print the current norm."""

def __init__(self):
"""Initialize an instance."""
"""Initialize a new instance."""
self.iter = 0

def __call__(self, result):
Expand Down

0 comments on commit 806ef49

Please sign in to comment.