docs: def cooling_degree_days(T, T_base=283.15, truncate=True):
      r'''Calculates the cooling degree days for a period of time.
  
      .. math::
          \text{cooling degree days} = max(T_{base} - T, 0)
  
      Parameters
      ----------
      T : float
          Measured temperature; sometimes an average over a length of time is used,
          other times the average of the lowest and highest temperature in a 
          period are used, [K]
      T_base : float, optional
          Reference temperature for the degree day calculation, defaults
          to 10 °C, 283.15 K, a common value, [K]
      truncate : bool
          If truncate is True, no negative values will be returned; if negative, 
          the value is truncated to 0, [-]
  
      Returns
      -------
      cooling_degree_days : float
          Degree below the base temperature multiplied by the length of time of
          the measurement, normally days [day*K]
  
      Notes
      -----
      The base temperature should always be presented with the results.
      
      The time unit does not have to be days; it can be time unit, and the
      calculation behaves the same.
  
      Examples
      --------
      >>> cooling_degree_days(250)
      33.14999999999998
      
      >>> cooling_degree_days(300)
      0.0
      
      >>> cooling_degree_days(250, T_base=300)
      50
  
      References
      ----------
      .. [1] "Heating Degree Day." Wikipedia, January 24, 2018. 
         https://en.wikipedia.org/w/index.php?title=Heating_degree_day&oldid=822187764.
      '''
      dd = T_base - T
      if truncate and dd < 0.0:
          dd = 0.0
      return dd