Commit 911a5f88 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more sanity checks

parent 388a50b4
...@@ -3,6 +3,7 @@ from builtins import range ...@@ -3,6 +3,7 @@ from builtins import range
import numpy as np import numpy as np
from .endomorphic_operator import EndomorphicOperator from .endomorphic_operator import EndomorphicOperator
from ..spaces import PowerSpace
from .. import nifty_utilities as utilities from .. import nifty_utilities as utilities
from .. import Field, DomainTuple from .. import Field, DomainTuple
...@@ -20,6 +21,8 @@ class DirectSmoothingOperator(EndomorphicOperator): ...@@ -20,6 +21,8 @@ class DirectSmoothingOperator(EndomorphicOperator):
space = int(space) space = int(space)
if (space<0) or space>=len(self._domain.domains): if (space<0) or space>=len(self._domain.domains):
raise ValueError("space index out of range") raise ValueError("space index out of range")
if not isinstance(self._domain[space],PowerSpace):
raise TypeError("PowerSpace needed")
self._space = space self._space = space
self._sigma = float(sigma) self._sigma = float(sigma)
......
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