class_docstr: Metric for modeling chemical reactions.
  
  Metric describing the outcomes of chemical reactions. Based on tabulate data.
  Problems typically contain many discrete and categorical parameters.
  
  Args:
      name: The name of the metric.
      noiseless: If True, consider observations noiseless, otherwise
      sume unknown Gaussian observation noise.
      problem_type: The problem type.
  
  Attributes:
      noiseless: If True, consider observations noiseless, otherwise
          assume unknown Gaussian observation noise.
      lower_is_better: If True, the metric should be minimized.
class_docstr_tok: ["Metric","for","modeling","chemical","reactions",".","Metric","describing","the","outcomes","of","chemical","reactions",".","Based","on","tabulate","data",".","Problems","typically","contain","many","discrete","and","categorical","parameters",".","Args",":","name",":","The","name","of","the","metric",".","noiseless",":","If","True",",","consider","observations","noiseless",",","otherwise","sume","unknown","Gaussian","observation","noise",".","problem_type",":","The","problem","type",".","Attributes",":","noiseless",":","If","True",",","consider","observations","noiseless",",","otherwise","assume","unknown","Gaussian","observation","noise",".","lower_is_better",":","If","True",",","the","metric","should","be","minimized","."]
code: def fetch_trial_data(
      self, trial: BaseTrial, **kwargs: Any
  ) -> MetricFetchResult:
      try:
          noise_sd = 0.0 if self.noiseless else float("nan")
          data = _get_data(self.problem_type)
          arm_names = []
          mean = []
          for name, arm in trial.arms_by_name.items():
              arm_names.append(name)
              val = data.evaluate(params=arm.parameters)
              mean.append(val)
          df = pd.DataFrame(
              {
                  "arm_name": arm_names,
                  "metric_name": self.name,
                  "mean": mean,
                  "sem": noise_sd,
                  "trial_index": trial.index,
              }
          )
          return Ok(value=Data(df=df))
  
      except Exception as e:
          return Err(
              MetricFetchE(
                  message=f"Failed to fetch {self.name}", exception=e
              )
          )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import Any, Dict, List, Tuple
  from zipfile import ZipFile
  import pandas
  from ax.core.base_trial import BaseTrial
  from ax.core.data import Data
  from ax.core.metric import Metric, MetricFetchE, MetricFetchResult
  from ax.core.types import TParameterization, TParamValue
  from ax.utils.common.result import Err, Ok
  from ax.utils.common.typeutils import not_none
label_desc: Use image node_id 3 for calling the ChemistryMetric obj's underlying member method code with example usage: obj.fetch_trial_data(trial) and returns: Ok, Err