diff --git a/src/openqlab/analysis/servo_design.py b/src/openqlab/analysis/servo_design.py index 3d590e21ec3e2dcca40baa556499788b4a8be7bf..e0b676a00295b111ec6a7c80b43c67cf1f84c5ea 100644 --- a/src/openqlab/analysis/servo_design.py +++ b/src/openqlab/analysis/servo_design.py @@ -199,7 +199,10 @@ class Integrator(Filter): @property def description(self): - return "Int {0}".format(human_readable(self.corner_frequency, "Hz")) + return "Int {0}, Slope {1}".format( + human_readable(self.corner_frequency, "Hz"), + human_readable(self.second_parameter, "Hz"), + ) @property def sF(self): @@ -234,7 +237,10 @@ class Differentiator(Filter): @property def description(self): - return "Diff {0}".format(human_readable(self.corner_frequency, "Hz")) + return "Diff {0}, Slope {1}".format( + human_readable(self.corner_frequency, "Hz"), + human_readable(self.second_parameter, "Hz"), + ) @property def sF(self): diff --git a/src/tests/test_analysis/test_servo_design/test_servo_design.py b/src/tests/test_analysis/test_servo_design/test_servo_design.py index 189d82a41ba1a8cd4761d14ede1bbbc6c38f9777..164d46dfd1088b257f03c30d413db3039477bdab 100644 --- a/src/tests/test_analysis/test_servo_design/test_servo_design.py +++ b/src/tests/test_analysis/test_servo_design/test_servo_design.py @@ -293,14 +293,14 @@ class TestServoDesign(unittest.TestCase): def test_description(self): self.sd.integrator(438) - self.assertEqual(self.sd.filters[0].description, "Int 438 Hz") + self.assertEqual(self.sd.filters[0].description, "Int 438 Hz, Slope 438 mHz") self.sd.filters[0].corner_frequency = 1200 - self.assertEqual(self.sd.filters[0].description, "Int 1.2 kHz") + self.assertEqual(self.sd.filters[0].description, "Int 1.2 kHz, Slope 438 mHz") self.sd.differentiator(438) - self.assertEqual(self.sd.filters[1].description, "Diff 438 Hz") + self.assertEqual(self.sd.filters[1].description, "Diff 438 Hz, Slope 4.38 kHz") self.sd.filters[1].corner_frequency = 1200 - self.assertEqual(self.sd.filters[1].description, "Diff 1.2 kHz") + self.assertEqual(self.sd.filters[1].description, "Diff 1.2 kHz, Slope 4.38 kHz") self.sd.lowpass(438) self.assertEqual(self.sd.filters[2].description, "LP2 438 Hz, Q=0.707") @@ -322,7 +322,7 @@ class TestServoDesign(unittest.TestCase): "gain": 1.0, "filters": [ { - "description": "Int 500 Hz", + "description": "Int 500 Hz, Slope 500 mHz", "sos": np.array( [1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0] ), @@ -392,7 +392,7 @@ class TestServoDesign(unittest.TestCase): "gain": 1.0, "filters": [ { - "description": "Int 500 Hz", + "description": "Int 500 Hz, Slope 500 mHz", "sos": np.array( [1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0] ), @@ -408,7 +408,7 @@ class TestServoDesign(unittest.TestCase): "index": 1, }, { - "description": "Int 500 Hz", + "description": "Int 500 Hz, Slope 500 mHz", "sos": np.array( [1.0156933, -0.98427528, 0.0, 1.0, -0.99996858, 0.0] ),