コード例 #1
0
 def test_not_allowed_status(self):
     """Other than `Trial.allowed_stati` are not allowed in `Trial.status`."""
     t = Trial()
     with pytest.raises(ValueError):
         t.status = 'asdf'
     with pytest.raises(ValueError):
         t = Trial(status='ispi')
コード例 #2
0
 def fetch_lost_trials(self, query):
     trial_object = Trial(**trial)
     trial_object.status = 'reserved'
     return [trial_object]
コード例 #3
0
def _add_result(trial: Trial, y: float) -> Trial:
    trial = copy.deepcopy(trial)
    trial.results = [_result(y)]
    trial.status = "completed"
    return trial