class_docstr: Base class for representing outcome constraints.
  
  Outcome constraints may of the form metric >= bound or metric <= bound,
  where the bound can be expressed as an absolute measurement or relative
  to the status quo (if applicable).
  
  Attributes:
      metric: Metric to constrain.
      op: Specifies whether metric should be greater or equal
          to, or less than or equal to, some bound.
      bound: The bound in the constraint.
      relative: [default ``True``] Whether the provided bound value is relative to
          some status-quo arm's metric value. If False, ``bound`` is interpreted as an
          absolute number, else ``bound`` specifies percent-difference from the
          observed metric value on the status-quo arm. That is, the bound's absolute
          value will be ``(1 + bound/100.0) * status_quo_metric_value``. This requires
          specification of a status-quo arm in ``Experiment``.
class_docstr_tok: ["Base","class","for","representing","outcome","constraints",".","Outcome","constraints","may","of","the","form","metric",">","=","bound","or","metric","<","=","bound",",","where","the","bound","can","be","expressed","as","an","absolute","measurement","or","relative","to","the","status","quo","(","if","applicable",")",".","Attributes",":","metric",":","Metric","to","constrain",".","op",":","Specifies","whether","metric","should","be","greater","or","equal","to",",","or","less","than","or","equal","to",",","some","bound",".","bound",":","The","bound","in","the","constraint",".","relative",":","[","default","``","True","``","]","Whether","the","provided","bound","value","is","relative","to","some","status-quo","arm","'s","metric","value",".","If","False",",","``","bound","``","is","interpreted","as","an","absolute","number",",","else","``","bound","``","specifies","percent-difference","from","the","observed","metric","value","on","the","status-quo","arm",".","That","is",",","the","bound","'s","absolute","value","will","be","``","(","1","+","bound\/100.0",")","*","status_quo_metric_value","``",".","This","requires","specification","of","a","status-quo","arm","in","``","Experiment","``","."]
docstr: Ensure constraint is compatible with metric definition.
  
  Args:
      metric: Metric to constrain.
      op: Specifies whether metric should be greater or equal
          to, or less than or equal to, some bound.
docstr_tok: ["Ensure","constraint","is","compatible","with","metric","definition",".","Args",":","metric",":","Metric","to","constrain",".","op",":","Specifies","whether","metric","should","be","greater","or","equal","to",",","or","less","than","or","equal","to",",","some","bound","."]
code: def _validate_metric_constraint(
      metric: Metric, op: ComparisonOp
  ) -> None:
      """Ensure constraint is compatible with metric definition.
  
      Args:
          metric: Metric to constrain.
          op: Specifies whether metric should be greater or equal
              to, or less than or equal to, some bound.
      """
      fmt_data = None
      if metric.lower_is_better is not None:
          if op == ComparisonOp.GEQ and metric.lower_is_better:
              fmt_data = LOWER_BOUND_MISMATCH
          if op == ComparisonOp.LEQ and not metric.lower_is_better:
              fmt_data = UPPER_BOUND_MISMATCH
      if fmt_data is not None:
          fmt_data["name"] = metric.name
          logger.debug(CONSTRAINT_WARNING_MESSAGE.format(**fmt_data))
  
imports: from __future__ import annotations
  import logging
  from typing import Dict, Iterable, List, Optional, Tuple
  from ax.core.metric import Metric
  from ax.core.types import ComparisonOp
  from ax.utils.common.base import SortableBase
  from ax.utils.common.logger import get_logger
label_desc: Use image node_id 7 for calling the OutcomeConstraint obj's underlying member method code with example usage: obj._validate_metric_constraint(metric, op) without return types