tantri/tests/dipoles/test_dipoles.py
Deepak Mallubhotla 7bde246a21
Some checks failed
gitea-physics/tantri/pipeline/head There was a failure building this commit
feat: adds initial implementation of time series generation
2024-04-20 13:52:40 -05:00

15 lines
506 B
Python
Executable File

from tantri.dipoles import Dipole, DipoleTimeSeries
import numpy
def test_dipoles_1(snapshot):
d1 = Dipole(numpy.array([0, 0, 10]), numpy.array([5, 3, 2]), 15)
d2 = Dipole(numpy.array([0, 0, 10]), numpy.array([-2, 3, 2]), 0.1)
d3 = Dipole(numpy.array([0, 0, 10]), numpy.array([2, 1, 2]), 6)
d4 = Dipole(numpy.array([0, 0, 10]), numpy.array([-5, -5, 2]), 50)
ts_gen = DipoleTimeSeries([d1, d2, d3, d4], 0.001)
time_series = [ts_gen.transition() for i in range(20)]
assert time_series == snapshot