def test_remove_pulse_clear(self): # Remove pulses using clear pulse_sequence = PulseSequence() pulse = DCPulse(name='dc', amplitude=1.5, duration=10, t_start=0) pulse_sequence.add(pulse) pulse_sequence.clear() self.assertEqual(len(pulse_sequence.pulses), 0)
def test_pulse_sequence_bool(self): pulse_sequence = PulseSequence() self.assertFalse(pulse_sequence) pulse_sequence.add(Pulse(duration=5)) self.assertTrue(pulse_sequence) pulse_sequence.clear() self.assertFalse(pulse_sequence)
def test_t_list(self): pulse_sequence = PulseSequence() self.assertEqual(pulse_sequence.t_list, [0]) self.assertEqual(pulse_sequence.t_start_list, []) self.assertEqual(pulse_sequence.t_stop_list, []) pulse_sequence.add(Pulse(t_start=1, duration=5)) self.assertEqual(pulse_sequence.t_list, [1, 6]) self.assertEqual(pulse_sequence.t_start_list, [1]) self.assertEqual(pulse_sequence.t_stop_list, [6]) pulse_sequence.clear() self.assertEqual(pulse_sequence.t_list, [0]) self.assertEqual(pulse_sequence.t_start_list, []) self.assertEqual(pulse_sequence.t_stop_list, [])
def test_pulse_sequence_duration(self): pulse_sequence = PulseSequence() pulse_sequence.duration self.assertEqual(pulse_sequence.duration, 0) pulse_sequence.duration = None self.assertEqual(pulse_sequence.duration, 0) pulse_sequence.duration = 1 self.assertEqual(pulse_sequence.duration, 1) pulse_sequence.add(DCPulse(duration=5)) self.assertEqual(pulse_sequence.duration, 5) pulse_sequence.clear() self.assertEqual(pulse_sequence.duration, 0)