Commit deee7550 authored by Philipp Arras's avatar Philipp Arras
Browse files

Docs

parent 72f8051b
...@@ -31,13 +31,13 @@ class Field(object): ...@@ -31,13 +31,13 @@ class Field(object):
Parameters Parameters
---------- ----------
domain : DomainTuple domain : DomainTuple
the domain of the new Field The domain of the new Field.
val : data_object val : data_object
This object's global shape must match the domain shape This object's global shape must match the domain shape
After construction, the object will no longer be writeable! After construction, the object will no longer be writeable!
Notes Note
----- ----
If possible, do not invoke the constructor directly, but use one of the If possible, do not invoke the constructor directly, but use one of the
many convenience functions for instantiation! many convenience functions for instantiation!
""" """
...@@ -76,14 +76,14 @@ class Field(object): ...@@ -76,14 +76,14 @@ class Field(object):
Parameters Parameters
---------- ----------
domain : Domain, tuple of Domain, or DomainTuple domain : Domain, tuple of Domain, or DomainTuple
domain of the new Field Domain of the new Field.
val : float/complex/int scalar val : float/complex/int scalar
fill value. Data type of the field is inferred from val. Fill value. Data type of the field is inferred from val.
Returns Returns
------- -------
Field Field
the newly created field The newly created Field.
""" """
if not np.isscalar(val): if not np.isscalar(val):
raise TypeError("val must be a scalar") raise TypeError("val must be a scalar")
...@@ -99,7 +99,7 @@ class Field(object): ...@@ -99,7 +99,7 @@ class Field(object):
Parameters Parameters
---------- ----------
domain : DomainTuple, tuple of Domain, or Domain domain : DomainTuple, tuple of Domain, or Domain
the domain of the new Field The domain of the new Field.
arr : numpy.ndarray arr : numpy.ndarray
The data content to be used for the new Field. The data content to be used for the new Field.
Its shape must match the shape of `domain`. Its shape must match the shape of `domain`.
...@@ -132,8 +132,9 @@ class Field(object): ...@@ -132,8 +132,9 @@ class Field(object):
Returns Returns
------- -------
numpy.ndarray : array containing all field entries, which can be numpy.ndarray
modified. Its shape is identical to `self.shape`. Array containing all field entries, which can be modified. Its
shape is identical to `self.shape`.
""" """
return dobj.to_global_data_rw(self._val) return dobj.to_global_data_rw(self._val)
...@@ -171,9 +172,9 @@ class Field(object): ...@@ -171,9 +172,9 @@ class Field(object):
random_type : 'pm1', 'normal', or 'uniform' random_type : 'pm1', 'normal', or 'uniform'
The random distribution to use. The random distribution to use.
domain : DomainTuple domain : DomainTuple
The domain of the output random field The domain of the output random Field.
dtype : type dtype : type
The datatype of the output random field The datatype of the output random Field.
Returns Returns
------- -------
...@@ -187,10 +188,10 @@ class Field(object): ...@@ -187,10 +188,10 @@ class Field(object):
@property @property
def val(self): def val(self):
"""dobj.data_object : the data object storing the field's entries """dobj.data_object : the data object storing the field's entries.
Notes Note
----- ----
This property is intended for low-level, internal use only. Do not use This property is intended for low-level, internal use only. Do not use
from outside of NIFTy's core; there should be better alternatives. from outside of NIFTy's core; there should be better alternatives.
""" """
...@@ -236,13 +237,13 @@ class Field(object): ...@@ -236,13 +237,13 @@ class Field(object):
Parameters Parameters
---------- ----------
spaces : int, tuple of int or None spaces : int, tuple of int or None
indices of the sub-domains of the field's domain to be considered. Indices of the sub-domains of the field's domain to be considered.
If `None`, the entire domain is used. If `None`, the entire domain is used.
Returns Returns
------- -------
float or None float or None
if the requested sub-domain has a uniform volume element, it is If the requested sub-domain has a uniform volume element, it is
returned. Otherwise, `None` is returned. returned. Otherwise, `None` is returned.
""" """
if np.isscalar(spaces): if np.isscalar(spaces):
...@@ -264,7 +265,7 @@ class Field(object): ...@@ -264,7 +265,7 @@ class Field(object):
Parameters Parameters
---------- ----------
spaces : int, tuple of int or None spaces : int, tuple of int or None
indices of the sub-domains of the field's domain to be considered. Indices of the sub-domains of the field's domain to be considered.
If `None`, the entire domain is used. If `None`, the entire domain is used.
Returns Returns
...@@ -331,8 +332,9 @@ class Field(object): ...@@ -331,8 +332,9 @@ class Field(object):
x : Field x : Field
Returns Returns
---------- -------
Field, defined on the product space of self.domain and x.domain Field
Defined on the product space of self.domain and x.domain.
""" """
if not isinstance(x, Field): if not isinstance(x, Field):
raise TypeError("The multiplier must be an instance of " + raise TypeError("The multiplier must be an instance of " +
......
Supports Markdown
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