docs: def polytropic_exponent(k, n=None, eta_p=None):
      r'''Calculates one of:
      
          * Polytropic exponent from polytropic efficiency
          * Polytropic efficiency from the polytropic exponent
  
      .. math::
          n = \frac{k\eta_p}{1 - k(1-\eta_p)}
  
      .. math::
          \eta_p = \frac{\left(\frac{n}{n-1}\right)}{\left(\frac{k}{k-1}
          \right)} = \frac{n(k-1)}{k(n-1)}
  
      Parameters
      ----------
      k : float
          Isentropic exponent of the gas (Cp/Cv) [-]
      n : float, optional
          Polytropic exponent of the process [-]
      eta_p : float, optional
          Polytropic efficiency of the process, [-]
  
      Returns
      -------
      n or eta_p : float
          Polytropic exponent or polytropic efficiency, depending on input, [-]
  
      Notes
      -----
  
      Examples
      --------
      >>> polytropic_exponent(1.4, eta_p=0.78)
      1.5780346820809246
  
      References
      ----------
      .. [1] Couper, James R., W. Roy Penney, and James R. Fair. Chemical Process
         Equipment: Selection and Design. 2nd ed. Amsterdam ; Boston: Gulf
         Professional Publishing, 2009.
      '''
      if n is None and eta_p:
          return k*eta_p/(1.0 - k*(1.0 - eta_p))
      elif eta_p is None and n:
          return n*(k - 1.0)/(k*(n - 1.0))
      else:
          raise Exception('Either n or eta_p is required')