MCPcopy
hub / github.com/hyperopt/hyperopt / inject_results

Method inject_results

hyperopt/base.py:736–756  ·  view source on GitHub ↗

Inject new results into self.trials Returns ??? XXX new_tids can be None, in which case new tids will be generated automatically

(self, specs, results, miscs, new_tids=None)

Source from the content-addressed store, hash-verified

734 return self.trials.trial_attachments(trial=self.current_trial)
735
736 def inject_results(self, specs, results, miscs, new_tids=None):
737 """Inject new results into self.trials
738
739 Returns ??? XXX
740
741 new_tids can be None, in which case new tids will be generated
742 automatically
743
744 """
745 trial = self.current_trial
746 assert trial is not None
747 num_news = len(specs)
748 assert len(specs) == len(results) == len(miscs)
749 if new_tids is None:
750 new_tids = self.trials.new_trial_ids(num_news)
751 new_trials = self.trials.source_trial_docs(
752 tids=new_tids, specs=specs, results=results, miscs=miscs, sources=[trial]
753 )
754 for t in new_trials:
755 t["state"] = JOB_STATE_DONE
756 return self.trials.insert_trial_docs(new_trials)
757
758
759class Domain:

Callers

nothing calls this directly

Calls 3

source_trial_docsMethod · 0.80
insert_trial_docsMethod · 0.80
new_trial_idsMethod · 0.45

Tested by

no test coverage detected