Commit 3281b022 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

rework

parent c6c62ad6
......@@ -24,24 +24,24 @@ from ..utilities import frozendict
class MultiDomain(object):
_domainCache = {}
"""A tuple of domains corresponding to a direct sum.
def __init__(self, dict, _callingfrommake=False):
"""A tuple of domains corresponding to a direct sum.
This class is the domain of the direct sum of fields living
over (possibly different) domains. To make an instance
of this class call MultiDomain.make(inp)
This class is the domain of the direct sum of fields living
over (possibly different) domains. To make an instance
of this class call .make(inp)
Parameters
----------
inp : MultiDomain or tuple(DomainTuple)
The already built MultiDomain or a tuple of DomainTuples
Parameters
----------
inp : MultiDomain or tuple(DomainTuple)
The already built MultiDomain or a tuple of DomainTuples
Returns
------
A MultiDomain with the input Domains as domains
"""
_domainCache = {}
Returns
------
A MutliDomain with the input Domains as domains
"""
def __init__(self, dict, _callingfrommake=False):
if not _callingfrommake:
raise NotImplementedError(
'To create a MultiDomain call `MultiDomain.make()`.')
......@@ -51,6 +51,17 @@ class MultiDomain(object):
@staticmethod
def make(inp):
"""Creates a MultiDomain object from a dictionary of names and domains
Parameters
----------
inp : MultiDomain or dict{name: DomainTuple}
The already built MultiDomain or a dictionary of DomainTuples
Returns
------
A MultiDomain with the input Domains as domains
"""
if isinstance(inp, MultiDomain):
return inp
if not isinstance(inp, dict):
......
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