I have looked at the sine wave data; it doesn't include a bunch of zeroes at the end. Here's the raw data for a single cycle at 100Hz:
>>> sine_wave(100.0, 3)
array([ 0.00000000e+00, 1.48361160e-01, 2.96359255e-01, 4.43632109e-01,
5.89819322e-01, 7.34563147e-01, 8.77509374e-01, 1.01830819e+00,
1.15661503e+00, 1.29209144e+00, 1.42440589e+00, 1.55323458e+00,
1.67826224e+00, 1.79918292e+00, 1.91570069e+00, 2.02753042e+00,
2.13439844e+00, 2.23604324e+00, 2.33221606e+00, 2.42268156e+00,
2.50721835e+00, 2.58561955e+00, 2.65769332e+00, 2.72326326e+00,
2.78216892e+00, 2.83426614e+00, 2.87942745e+00, 2.91754231e+00,
2.94851745e+00, 2.97227708e+00, 2.98876305e+00, 2.99793502e+00,
2.99977053e+00, 2.99426511e+00, 2.98143222e+00, 2.96130326e+00,
2.93392749e+00, 2.89937192e+00, 2.85772109e+00, 2.80907695e+00,
2.75355852e+00, 2.69130167e+00, 2.62245876e+00, 2.54719825e+00,
2.46570432e+00, 2.37817639e+00, 2.28482868e+00, 2.18588960e+00,
2.08160128e+00, 1.97221894e+00, 1.85801025e+00, 1.73925469e+00,
1.61624289e+00, 1.48927587e+00, 1.35866434e+00, 1.22472793e+00,
1.08779441e+00, 9.48198875e-01, 8.06282937e-01, 6.62393889e-01,
5.16883852e-01, 3.70108914e-01, 2.22428258e-01, 7.42032818e-02,
-7.42032818e-02, -2.22428258e-01, -3.70108914e-01, -5.16883852e-01,
-6.62393889e-01, -8.06282937e-01, -9.48198875e-01, -1.08779441e+00,
-1.22472793e+00, -1.35866434e+00, -1.48927587e+00, -1.61624289e+00,
-1.73925469e+00, -1.85801025e+00, -1.97221894e+00, -2.08160128e+00,
-2.18588960e+00, -2.28482868e+00, -2.37817639e+00, -2.46570432e+00,
-2.54719825e+00, -2.62245876e+00, -2.69130167e+00, -2.75355852e+00,
-2.80907695e+00, -2.85772109e+00, -2.89937192e+00, -2.93392749e+00,
-2.96130326e+00, -2.98143222e+00, -2.99426511e+00, -2.99977053e+00,
-2.99793502e+00, -2.98876305e+00, -2.97227708e+00, -2.94851745e+00,
-2.91754231e+00, -2.87942745e+00, -2.83426614e+00, -2.78216892e+00,
-2.72326326e+00, -2.65769332e+00, -2.58561955e+00, -2.50721835e+00,
-2.42268156e+00, -2.33221606e+00, -2.23604324e+00, -2.13439844e+00,
-2.02753042e+00, -1.91570069e+00, -1.79918292e+00, -1.67826224e+00,
-1.55323458e+00, -1.42440589e+00, -1.29209144e+00, -1.15661503e+00,
-1.01830819e+00, -8.77509374e-01, -7.34563147e-01, -5.89819322e-01,
-4.43632109e-01, -2.96359255e-01, -1.48361160e-01, -7.34788079e-16])
The code that starts the task is just
self.task.write(self.wave)
self.task.start()
while True:
sleep(1)
It writes the waveform data and waits forever.