19 lines
656 B
Python
19 lines
656 B
Python
import pytest
|
|
|
|
from regime import CONDITIONS, run
|
|
|
|
|
|
@pytest.mark.parametrize("name", sorted(CONDITIONS))
|
|
def test_every_condition_runs(name):
|
|
res = run(name, seed=0, steps=300, window=5, bptt=10)
|
|
assert len(res["recovery"]) == 5
|
|
assert res["steady"] >= 0.0
|
|
assert res["n_switches"] >= 1
|
|
|
|
|
|
def test_rp_only_has_no_memory_and_zero_kappa():
|
|
assert CONDITIONS["rp_only"]["memory"] is False
|
|
assert CONDITIONS["grp_k0"]["kappa"] == 0.0
|
|
assert CONDITIONS["grp_flag"]["kappa"] == 0.0 and CONDITIONS["grp_flag"]["oracle"] == "change"
|
|
assert CONDITIONS["grp_regime"]["kappa"] == 0.0 and CONDITIONS["grp_regime"]["oracle"] == "regime"
|