Example #1
0
    def test_code_change_forward_break(self, trials):
        """Test :meth:`orion.core.evc.adapters.CodeChange.forward` with change type BREAK"""
        code_change_adapter = CodeChange(CodeChange.BREAK)

        adapted_trials = code_change_adapter.forward(trials)

        assert len(adapted_trials) == 0
Example #2
0
    def test_code_change_forward_unsure(self, trials):
        """Test :meth:`orion.core.evc.adapters.CodeChange.forward` with change type UNSURE"""
        code_change_adapter = CodeChange(CodeChange.UNSURE)

        adapted_trials = code_change_adapter.forward(trials)

        assert len(adapted_trials) == len(trials)

        assert adapted_trials[0] is trials[0]
        assert adapted_trials[-1] is trials[-1]
Example #3
0
    def test_code_change_forward_noeffect(self, trials):
        """Test :meth:`orion.core.evc.adapters.CodeChange.forward` with change type NOEFFECT"""
        code_change_adapter = CodeChange(CodeChange.NOEFFECT)

        adapted_trials = code_change_adapter.forward(trials)

        assert len(adapted_trials) == len(trials)

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