Static method with `self` as first argument
@@ -151,7 +151,7 @@ class InterpolationScale:
return self._scale(values)
def inverse(self, values):
- values = self._inverse(self, values)
+ values = self._inverse(values)
if hasattr(self, "_unit"):
return u.Quantity(values, self._unit, copy=False)
else:
@@ -167,10 +167,10 @@ class LogScale(InterpolationScale):
values = np.clip(values, self.tiny, np.inf)
return np.log(values)
- @staticmethod
- def _inverse(self, values):
+ @classmethod
+ def _inverse(cls, values):
output = np.exp(values)
- return np.where(abs(output) - self.tiny <= self.tiny, 0, output)
+ return np.where(abs(output) - cls.tiny <= cls.tiny, 0, output)
class SqrtScale(InterpolationScale):
@@ -181,8 +181,8 @@ class SqrtScale(InterpolationScale):
sign = np.sign(values)
return sign * np.sqrt(sign * values)
- @staticmethod
- def _inverse(self, values):
+ @classmethod
+ def _inverse(cls, values):
return np.power(values, 2)
@@ -197,8 +197,8 @@ class StatProfileScale(InterpolationScale):
sign = np.sign(values)
return sign * np.sqrt(sign * values)
- @staticmethod
- def _inverse(self, values):
+ @classmethod
+ def _inverse(cls, values):
return np.power(values, 2)
@@ -209,8 +209,8 @@ class LinearScale(InterpolationScale):
def _scale(values):
return values
- @staticmethod
- def _inverse(self, values):
+ @classmethod
+ def _inverse(cls, values):
return values
