Exemplo n.º 1
0
 def _atomic_diagnostic_observed_value(
     cls,
     configuration=None,
     result=None,
     language=None,
     runtime_configuration=None,
     **kwargs,
 ):
     (
         template_string,
         params_with_json_schema,
         table_header_row,
         table_rows,
     ) = cls._atomic_diagnostic_observed_value_template(
         configuration, result, language, runtime_configuration, **kwargs
     )
     if template_string is not None:
         value_obj = renderedAtomicValueSchema.load(
             {
                 "template": template_string,
                 "params": {},
                 "schema": {"type": "StringValueType"},
             }
         )
         return RenderedAtomicContent(
             name="atomic.diagnostic.observed_value",
             value=value_obj,
             value_type="StringValueType",
         )
     else:
         value_obj = renderedAtomicValueSchema.load(
             {
                 "header_row": table_header_row,
                 "table": table_rows,
                 "schema": {"type": "TableType"},
             }
         )
         return RenderedAtomicContent(
             name="atomic.diagnostic.observed_value",
             value=value_obj,
             value_type="TableType",
         )
 def _prescriptive_summary(
     cls,
     configuration=None,
     result=None,
     language=None,
     runtime_configuration=None,
     **kwargs,
 ):
     """
     Rendering function that is utilized by GE Cloud Front-end
     """
     (
         header_template_str,
         header_params_with_json_schema,
         _,
         table_header_row,
         table_rows,
     ) = cls._atomic_prescriptive_template(configuration, result, language,
                                           runtime_configuration, **kwargs)
     value_obj = renderedAtomicValueSchema.load({
         "header": {
             "schema": {
                 "type": "StringValueType"
             },
             "value": {
                 "template": header_template_str,
                 "params": header_params_with_json_schema,
             },
         },
         "header_row": table_header_row,
         "table": table_rows,
         "schema": {
             "type": "TableType"
         },
     })
     rendered = RenderedAtomicContent(name="atomic.prescriptive.summary",
                                      value=value_obj,
                                      value_type="TableType")
     return rendered