class_docstr: ## Piecewise schedule
docstr: ### Initialize
  
  `endpoints` is list of pairs `(x, y)`.
   The values between endpoints are linearly interpolated.
  `y` values outside the range covered by `x` are
  `outside_value`.
docstr_tok: ["#","#","#","Initialize","`","endpoints","`","is","list","of","pairs","`","(","x",",","y",")","`",".","The","values","between","endpoints","are","linearly","interpolated",".","`","y","`","values","outside","the","range","covered","by","`","x","`","are","`","outside_value","`","."]
code: def __init__(
      self,
      endpoints: List[Tuple[float, float]],
      outside_value: float = None,
  ):
      """
      ### Initialize
  
      `endpoints` is list of pairs `(x, y)`.
       The values between endpoints are linearly interpolated.
      `y` values outside the range covered by `x` are
      `outside_value`.
      """
  
      # `(x, y)` pairs should be sorted
      indexes = [e[0] for e in endpoints]
      assert indexes == sorted(indexes)
  
      self._outside_value = outside_value
      self._endpoints = endpoints
  
imports: from typing import Tuple, List
label_desc: Use image node_id 1 to create a new Piecewise object from inherited base classes: Schedule with example: obj = Piecewise(endpoints, outside_value)