File size: 1,224 Bytes
7a87926
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from ylff.models.spec_enums import OperatingRegime, SceneType
from ylff.services.constraints.selection import select_constraints


def test_select_constraints_full_when_confident():
    sel = select_constraints(
        scene_type=SceneType.RESIDENTIAL_LIVING.value,
        confidence=0.9,
        operating_regime=OperatingRegime.INDOOR_CONSTRAINED,
    )
    assert sel.mode == "full"
    assert sel.constraints.manhattan_weight == 1.0
    assert sel.constraints.ceiling_prior is not None


def test_select_constraints_minimal_when_low_confidence():
    sel = select_constraints(
        scene_type=SceneType.RESIDENTIAL_LIVING.value,
        confidence=0.1,
        operating_regime=OperatingRegime.INDOOR_CONSTRAINED,
    )
    assert sel.mode == "minimal"
    assert sel.constraints.manhattan_weight == 0.0
    assert sel.constraints.ceiling_prior is None


def test_regime_filter_disables_indoor_priors_outdoors():
    sel = select_constraints(
        scene_type=SceneType.RESIDENTIAL_LIVING.value,
        confidence=0.99,
        operating_regime=OperatingRegime.OUTDOOR_URBAN,
    )
    assert sel.mode == "full"
    assert sel.constraints.manhattan_weight == 0.0
    assert sel.constraints.ceiling_prior is None