fix tests
This commit is contained in:
@@ -46,15 +46,13 @@ MENU_LAYOUT: dict[str, list[str]] = {
|
|||||||
"GaussianFilter",
|
"GaussianFilter",
|
||||||
"MedianFilter",
|
"MedianFilter",
|
||||||
"EdgeDetect",
|
"EdgeDetect",
|
||||||
"FFTFilter1D",
|
"FFTFilter",
|
||||||
"FFTFilter2D",
|
|
||||||
"ScarRemoval",
|
"ScarRemoval",
|
||||||
],
|
],
|
||||||
"Spectral": [
|
"Spectral": [
|
||||||
"FFT2D",
|
"FFT2D",
|
||||||
"FFT2DInverse",
|
"FFT2DInverse",
|
||||||
"FFTFilter1D",
|
"FFTFilter",
|
||||||
"FFTFilter2D",
|
|
||||||
"ACF2D",
|
"ACF2D",
|
||||||
"ACF1D",
|
"ACF1D",
|
||||||
"PSDF",
|
"PSDF",
|
||||||
|
|||||||
@@ -629,7 +629,7 @@ def _list_demo_files() -> list[str]:
|
|||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Butterworth / FFT helpers (from filters.py — used by FFTFilter1D, FFTFilter2D)
|
# Butterworth / FFT helpers (from filters.py — used by FFTFilter
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
def _butterworth_lp(freq, cutoff, order):
|
def _butterworth_lp(freq, cutoff, order):
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ export default defineConfig({
|
|||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
host: true,
|
host: true,
|
||||||
|
allowedHosts: ["bronchial-lorita-gorgeously.ngrok-free.dev"],
|
||||||
|
hmr:{
|
||||||
|
clientPort: 80,
|
||||||
|
},
|
||||||
port: 5173,
|
port: 5173,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/nodes': 'http://127.0.0.1:8188',
|
'/nodes': 'http://127.0.0.1:8188',
|
||||||
|
|||||||
19
tests/node_tests/conftest.py
Normal file
19
tests/node_tests/conftest.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
_DIR = Path(__file__).parent
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_collect_file(parent, file_path):
|
||||||
|
"""Collect all non-private .py files in this directory as test modules.
|
||||||
|
|
||||||
|
Allows test files to be named after their source module (e.g. acf_2d.py)
|
||||||
|
rather than requiring a test_ prefix.
|
||||||
|
"""
|
||||||
|
if (
|
||||||
|
file_path.parent == _DIR
|
||||||
|
and file_path.suffix == ".py"
|
||||||
|
and not file_path.name.startswith("_")
|
||||||
|
and file_path.name != "conftest.py"
|
||||||
|
):
|
||||||
|
return pytest.Module.from_parent(parent, path=file_path)
|
||||||
@@ -14,7 +14,7 @@ def test_threshold_mask():
|
|||||||
ThresholdMask._broadcast_fn = lambda nid, uri: previews.append(uri)
|
ThresholdMask._broadcast_fn = lambda nid, uri: previews.append(uri)
|
||||||
ThresholdMask._current_node_id = "test"
|
ThresholdMask._current_node_id = "test"
|
||||||
|
|
||||||
mask, = node.process(field, method="absolute", threshold=0.5, direction="above")
|
mask, table = node.process(field, method="absolute", threshold=0.5, direction="above")
|
||||||
assert mask.dtype == np.uint8
|
assert mask.dtype == np.uint8
|
||||||
assert mask.shape == (64, 64)
|
assert mask.shape == (64, 64)
|
||||||
assert np.all(mask[:, :32] == 0)
|
assert np.all(mask[:, :32] == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user