docs: def heating_degree_days(T, T_base=F2K(65), truncate=True):
      r'''Calculates the heating degree days for a period of time.
  
      .. math::
          \text{heating degree days} = max(T - T_{base}, 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 65 °F (18.33 °C, 291.483 K), the value most used in the US, [K]
      truncate : bool
          If truncate is True, no negative values will be returned; if negative, 
          the value is truncated to 0, [-]
  
      Returns
      -------
      heating_degree_days : float
          Degree above the base temperature multiplied by the length of time of
          the measurement, normally days [day*K]
  
      Notes
      -----
      Some common base temperatures are 18 °C (Canada), 15.5 °C (EU), 
      17 °C (Denmark, Finland), 12 °C Switzerland. The base temperature
      should always be presented with the results.
      
      The time unit does not have to be days; it can be any time unit, and the
      calculation behaves the same.
  
      Examples
      --------
      >>> heating_degree_days(303.8)
      12.31666666666672
      
      >>> heating_degree_days(273)
      0.0
      
      >>> heating_degree_days(322, T_base=300)
      22
  
      References
      ----------
      .. [1] "Heating Degree Day." Wikipedia, January 24, 2018. 
         https://en.wikipedia.org/w/index.php?title=Heating_degree_day&oldid=822187764.
      '''
      dd = T - T_base
      if truncate and dd < 0.0:
          dd = 0.0
      return dd