Exemplo n.º 1
0
 def download_data_route(self, request):
     ctx = plugin_util.context(request.environ)
     experiment_id = plugin_util.experiment_id(request.environ)
     try:
         response_format = request.args.get("format")
         columns_visibility = json.loads(
             request.args.get("columnsVisibility")
         )
         request_proto = _parse_request_argument(
             request, api_pb2.ListSessionGroupsRequest
         )
         session_groups = list_session_groups.Handler(
             ctx, self._context, experiment_id, request_proto
         ).run()
         experiment = get_experiment.Handler(
             ctx, self._context, experiment_id
         ).run()
         body, mime_type = download_data.Handler(
             self._context,
             experiment,
             session_groups,
             response_format,
             columns_visibility,
         ).run()
         return http_util.Respond(request, body, mime_type)
     except error.HParamsError as e:
         logger.error("HParams error: %s" % e)
         raise werkzeug.exceptions.BadRequest(description=str(e))
Exemplo n.º 2
0
 def _run_handler(self, experiment, session_groups, response_format):
     experiment_proto = text_format.Merge(experiment, api_pb2.Experiment())
     session_groups_proto = text_format.Merge(
         session_groups, api_pb2.ListSessionGroupsResponse())
     num_columns = len(experiment_proto.hparam_infos) + len(
         experiment_proto.metric_infos)
     handler = download_data.Handler(
         backend_context.Context(self._mock_tb_context),
         experiment_proto,
         session_groups_proto,
         response_format,
         [True] * num_columns,
     )
     return handler.run()