split node tests into standalone files

This commit is contained in:
2026-03-29 16:39:37 -07:00
parent 7983736c2e
commit c3bb34d248
53 changed files with 2625 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import numpy as np
from tests.node_tests._shared import make_field
def test_edge_detect():
from backend.nodes.edge_detect import EdgeDetect
node = EdgeDetect()
data = np.zeros((64, 64))
data[:, 32:] = 1.0
field = make_field(data=data)
for method in ["sobel", "prewitt", "laplacian", "log"]:
result, = node.process(field, method=method, sigma=1.0)
assert result.data.shape == field.data.shape
col_energy = np.abs(result.data).sum(axis=0)
peak_col = np.argmax(col_energy)
assert abs(peak_col - 32) <= 2, f"{method}: peak at col {peak_col}, expected ~32"