How do I comment the code I wrote for a course I am lecturing in?
I think the Linux kernel is a good standard.

In general, don't explain what are you doing, that should be obvious from the code. Do tell why you are doing it. Let me show an example:

data_padded = pad_with_zeroes(data, 2**ceil(log2(len(data))))
fft(data_padded)


Everybody can see that I am padding it with zeroes, and any engineer student should see I am doing it to the next power of two (modulo bugs). But they may not be aware why are you doing it: a comment should point out that a FFT is fastest when the input length is a power of two.

Also, since this is a very technical setting, add the full names of the algorithms, with alternative names if they are common, and at least a reference using the same definition as you are. Tracking down factors of 2 π can be a pain.