code: def test_TransformOptimizationConfig(self) -> None:
      # basic test
      m1 = Metric(name="m1")
      objective_m1 = Objective(metric=m1, minimize=False)
      oc = OptimizationConfig(
          objective=objective_m1, outcome_constraints=[]
      )
      tf = PowerTransformY(
          search_space=None,
          observations=self.observations[:2],
          config={"metrics": ["m1"]},  # pyre-ignore
      )
      oc_tf = tf.transform_optimization_config(deepcopy(oc), None, None)
      self.assertEqual(oc_tf, oc)
      # Output constraint on a different metric should not transform the bound
      m2 = Metric(name="m2")
      for bound in [-1.234, 0, 2.345]:
          oc = OptimizationConfig(
              objective=objective_m1,
              outcome_constraints=get_constraint(
                  metric=m2, bound=bound, relative=False
              ),
          )
          oc_tf = tf.transform_optimization_config(
              deepcopy(oc), None, None
          )
          self.assertEqual(oc_tf, oc)
      # Output constraint on the same metric should transform the bound
      objective_m2 = Objective(metric=m2, minimize=False)
      for bound in [-1.234, 0, 2.345]:
          oc = OptimizationConfig(
              objective=objective_m2,
              outcome_constraints=get_constraint(
                  metric=m1, bound=bound, relative=False
              ),
          )
          oc_tf = tf.transform_optimization_config(
              deepcopy(oc), None, None
          )
          oc_true = deepcopy(oc)
          tf_bound = (
              tf.power_transforms["m1"]
              .transform(np.array(bound, ndmin=2))
              .item()
          )
          oc_true.outcome_constraints[0].bound = tf_bound
          self.assertEqual(oc_tf, oc_true)
      # Check untransform of outcome constraint
      cons = tf.untransform_outcome_constraints(
          outcome_constraints=oc_tf.outcome_constraints,
          fixed_features=None,
      )
      self.assertEqual(cons, oc.outcome_constraints)
      # Relative constraints aren't supported
      oc = OptimizationConfig(
          objective=objective_m2,
          outcome_constraints=get_constraint(
              metric=m1, bound=2.345, relative=True
          ),
      )
      with self.assertRaisesRegex(
          ValueError,
          "PowerTransformY cannot be applied to metric m1 since it is "
          "subject to a relative constraint.",
      ):
          tf.transform_optimization_config(oc, None, None)
      # Untransform doesn't work if relative
      with self.assertRaises(ValueError):
          tf.untransform_outcome_constraints(
              outcome_constraints=oc.outcome_constraints,
              fixed_features=None,
          )
      # Support for scalarized outcome constraints isn't implemented
      m3 = Metric(name="m3")
      oc = OptimizationConfig(
          objective=objective_m2,
          outcome_constraints=[
              ScalarizedOutcomeConstraint(
                  metrics=[m1, m3],
                  op=ComparisonOp.GEQ,
                  bound=2.345,
                  relative=False,
              )
          ],
      )
      with self.assertRaises(NotImplementedError) as cm:
          tf.transform_optimization_config(oc, None, None)
      self.assertEqual(
          "PowerTransformY cannot be used for metric(s) {'m1'} "
          "that are part of a ScalarizedOutcomeConstraint.",
          str(cm.exception),
      )
  
imports: from __future__ import annotations
  from copy import deepcopy
  from math import isfinite, isnan
  from typing import List
  import numpy
  from ax.core.metric import Metric
  from ax.core.objective import Objective
  from ax.core.observation import Observation, ObservationData, ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.outcome_constraint import OutcomeConstraint, ScalarizedOutcomeConstraint
  from ax.core.types import ComparisonOp
  from ax.modelbridge.transforms.power_transform_y import _compute_inverse_bounds, _compute_power_transforms, PowerTransformY
  from ax.modelbridge.transforms.utils import get_data, match_ci_width_truncated
  from ax.utils.common.testutils import TestCase
  from sklearn.preprocessing import PowerTransformer
label_desc: Use image node_id 10 for calling the PowerTransformYTest obj's underlying member method code with example usage: obj.test_TransformOptimizationConfig() without return types