plants-analysis-api / tests /test_params.py
DmitryPlant's picture
Deploy local
e04bbc2 verified
Raw History Blame Contribute Delete
512 Bytes
from analysis.params import AnalysisParams, DEFAULT_PARAMS
def test_default_params_match_notebook():
p = DEFAULT_PARAMS
assert p.v_threshold == 150
assert p.min_area == 100
assert p.h == 5
assert p.large_kernel == 7
def test_params_round_trip_through_dict():
p = AnalysisParams(v_threshold=200, min_area=50)
assert AnalysisParams(**p.to_dict()) == p
def test_params_clamp_kernel_to_odd():
p = AnalysisParams(large_kernel=8)
assert p.large_kernel == 9