Minor style: you might as well follow the lead of the two lines above, and use ```theta %= (2 * np.pi)```.