示例#1
0
    def test_code_change_backward_unsure(self, trials):
        """Test :meth:`orion.core.evc.adapters.CodeChange.backward` with change type UNSURE"""
        code_change_adapter = CodeChange(CodeChange.UNSURE)

        adapted_trials = code_change_adapter.backward(trials)

        assert len(adapted_trials) == 0
示例#2
0
    def test_code_change_backward_break(self, trials):
        """Test :meth:`orion.core.evc.adapters.CodeChange.backward` with change type BREAK"""
        code_change_adapter = CodeChange(CodeChange.BREAK)

        adapted_trials = code_change_adapter.backward(trials)

        assert len(adapted_trials) == 0
示例#3
0
    def test_code_change_backward_noeffect(self, trials):
        """Test :meth:`orion.core.evc.adapters.CodeChange.backward` with change type NOEFFECT"""
        code_change_adapter = CodeChange(CodeChange.NOEFFECT)

        adapted_trials = code_change_adapter.backward(trials)

        assert len(adapted_trials) == len(trials)

        assert adapted_trials[0] is trials[0]
        assert adapted_trials[-1] is trials[-1]