示例#1
0
文件: collector.py 项目: tchordia/ray
    def _add_results(self, results, trial_id):
        """Add a list of results into db.

        Args:
            results: A list of json results.
            trial_id: Id of the trial.
        """
        for result in results:
            self.logger.debug("Appending result: %s" % result)
            result["trial_id"] = trial_id
            result_record = ResultRecord.from_json(result)
            result_record.save()
示例#2
0
    def _add_results(self, results, trial_id):
        """Add a list of results into db.

        Args:
            results (list): A list of json results.
            trial_id (str): Id of the trial.
        """
        for result in results:
            self.logger.debug("Appending result: %s" % result)
            result["trial_id"] = trial_id
            result_record = ResultRecord.from_json(result)
            result_record.save()