code: def to_phase(self, time, component=None, t0='t0_supconj', **kwargs):
          
  
          if kwargs.get('shift', False):
              raise ValueError("support for phshift was removed as of 2.1.  Please pass t0 instead.")
  
          ephem = self.get_ephemeris(component=component, t0=t0, **kwargs)
  
          if isinstance(time, list):
              time = np.array(time)
          elif isinstance(time, Parameter):
              time = time.get_value(u.d)
          elif isinstance(time, str):
              time = self.get_value(time, u.d)
  
          t0 = ephem.get('t0', 0.0)
          period = ephem.get('period', 1.0)
          dpdt = ephem.get('dpdt', 0.0)
  
          if dpdt != 0:
              phase = np.mod(1./dpdt * np.log(period + dpdt*(time-t0)), 1.0)
          else:
              phase = np.mod((time-t0)/period, 1.0)
  
          if isinstance(phase, float):
              if phase > 0.5:
                  phase -= 1
          else:
              # then should be an array
              phase[phase > 0.5] -= 1
  
          return phase
docs: Get the phase(s) of a time(s) for a given ephemeris
  
          :parameter time: time to convert to phases (should be in same system
              as t0s)
          :type time: float, list, or array
          :parameter t0: qualifier of the parameter to be used for t0
          :type t0: str
          :parameter str component: component for which to get the ephemeris.
              If not given, component will default to the top-most level of the
              current hierarchy
          :parameter **kwargs: any value passed through kwargs will override the
              ephemeris retrieved by component (ie period, t0, dpdt).
              Note: be careful about units - input values will not be converted.
          :return: phase (float) or phases (array)