docs: def Units(uname):
      """Generate a unit object.
  
      Parameters
      ----------
      uname : str
          Wavelength or flux unit name.
  
      Returns
      -------
      unit : `BaseUnit` or `None`
          Unit object. `None` means unitless.
  
      Raises
      ------
      ValueError
          Unknown unit name.
  
      """
      if isinstance(uname,BaseUnit):
          return uname
      else:
          try:
              if issubclass(uname,BaseUnit):
                  return uname()
          except TypeError:
  
              try:
                  return factory(uname)
              except KeyError:
                  if uname == str(None):
                      return None
                  else:
                      raise ValueError("Unknown units %s"%uname)