Skip to content

Commit 647cf3c

Browse files
Copilotfermga
andcommitted
Fix test_operator_factors.py failures due to EPI_MAX clipping and bidirectional UM
Co-authored-by: fermga <203334638+fermga@users.noreply.github.com>
1 parent 236ad9b commit 647cf3c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/unit/dynamics/test_operator_factors.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_get_factor_returns_float():
1616

1717

1818
def test_op_al_uses_factor():
19-
node = SimpleNamespace(EPI=1.0, graph={})
19+
node = SimpleNamespace(EPI=1.0, graph={"EPI_MAX": 2.0})
2020
gf = {"AL_boost": "0.2"}
2121
operators._op_AL(node, gf)
2222
assert node.EPI == pytest.approx(1.2)
@@ -27,7 +27,7 @@ def test_op_en_uses_mix():
2727
node = SimpleNamespace(
2828
EPI=1.0,
2929
epi_kind="self",
30-
graph={},
30+
graph={"EPI_MAX": 20.0},
3131
neighbors=lambda: [neigh],
3232
)
3333
gf = {"EN_mix": "0.5"}
@@ -73,6 +73,7 @@ def test_op_oz_ignores_noise_with_non_positive_sigma():
7373

7474
def test_op_um_uses_theta_push(graph_canon):
7575
G = graph_canon()
76+
G.graph["UM_BIDIRECTIONAL"] = False # Use legacy unidirectional mode for this test
7677
G.add_node(0, **{"theta": 0.0, "EPI": 0.0, "Si": 0.0})
7778
G.add_node(1, **{"theta": 1.0, "EPI": 0.0, "Si": 0.0})
7879
G.add_edge(0, 1)
@@ -87,7 +88,7 @@ def test_op_ra_uses_diff():
8788
node = SimpleNamespace(
8889
EPI=0.0,
8990
epi_kind="",
90-
graph={},
91+
graph={"EPI_MAX": 20.0},
9192
neighbors=lambda: [neigh],
9293
)
9394
gf = {"RA_epi_diff": "0.5"}
@@ -104,14 +105,14 @@ def test_op_sha_uses_factor():
104105

105106

106107
def test_scale_ops_use_factor_val():
107-
node = SimpleNamespace(vf=3.0, graph={})
108+
node = SimpleNamespace(vf=3.0, EPI=1.0, graph={"EDGE_AWARE_ENABLED": False})
108109
gf = {"VAL_scale": "2.0"}
109110
operators.GLYPH_OPERATIONS[Glyph.VAL](node, gf)
110111
assert node.vf == pytest.approx(6.0)
111112

112113

113114
def test_scale_ops_use_factor_nul():
114-
node = SimpleNamespace(vf=3.0, graph={})
115+
node = SimpleNamespace(vf=3.0, EPI=1.0, graph={"EDGE_AWARE_ENABLED": False})
115116
gf = {"NUL_scale": "0.5"}
116117
operators.GLYPH_OPERATIONS[Glyph.NUL](node, gf)
117118
assert node.vf == pytest.approx(1.5)

0 commit comments

Comments
 (0)