Commit 7f7571cb authored by Philipp Arras's avatar Philipp Arras
Browse files

living -> defined

parent 09b76f3f
...@@ -123,7 +123,7 @@ Some examples are: ...@@ -123,7 +123,7 @@ Some examples are:
Consequently, NIFTy defines a class called :class:`DomainTuple` holding Consequently, NIFTy defines a class called :class:`DomainTuple` holding
a sequence of :class:`Domain` objects, which is used to specify full field a sequence of :class:`Domain` objects, which is used to specify full field
domains. In principle, a :class:`DomainTuple` can even be empty, which implies domains. In principle, a :class:`DomainTuple` can even be empty, which implies
that the field living on it is a scalar. that the field defined on it is a scalar.
A :class:`DomainTuple` supports iteration and indexing, and also provides the A :class:`DomainTuple` supports iteration and indexing, and also provides the
properties :attr:`~DomainTuple.shape`, :attr:`~DomainTuple.size` in analogy to properties :attr:`~DomainTuple.shape`, :attr:`~DomainTuple.size` in analogy to
...@@ -152,7 +152,7 @@ Fields support a wide range of arithmetic operations, either involving two ...@@ -152,7 +152,7 @@ Fields support a wide range of arithmetic operations, either involving two
fields with equal domains, or a field and a scalar. fields with equal domains, or a field and a scalar.
Contractions (like summation, integration, minimum/maximum, computation of Contractions (like summation, integration, minimum/maximum, computation of
statistical moments) can be carried out either over an entire field (producing statistical moments) can be carried out either over an entire field (producing
a scalar result) or over sub-domains (resulting in a field living on a smaller a scalar result) or over sub-domains (resulting in a field defined on a smaller
domain). Scalar products of two fields can also be computed easily. domain). Scalar products of two fields can also be computed easily.
There is also a set of convenience functions to generate fields with constant There is also a set of convenience functions to generate fields with constant
...@@ -250,7 +250,7 @@ provided by NIFTy's :class:`InversionEnabler` class, which is itself a linear ...@@ -250,7 +250,7 @@ provided by NIFTy's :class:`InversionEnabler` class, which is itself a linear
operator. operator.
Direct multiplication and adjoint inverse multiplication transform a field Direct multiplication and adjoint inverse multiplication transform a field
living on the operator's :attr:`~LinearOperator.domain` to one living on the operator's :attr:`~LinearOperator.target`, whereas adjoint multiplication defined on the operator's :attr:`~LinearOperator.domain` to one defined on the operator's :attr:`~LinearOperator.target`, whereas adjoint multiplication
and inverse multiplication transform from :attr:`~LinearOperator.target` to :attr:`~LinearOperator.domain`. and inverse multiplication transform from :attr:`~LinearOperator.target` to :attr:`~LinearOperator.domain`.
Operators with identical domain and target can be derived from Operators with identical domain and target can be derived from
...@@ -364,7 +364,7 @@ These hold the prescription how to calculate the function's ...@@ -364,7 +364,7 @@ These hold the prescription how to calculate the function's
(optionally) :attr:`~Energy.metric` at any given :attr:`~Energy.position` (optionally) :attr:`~Energy.metric` at any given :attr:`~Energy.position`
in parameter space. in parameter space.
Function values are floating-point scalars, gradients have the form of fields Function values are floating-point scalars, gradients have the form of fields
living on the energy's position domain, and metrics are represented by defined on the energy's position domain, and metrics are represented by
linear operator objects. linear operator objects.
Energies are classes that typically have to be provided by the user when Energies are classes that typically have to be provided by the user when
......
...@@ -103,7 +103,7 @@ class DomainTuple(object): ...@@ -103,7 +103,7 @@ class DomainTuple(object):
"""tuple of int: number of pixels along each axis """tuple of int: number of pixels along each axis
The shape of the array-like object required to store information The shape of the array-like object required to store information
living on the DomainTuple. defined on the DomainTuple.
""" """
return self._shape return self._shape
...@@ -112,7 +112,7 @@ class DomainTuple(object): ...@@ -112,7 +112,7 @@ class DomainTuple(object):
"""tuple of int: number of pixels along each axis on the local task """tuple of int: number of pixels along each axis on the local task
The shape of the array-like object required to store information The shape of the array-like object required to store information
living on part of the domain which is stored on the local MPI task. defined on part of the domain which is stored on the local MPI task.
""" """
from .dobj import local_shape from .dobj import local_shape
return local_shape(self._shape) return local_shape(self._shape)
......
...@@ -80,7 +80,7 @@ class Domain(NiftyMetaBase()): ...@@ -80,7 +80,7 @@ class Domain(NiftyMetaBase()):
"""tuple of int: number of pixels along each axis """tuple of int: number of pixels along each axis
The shape of the array-like object required to store information The shape of the array-like object required to store information
living on the domain. defined on the domain.
""" """
raise NotImplementedError raise NotImplementedError
...@@ -89,7 +89,7 @@ class Domain(NiftyMetaBase()): ...@@ -89,7 +89,7 @@ class Domain(NiftyMetaBase()):
"""tuple of int: number of pixels along each axis on the local task """tuple of int: number of pixels along each axis on the local task
The shape of the array-like object required to store information The shape of the array-like object required to store information
living on part of the domain which is stored on the local MPI task. defined on part of the domain which is stored on the local MPI task.
""" """
from ..dobj import local_shape from ..dobj import local_shape
return local_shape(self.shape) return local_shape(self.shape)
......
...@@ -159,7 +159,7 @@ class Field(object): ...@@ -159,7 +159,7 @@ class Field(object):
Returns Returns
------- -------
Field Field
Field living on `new_domain`, but with the same data as `self`. Field defined on `new_domain`, but with the same data as `self`.
""" """
return Field(DomainTuple.make(new_domain), self._val) return Field(DomainTuple.make(new_domain), self._val)
......
...@@ -25,11 +25,11 @@ class EnergyAdapter(Energy): ...@@ -25,11 +25,11 @@ class EnergyAdapter(Energy):
Parameters Parameters
----------- -----------
position: Field or MultiField living on the operator's input domain.
The position where the minimization process is started
op: Operator with a scalar target domain op: Operator with a scalar target domain
The expression computing the energy from the input data The expression computing the energy from the input data
constants: list of strings (default: []) constants: list of strings (default: [])
position: Field or MultiField
The position where the minimization process is started.
The component names of the operator's input domain which are assumed The component names of the operator's input domain which are assumed
to be constant during the minimization process. to be constant during the minimization process.
If the operator's input domain is not a MultiField, this must be empty. If the operator's input domain is not a MultiField, this must be empty.
......
...@@ -22,8 +22,8 @@ from .utilities import frozendict, indent ...@@ -22,8 +22,8 @@ from .utilities import frozendict, indent
class MultiDomain(object): class MultiDomain(object):
"""A tuple of domains corresponding to a direct sum. """A tuple of domains corresponding to a direct sum.
This class is the domain of the direct sum of fields living This class is the domain of the direct sum of fields defined
over (possibly different) domains. To make an instance on (possibly different) domains. To make an instance
of this class, call `MultiDomain.make(inp)`. of this class, call `MultiDomain.make(inp)`.
""" """
_domainCache = {} _domainCache = {}
......
...@@ -35,7 +35,7 @@ class ContractionOperator(LinearOperator): ...@@ -35,7 +35,7 @@ class ContractionOperator(LinearOperator):
spaces : int or tuple of int spaces : int or tuple of int
The elements of "domain" which are contracted. The elements of "domain" which are contracted.
weight : int, default=0 weight : int, default=0
if nonzero, the fields living on self.domain are weighted with the if nonzero, the fields defined on self.domain are weighted with the
specified power. specified power.
""" """
......
...@@ -148,7 +148,7 @@ class LinearOperator(Operator): ...@@ -148,7 +148,7 @@ class LinearOperator(Operator):
Parameters Parameters
---------- ----------
x : Field x : Field
The input Field, living on the Operator's domain or target, The input Field, defined on the Operator's domain or target,
depending on mode. depending on mode.
mode : int mode : int
...@@ -161,7 +161,7 @@ class LinearOperator(Operator): ...@@ -161,7 +161,7 @@ class LinearOperator(Operator):
Returns Returns
------- -------
Field Field
The processed Field living on the Operator's target or domain, The processed Field defined on the Operator's target or domain,
depending on mode. depending on mode.
""" """
raise NotImplementedError raise NotImplementedError
...@@ -183,12 +183,12 @@ class LinearOperator(Operator): ...@@ -183,12 +183,12 @@ class LinearOperator(Operator):
Parameters Parameters
---------- ----------
x : Field x : Field
The input Field, living on the Operator's domain. The input Field, defined on the Operator's domain.
Returns Returns
------- -------
Field Field
The processed Field living on the Operator's target domain. The processed Field defined on the Operator's target domain.
""" """
return self.apply(x, self.TIMES) return self.apply(x, self.TIMES)
...@@ -198,12 +198,12 @@ class LinearOperator(Operator): ...@@ -198,12 +198,12 @@ class LinearOperator(Operator):
Parameters Parameters
---------- ----------
x : Field x : Field
The input Field, living on the Operator's target domain The input Field, defined on the Operator's target domain
Returns Returns
------- -------
Field Field
The processed Field living on the Operator's domain. The processed Field defined on the Operator's domain.
""" """
return self.apply(x, self.INVERSE_TIMES) return self.apply(x, self.INVERSE_TIMES)
...@@ -213,12 +213,12 @@ class LinearOperator(Operator): ...@@ -213,12 +213,12 @@ class LinearOperator(Operator):
Parameters Parameters
---------- ----------
x : Field x : Field
The input Field, living on the Operator's target domain The input Field, defined on the Operator's target domain
Returns Returns
------- -------
Field Field
The processed Field living on the Operator's domain. The processed Field defined on the Operator's domain.
""" """
return self.apply(x, self.ADJOINT_TIMES) return self.apply(x, self.ADJOINT_TIMES)
...@@ -228,12 +228,12 @@ class LinearOperator(Operator): ...@@ -228,12 +228,12 @@ class LinearOperator(Operator):
Parameters Parameters
---------- ----------
x : Field x : Field
The input Field, living on the Operator's domain. The input Field, defined on the Operator's domain.
Returns Returns
------- -------
Field Field
The processed Field living on the Operator's target domain. The processed Field defined on the Operator's target domain.
Notes Notes
----- -----
......
...@@ -24,7 +24,7 @@ from .linear_operator import LinearOperator ...@@ -24,7 +24,7 @@ from .linear_operator import LinearOperator
# MR FIXME: this needs a redesign to avoid most _global_data() calls # MR FIXME: this needs a redesign to avoid most _global_data() calls
# Possible approach: keep everything living on `domain` distributed and only # Possible approach: keep everything defined on `domain` distributed and only
# collect the unstructured Fields. # collect the unstructured Fields.
class MaskOperator(LinearOperator): class MaskOperator(LinearOperator):
def __init__(self, mask): def __init__(self, mask):
......
...@@ -20,7 +20,7 @@ from ..utilities import NiftyMetaBase, indent ...@@ -20,7 +20,7 @@ from ..utilities import NiftyMetaBase, indent
class Operator(NiftyMetaBase()): class Operator(NiftyMetaBase()):
"""Transforms values living on one domain into values living on another """Transforms values defined on one domain into values defined on another
domain, and can also provide the Jacobian. domain, and can also provide the Jacobian.
""" """
......
...@@ -276,7 +276,7 @@ class Plot(object): ...@@ -276,7 +276,7 @@ class Plot(object):
f: Field, or list of Field objects f: Field, or list of Field objects
If `f` is a single Field, it must be defined on a single `RGSpace`, If `f` is a single Field, it must be defined on a single `RGSpace`,
`PowerSpace`, `HPSpace`, `GLSpace`. `PowerSpace`, `HPSpace`, `GLSpace`.
If it is a list, all list members must be Fields living over the If it is a list, all list members must be Fields defined over the
same one-dimensional `RGSpace` or `PowerSpace`. same one-dimensional `RGSpace` or `PowerSpace`.
title: string title: string
title of the plot title of the plot
......
...@@ -52,7 +52,7 @@ def PS_field(pspace, func): ...@@ -52,7 +52,7 @@ def PS_field(pspace, func):
Returns Returns
------- -------
Field : a field living on (pspace,) containing the computed function values Field : a field defined on (pspace,) containing the computed function values
""" """
if not isinstance(pspace, PowerSpace): if not isinstance(pspace, PowerSpace):
raise TypeError raise TypeError
...@@ -167,7 +167,7 @@ def power_analyze(field, spaces=None, binbounds=None, ...@@ -167,7 +167,7 @@ def power_analyze(field, spaces=None, binbounds=None,
def _create_power_field(domain, power_spectrum): def _create_power_field(domain, power_spectrum):
if not callable(power_spectrum): # we have a Field living on a PowerSpace if not callable(power_spectrum): # we have a Field defined on a PowerSpace
if not isinstance(power_spectrum, Field): if not isinstance(power_spectrum, Field):
raise TypeError("Field object expected") raise TypeError("Field object expected")
if len(power_spectrum.domain) != 1: if len(power_spectrum.domain) != 1:
......
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