diff --git a/test/calibration_tests.py b/test/calibration_tests.py index 0e696fa115276182b4b5c1d93244ddbde48963be..1c89f79b0a5af501a998b0c5bfa3b4e3e678b724 100644 --- a/test/calibration_tests.py +++ b/test/calibration_tests.py @@ -11,6 +11,11 @@ class TestBaseClass(unittest.TestCase): def tearDown(self): del self.model + def test_repr(self): + expected = 'Recalibrate(prefix={})'.format('recalib_') + actual = repr(self.model) + self.assertEqual(expected, actual) + def test_calibration_factor(self): frequency_array = np.linspace(20, 1024, 1000) cal_factor = self.model.get_calibration_factor(frequency_array) diff --git a/tupak/gw/calibration.py b/tupak/gw/calibration.py index dc412df645f035727cc4192b5a2bc22e24d23327..2c701593fbee4968c3c58c66978201d99d75ca14 100644 --- a/tupak/gw/calibration.py +++ b/tupak/gw/calibration.py @@ -21,6 +21,9 @@ class Recalibrate(object): self.params = dict() self.prefix = prefix + def __repr__(self): + return self.__class__.__name__ + '(prefix={})'.format(self.prefix) + def get_calibration_factor(self, frequency_array, **params): """Apply calibration model