Commit 4d10b026 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

make a few more classes immutable

parent 3c9e8c4a
Pipeline #14317 passed with stage
in 5 minutes and 10 seconds
......@@ -73,7 +73,7 @@ class LinearOperator(Loggable, object):
__metaclass__ = NiftyMeta
def __init__(self, default_spaces=None):
self.default_spaces = default_spaces
self._default_spaces = default_spaces
@staticmethod
def _parse_domain(domain):
......@@ -119,10 +119,6 @@ class LinearOperator(Loggable, object):
def default_spaces(self):
return self._default_spaces
@default_spaces.setter
def default_spaces(self, spaces):
self._default_spaces = utilities.cast_axis_to_tuple(spaces)
def __call__(self, *args, **kwargs):
return self.times(*args, **kwargs)
......
......@@ -135,8 +135,8 @@ class SmoothingOperator(EndomorphicOperator):
# "space as input domain.")
self._domain = self._parse_domain(domain)
self.sigma = sigma
self.log_distances = log_distances
self._sigma = sigma
self._log_distances = log_distances
def _inverse_times(self, x, spaces):
if self.sigma == 0:
......@@ -183,18 +183,10 @@ class SmoothingOperator(EndomorphicOperator):
def sigma(self):
return self._sigma
@sigma.setter
def sigma(self, sigma):
self._sigma = np.float(sigma)
@property
def log_distances(self):
return self._log_distances
@log_distances.setter
def log_distances(self, log_distances):
self._log_distances = bool(log_distances)
@abc.abstractmethod
def _smooth(self, x, spaces, inverse):
raise NotImplementedError
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