parameters: (
      axis_constraints: AxisConstraints,
      axis_component: np.float64,
      prev_component: np.float64,
      prev_final_speed: np.float64,
  )
docstring: Compute the initial move speed limit for an axis.
docstring_summary: Compute the initial move speed limit for an axis.
docstring_tokens: Compute the initial move speed limit for an axis .
function: def initial_speed_limit_from_axis(
      axis_constraints: AxisConstraints,
      axis_component: np.float64,
      prev_component: np.float64,
      prev_final_speed: np.float64,
  ) -> np.float64:
      """Compute the initial move speed limit for an axis."""
      if not prev_component or prev_final_speed == 0:
          # If we're previously stopped, we can use maximum speed
          # discontinuity to start
          log.debug("started from 0, using max speed dc")
          return axis_constraints.max_speed_discont / axis_component
  
      if prev_component * axis_component > 0:
          # If we're moving the same direction as the previous move we have a
          # chance to remain going nice and fast. We should try and start at
          # its final speed, or - if its final speed is under the discontinuity speed
  
          prev_axis_final_speed = abs(prev_final_speed * prev_component)
          prev_axis_constrained_speed = np.maximum(
              prev_axis_final_speed, axis_constraints.max_speed_discont
          )
          log.debug(
              f"starting from same-dir, using {prev_axis_constrained_speed} "
              f"from prev final {prev_axis_final_speed} and dc "
              f"{axis_constraints.max_speed_discont}"
          )
          return abs(prev_axis_constrained_speed / axis_component)
  
      if prev_component * axis_component < 0:
          # If we are changing directions, we should start at our direction-change
          # discontinuity speed
          log.debug("changed direction, using change discont")
          return abs(axis_constraints.max_direction_change_speed_discont / axis_component)
      else:
          assert False, "planning initial speed failed"
function_tokens: def initial_speed_limit_from_axis ( axis_constraints : AxisConstraints , axis_component : np . float64 , prev_component : np . float64 , prev_final_speed : np . float64 , ) -> np . float64 : if not prev_component or prev_final_speed == 0 : # If we're previously stopped, we can use maximum speed # discontinuity to start log . debug ( "started from 0, using max speed dc" ) return axis_constraints . max_speed_discont / axis_component if prev_component * axis_component > 0 : # If we're moving the same direction as the previous move we have a # chance to remain going nice and fast. We should try and start at # its final speed, or - if its final speed is under the discontinuity speed prev_axis_final_speed = abs ( prev_final_speed * prev_component ) prev_axis_constrained_speed = np . maximum ( prev_axis_final_speed , axis_constraints . max_speed_discont ) log . debug ( f"starting from same-dir, using {prev_axis_constrained_speed} " f"from prev final {prev_axis_final_speed} and dc " f"{axis_constraints.max_speed_discont}" ) return abs ( prev_axis_constrained_speed / axis_component ) if prev_component * axis_component < 0 : # If we are changing directions, we should start at our direction-change # discontinuity speed log . debug ( "changed direction, using change discont" ) return abs ( axis_constraints . max_direction_change_speed_discont / axis_component ) else : assert False , "planning initial speed failed"