Commit b53c531b authored by Philipp Arras's avatar Philipp Arras

Unify default in docstrings

parent 0b28ae99
......@@ -38,7 +38,7 @@ class LogRGSpace(StructuredDomain):
FIXME
harmonic : bool, optional
Whether the space represents a grid in position or harmonic space.
(default: False).
Default: False.
"""
_needed_for_hash = ['_shape', '_bindistances', '_t_0', '_harmonic']
......
......@@ -31,13 +31,14 @@ class PowerSpace(StructuredDomain):
----------
harmonic_partner : StructuredDomain
The harmonic domain of which this is the power space.
binbounds : None, or tuple of float (default: None)
if None:
There will be as many bins as there are distinct k-vector lengths
in the harmonic partner space.
The `binbounds` property of the PowerSpace will also be None.
binbounds : None, or tuple of float
FIXME Add docu for binbounds
By default (binbounds=None):
There are as many bins as there are distinct k-vector lengths in
the harmonic partner space.
The `binbounds` property of the PowerSpace will be None.
else:
the bin bounds requested for this PowerSpace. The array
The bin bounds requested for this PowerSpace. The array
must be sorted and strictly ascending. The first entry is the right
boundary of the first bin, and the last entry is the left boundary
of the last bin, i.e. thee will be `len(binbounds)+1` bins in
......
......@@ -31,19 +31,16 @@ class RGSpace(StructuredDomain):
shape : int or tuple of int
Number of grid points or numbers of gridpoints along each axis.
distances : None or float or tuple of float, optional
Distance between two grid points along each axis
(default: None).
Distance between two grid points along each axis.
If distances is None:
- if harmonic==True, all distances will be set to 1
- if harmonic==False, the distance along each axis will be
By default (distances=None):
- If harmonic==True, all distances will be set to 1
- If harmonic==False, the distance along each axis will be
set to the inverse of the number of points along that axis.
harmonic : bool, optional
Whether the space represents a grid in position or harmonic space.
(default: False).
Default: False.
"""
_needed_for_hash = ["_distances", "_shape", "_harmonic"]
......
......@@ -349,14 +349,14 @@ class Field(object):
x : Field
x must be defined on the same domain as `self`.
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The dot product is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
Default: None.
Returns
-------
float, complex, either scalar (for full dot products)
or Field (for partial dot products)
float, complex, either scalar (for full dot products) or Field (for partial dot products).
"""
if not isinstance(x, Field):
raise TypeError("The dot-partner must be an instance of " +
......@@ -379,8 +379,8 @@ class Field(object):
Parameters
----------
ord : int, default=2
accepted values: 1, 2, ..., np.inf
ord : int
Accepted values: 1, 2, ..., np.inf. Default: 2.
Returns
-------
......@@ -441,9 +441,9 @@ class Field(object):
Parameters
----------
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The summation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
tuple. If None, it is carried out over all sub-domains. Default: None.
Returns
-------
......@@ -461,9 +461,10 @@ class Field(object):
Parameters
----------
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The summation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
Default: None.
Returns
-------
......@@ -484,9 +485,10 @@ class Field(object):
Parameters
----------
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The operation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
Default: None.
Returns
-------
......@@ -544,9 +546,9 @@ class Field(object):
Parameters
----------
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The operation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
tuple. If None, it is carried out over all sub-domains. Default: None.
Returns
-------
......@@ -566,9 +568,10 @@ class Field(object):
Parameters
----------
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The operation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
Default: None.
Returns
-------
......@@ -594,9 +597,10 @@ class Field(object):
Parameters
----------
spaces : None, int or tuple of int (default: None)
spaces : None, int or tuple of int
The operation is only carried out over the sub-domains in this
tuple. If None, it is carried out over all sub-domains.
Default: None.
Returns
-------
......
......@@ -125,7 +125,7 @@ class LOSResponse(LinearOperator):
The LOS response then returns the expected integral
over the input given that the length of the LOS is unknown and
therefore the result is averaged over different endpoints.
default: None
Default: None.
truncation: float (optional)
Use only if the sigmas keyword argument is used!
This truncates the probability of the endpoint lying more sigmas away
......@@ -133,7 +133,7 @@ class LOSResponse(LinearOperator):
distances. It should hold that `1./(1./length-sigma*truncation)>0`
for all lengths of the LOSs and all corresponding sigma of sigmas.
If unsure, leave blank.
default: 3.
Default: 3.
Notes
-----
......
......@@ -20,7 +20,6 @@ import numpy as np
from .field import Field
from .multi_field import MultiField
from .sugar import makeOp
from .operators.scaling_operator import ScalingOperator
class Linearization(object):
......@@ -30,15 +29,15 @@ class Linearization(object):
Parameters
----------
val : Field/MultiField
the value of the operator application
val : Field or MultiField
The value of the operator application.
jac : LinearOperator
the Jacobian
metric : LinearOperator or None (default: None)
the metric
want_metric : bool (default: False)
if True, the metric will be computed for other Linearizations derived
from this one.
The Jacobian.
metric : LinearOperator or None
The metric. Default: None.
want_metric : bool
If True, the metric will be computed for other Linearizations derived
from this one. Default: False.
"""
def __init__(self, val, jac, metric=None, want_metric=False):
self._val = val
......@@ -54,28 +53,28 @@ class Linearization(object):
Parameters
----------
val : Field/MultiField
val : Field or MultiField
the value of the operator application
jac : LinearOperator
the Jacobian
metric : LinearOperator or None (default: None)
the metric
metric : LinearOperator or None
The metric. Default: None.
"""
return Linearization(val, jac, metric, self._want_metric)
@property
def domain(self):
"""DomainTuple/MultiDomain : the Jacobian's domain"""
"""DomainTuple or MultiDomain : the Jacobian's domain"""
return self._jac.domain
@property
def target(self):
"""DomainTuple/MultiDomain : the Jacobian's target (i.e. the value's domain)"""
"""DomainTuple or MultiDomain : the Jacobian's target (i.e. the value's domain)"""
return self._jac.target
@property
def val(self):
"""Field/MultiField : the value"""
"""Field or MultiField : the value"""
return self._val
@property
......@@ -85,7 +84,7 @@ class Linearization(object):
@property
def gradient(self):
"""Field/MultiField : the gradient
"""Field or MultiField : the gradient
Notes
-----
......
......@@ -53,7 +53,7 @@ class ConjugateGradient(Minimizer):
linear conjugate gradient minimization will fail.
preconditioner : Operator *optional*
This operator can be provided which transforms the variables of the
system to improve the conditioning (default: None).
system to improve the conditioning. Default: None.
Returns
-------
......
......@@ -109,12 +109,12 @@ class Energy(NiftyMetaBase()):
"""
Parameters
----------
x: Field/MultiField
x: Field or MultiField
Argument for the metric operator
Returns
-------
Field/MultiField:
Field or MultiField:
Output of the metric operator
"""
raise NotImplementedError
......
......@@ -118,18 +118,18 @@ class LineSearch(NiftyMetaBase()):
preferred_initial_step_size : float, optional
Newton-based methods should intialize this to 1.
c1 : float
Parameter for Armijo condition rule. (Default: 1e-4)
Parameter for Armijo condition rule. Default: 1e-4.
c2 : float
Parameter for curvature condition rule. (Default: 0.9)
Parameter for curvature condition rule. Default: 0.9.
max_step_size : float
Maximum step allowed in to be made in the descent direction.
(Default: 1e30)
Default: 1e30.
max_iterations : int, optional
Maximum number of iterations performed by the line search algorithm.
(Default: 100)
Default: 100.
max_zoom_iterations : int, optional
Maximum number of iterations performed by the zoom algorithm.
(Default: 100)
Default: 100.
"""
def __init__(self, preferred_initial_step_size=None, c1=1e-4, c2=0.9,
......@@ -159,7 +159,7 @@ class LineSearch(NiftyMetaBase()):
Vector pointing into the search direction.
f_k_minus_1 : float, optional
Value of the fuction (which is being minimized) at the k-1
iteration of the line search procedure. (Default: None)
iteration of the line search procedure. Default: None.
Returns
-------
......
......@@ -29,7 +29,7 @@ class VdotOperator(LinearOperator):
Parameters
----------
field : Field/MultiField
field : Field or MultiField
The field used to build the scalar product with the operator input
"""
def __init__(self, field):
......
......@@ -273,25 +273,25 @@ class Plot(object):
Parameters
----------
f: Field, or list of Field objects
f: Field or list of Field
If `f` is a single Field, it must be defined on a single `RGSpace`,
`PowerSpace`, `HPSpace`, `GLSpace`.
If it is a list, all list members must be Fields defined over the
same one-dimensional `RGSpace` or `PowerSpace`.
title: string
title of the plot
title of the plot.
xlabel: string
label for the x axis
Label for the x axis.
ylabel: string
label for the y axis
Label for the y axis.
[xyz]min, [xyz]max: float
limits for the values to plot
Limits for the values to plot.
colormap: string
color map to use for the plot (if it is a 2D plot)
Color map to use for the plot (if it is a 2D plot).
linewidth: float or list of floats
line width
Line width.
label: string of list of strings
annotation string
Annotation string.
alpha: float or list of floats
transparency value
"""
......@@ -304,15 +304,16 @@ class Plot(object):
Parameters
----------
title: string
title of the full plot
nx, ny: integer (default: square root of the numer of plots, rounded up)
number of subplots to use in x- and y-direction
xsize, ysize: float (default: 6)
dimensions of the full plot in inches
name: string (default: "")
if left empty, the plot will be shown on the screen,
Title of the full plot.
nx, ny: int
Number of subplots to use in x- and y-direction.
Default: square root of the numer of plots, rounded up.
xsize, ysize: float
Dimensions of the full plot in inches. Default: 6.
name: string
If left empty, the plot will be shown on the screen,
otherwise it will be written to a file with the given name.
Supported extensions: .png and .pdf
Supported extensions: .png and .pdf. Default: None.
"""
import matplotlib.pyplot as plt
nplot = len(self._plots)
......
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