All checks were successful
gitea-physics/tantri/pipeline/head This commit looks good
24 lines
619 B
Python
24 lines
619 B
Python
from tantri.dipoles.supersample import get_supersample, SuperSample
|
|
|
|
|
|
def test_raw_supersample_slow():
|
|
# let's say our fluctuations are really slow
|
|
dt = 1
|
|
max_frequency = 0.0001
|
|
|
|
assert get_supersample(max_frequency, dt) == SuperSample(
|
|
super_dt=1, super_sample_ratio=1
|
|
)
|
|
|
|
|
|
def test_raw_supersample_fast():
|
|
# let's say we our fluctuations are fast
|
|
dt = 0.3
|
|
max_frequency = 10
|
|
|
|
# Our fastest oscillations will then happen every 0.1 s, so we need to drop down to something less than 0.01, so we divide by 30
|
|
|
|
assert get_supersample(max_frequency, dt) == SuperSample(
|
|
super_dt=0.01, super_sample_ratio=30
|
|
)
|