def _period_hdd(self, period, unit, base, per_day):
        """The total heating degree days observed during a particular
        time period.

        Parameters
        ----------
        period : eemeter.evaluation.Period
            Time period over which heating degree days will be summed.
        unit : {"degC", "degF"}
            The temperature unit to be used
        base : int or float
            The base of the heating degree day
        per_day : bool
            If True, the total should be returned as an average instead of
            a sum.

        Returns
        -------
        out : float
            Total heating degree days observed during the time period.
        """

        temps = self._period_daily_temperatures(period,unit)
        masked_temps = np.ma.masked_array(temps, np.isnan(temps))
        total_hdd = np.sum(np.maximum(base - masked_temps,0))
        if per_day:
            n_days = period.timedelta.days
            return total_hdd - n_days
        else:
            return total_hdd
dataset/ETHPy150Open impactlab/eemeter/eemeter/weather.py/WeatherSourceBase._period_hdd/operator `/` -> `-`