Commit 5debd56f authored by Philipp Arras's avatar Philipp Arras

Remove remaining assert statements

parent a198e78a
......@@ -129,11 +129,13 @@ class Energy(NiftyMetaBase()):
return None
def __add__(self, other):
assert isinstance(other, Energy)
if not isinstance(other, Energy):
raise TypeError
return Add(self, other)
def __sub__(self, other):
assert isinstance(other, Energy)
if not isinstance(other, Energy):
raise TypeError
return Add(self, (-1) * other)
......
......@@ -48,7 +48,8 @@ class MultiSkyGradientOperator(LinearOperator):
# Needed if gradients == {}
if res is None:
res = full(self.target, 0.)
assert res.domain == self.target
if not res.domain == self.target:
raise TypeError
else:
grad_keys = self._gradients.keys()
res = {}
......@@ -58,5 +59,6 @@ class MultiSkyGradientOperator(LinearOperator):
else:
res[dd] = full(self.domain[dd], 0.)
res = MultiField(res)
assert res.domain == self.domain
if not res.domain == self.domain:
raise TypeError
return res
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