Commit 59ec43c8 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cleanups

parent c4ffce44
Pipeline #21763 passed with stage
in 4 minutes and 39 seconds
from .field_type import FieldType
from .field_array import FieldArray
......@@ -16,11 +16,11 @@
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from .field_type import FieldType
from ..domain_object import DomainObject
from functools import reduce
class FieldArray(FieldType):
class FieldArray(DomainObject):
def __init__(self, shape):
super(FieldArray, self).__init__()
self._needed_for_hash += ["_shape"]
......@@ -39,3 +39,6 @@ class FieldArray(FieldType):
@property
def dim(self):
return reduce(lambda x, y: x*y, self.shape)
def scalar_dvol(self):
return 1.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2013-2017 Max-Planck-Society
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik
# and financially supported by the Studienstiftung des deutschen Volkes.
from ..domain_object import DomainObject
class FieldType(DomainObject):
def scalar_dvol(self):
return 1.
......@@ -33,9 +33,9 @@ class ComposedOperator(LinearOperator):
Attributes
----------
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : DomainTuple
The NIFTy.space in which the operator is defined.
target : tuple of DomainObjects, i.e. Spaces and FieldTypes
target : DomainTuple
The NIFTy.space in which the outcome of the operator lives
unitary : boolean
Indicates whether the Operator is unitary or not.
......
......@@ -37,7 +37,7 @@ class DiagonalOperator(EndomorphicOperator):
diagonal : Field
The diagonal entries of the operator
(already containing volume factors).
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : tuple of DomainObjects
The domain on which the Operator's input Field lives.
If None, use the domain of "diagonal".
spaces : tuple of int
......@@ -46,9 +46,9 @@ class DiagonalOperator(EndomorphicOperator):
Attributes
----------
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : DomainTuple
The domain on which the Operator's input Field lives.
target : tuple of DomainObjects, i.e. Spaces and FieldTypes
target : DomainTuple
The domain in which the outcome of the operator lives. As the Operator
is endomorphic this is the same as its domain.
unitary : boolean
......
......@@ -29,9 +29,9 @@ class EndomorphicOperator(LinearOperator):
Attributes
----------
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : DomainTuple
The domain on which the Operator's input Field lives.
target : tuple of DomainObjects, i.e. Spaces and FieldTypes
target : DomainTuple
The domain in which the outcome of the operator lives. As the Operator
is endomorphic this is the same as its domain.
unitary : boolean
......
......@@ -33,9 +33,9 @@ class LinearOperator(with_metaclass(
Attributes
----------
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : DomainTuple
The domain on which the Operator's input Field lives.
target : tuple of DomainObjects, i.e. Spaces and FieldTypes
target : DomainTuple
The domain in which the Operators result lives.
unitary : boolean
Indicates whether the Operator is unitary or not.
......
......@@ -16,7 +16,7 @@ class ResponseOperator(LinearOperator):
Parameters
----------
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : tuple of DomainObjects
The domains on which the operator lives. Either one space or a list
of spaces
sigma : list(np.float)
......@@ -29,9 +29,9 @@ class ResponseOperator(LinearOperator):
Attributes
----------
domain : tuple of DomainObjects, i.e. Spaces and FieldTypes
domain : DomainTuple
The domain on which the Operator's input Field lives.
target : tuple of DomainObjects, i.e. Spaces and FieldTypes
target : DomainTuple
The domain in which the outcome of the operator lives.
unitary : boolean
Indicates whether the Operator is unitary or not.
......
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