| 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 | |