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

Type checks in Slope Operator

parent c561b6fe
......@@ -17,17 +17,24 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from __future__ import absolute_import, division, print_function
from ..compat import *
import numpy as np
from ..compat import *
from ..domain_tuple import DomainTuple
from ..domains.log_rg_space import LogRGSpace
from ..domains.unstructured_domain import UnstructuredDomain
from ..field import Field
from .linear_operator import LinearOperator
class SlopeOperator(LinearOperator):
def __init__(self, domain, target, sigmas):
# MR FIXME: check explicitly for the required domain types etc.
# Maybe compute domain from target automatically?
if not isinstance(target, LogRGSpace):
raise TypeError
if not (isinstance(domain, UnstructuredDomain) and domain.shape == (2,)):
raise TypeError
self._domain = DomainTuple.make(domain)
self._target = DomainTuple.make(target)
......
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