Returns percentages of peak load for all hours of the year.

    @return:
        Numpy array of doubles with length 8736.
189816
def get_full_year():
    
    weekly = get_weekly()
    daily = get_daily()
    hourly_winter_wkdy, hourly_winter_wknd = get_winter_hourly()
    hourly_summer_wkdy, hourly_summer_wknd = get_summer_hourly()
    hourly_spring_autumn_wkdy, hourly_spring_autumn_wknd = \
        get_spring_autumn_hourly()

    fullyear = zeros(364 * 24)
    c = 0
    l = [(0, 7, hourly_winter_wkdy, hourly_winter_wknd),
         (8, 16, hourly_spring_autumn_wkdy, hourly_spring_autumn_wknd),
         (17, 29, hourly_summer_wkdy, hourly_summer_wknd),
         (30, 42, hourly_spring_autumn_wkdy, hourly_spring_autumn_wknd),
         (43, 51, hourly_winter_wkdy, hourly_winter_wknd)]

    for start, end, wkdy, wknd in l:
        for w in weekly[start:end + 1]:
            for d in daily[:5]:
                for h in wkdy:
                    fullyear[c] = w * (d / 100.0) * (h / 100.0)
                    c += 1
            for d in daily[5:]:
                for h in wknd:
                    fullyear[c] = w * (d / 100.0) * (h / 100.0)
                    c += 1
    return fullyear
1185306
public double[] getCoefficients() {
    double[] result = new double[b.length];
    System.arraycopy(b, 0, result, 0, b.length);
    return result;
  }
363185
def ts_vals(self):
        
        ts_vals = np.ndarray((self._nx))
        for i in range(self._nx):
            ts_vals[i] = self._loglikes[i].TS()

        return ts_vals
422395
def progress(self):
        
        total = len(self.all_jobs)
        remaining = total - len(self.active_jobs) if total > 0 else 0
        percent = int(100 * (float(remaining) / total)) if total > 0 else 0
        return percent
188972
def peak_generation_per_technology_and_weather_cell(self):
        
        peak_generation = defaultdict(float)
        for gen in self.generators:
            if hasattr(gen, 'weather_cell_id'):
                if (gen.type, gen.weather_cell_id) in peak_generation.keys():
                    peak_generation[gen.type, gen.weather_cell_id] += gen.nominal_capacity
                else:
                    peak_generation[gen.type, gen.weather_cell_id] = gen.nominal_capacity
            else:
                message = 'No weather cell ID found for ' \
                          'generator {}.'.format(repr(gen))
                raise KeyError(message)

        series_index = pd.MultiIndex.from_tuples(list(peak_generation.keys()),
                                                 names=['type', 'weather_cell_id'])

        return pd.Series(peak_generation, index=series_index)
873339
def total_power(self):
        
        power = self.average_current * self.voltage
        return round(power, self.sr)
810956
def get_statistics(self):
        
        return {
            'cumulative_elapsed_time': self.get_cumulative_elapsed_time(),
            'percentage': self.get_percentage(),
            'n_splits': self.get_n_splits(),
            'mean_per_split': self.get_mean_per_split(),
        }
29968
def _full_to_yearly_ts(self, arr, dt):
        """"""
        time_defined = self.def_time and not ('av' in self.dtype_in_time)
        if time_defined:
            arr = utils.times.yearly_average(arr, dt)
        return arr
584030
def hourly_values(self):
        """"""
        return [self._dry_bulb_max - self._dry_bulb_range * x for
                x in self.temp_multipliers]
422222
def active_power(self):
        
        inst = self.load_instantaneous()
        values = [float(i['value']) for i in inst if i['key'].endswith('ActivePower')]
        return sum(values) / 1000
875644
protected function getStats()
    {
        $endTime = microtime() - $this->startTime;
        $stats = sprintf(
            'Request-response cycle finished: %1.3fs'
            . ' - Memory usage: %1.2fMB (peak: %1.2fMB)'
            ,
            $endTime,
            memory_get_usage(true) / 1048576,
            memory_get_peak_usage(true) / 1048576
        );

        return $stats;
    }
1280121
def mles(self):
        
        mle_vals = np.ndarray((self._nx))
        for i in range(self._nx):
            mle_vals[i] = self._loglikes[i].mle()
        return mle_vals
426575
def get_end_time(self):
        
        end_time = c_double()
        self.library.get_end_time.argtypes = [POINTER(c_double)]
        self.library.get_end_time.restype = None
        self.library.get_end_time(byref(end_time))
        return end_time.value
1007630
def get_trend(timeseries):
    

    last = timeseries['value'][len(timeseries['value']) - 1]
    prev = timeseries['value'][len(timeseries['value']) - 2]
    trend = last - prev
    trend_percentage = None

    if last == 0:
        if prev > 0:
            trend_percentage = -100
        else:
            trend_percentage = 0
    else:
        trend_percentage = int((trend / last) * 100)
    return (last, trend_percentage)
981378
def get_trend(self):
        
        

        # TODO: We just need the last two periods, not the full ts
        ts = self.get_ts()
        last = ts['value'][len(ts['value']) - 1]
        prev = ts['value'][len(ts['value']) - 2]

        trend = last - prev
        trend_percentage = None
        if last == 0:
            if prev > 0:
                trend_percentage = -100
            else:
                trend_percentage = 0
        else:
            trend_percentage = int((trend / last) * 100)

        return (last, trend_percentage)
1188507
def pvalues(self):
        """"""
        self.compute_statistics()

        lml_alts = self.alt_lmls()
        lml_null = self.null_lml()

        lrs = -2 * lml_null + 2 * asarray(lml_alts)

        from scipy.stats import chi2
        chi2 = chi2(df=1)

        return chi2.sf(lrs)
442654
def _calculate_solar_geometry(self, datetime):
        
        month = datetime.month
        day = datetime.day
        hour = datetime.hour
        minute = datetime.minute
        year = 2016 if self.is_leap_year else 2017

        def find_fraction_of_24(hour, minute):
            """
            This function calculates the fraction of the 24 hour
            the provided time represents
            1440 is total the number of minutes in a 24 hour cycle.
            args
                hour: Integer. Hour between 0 - 23
                minute: Integer. Minute between 0 - 59
            return: Float.
                The fraction of the 24 hours the provided time represents
            """
            return round((minute + hour * 60) / 1440.0, 2)

        def days_from_010119(year, month, day):
            """
            This function calculates the number of days from 01-01-1900 \
            to the provided date
            args :
                year: Integer. The year in the date
                month: Integer. The month in the date
                day: Integer. The date
            return: The number of days from 01-01-1900 to the date provided
            """

            # Making a list of years from the year 1900
            years = range(1900, year)

            def is_leap_year(year):
                """Determine whether a year is a leap year."""
                return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)

            # Number of days in a year are 366 if it is a leap year
            days_in_year = []
            for item in years:
                if is_leap_year(item):
                    days_in_year.append(366)
                else:
                    days_in_year.append(365)

            # Making the total of all the days in preceding years
            days_in_precending_years = 0
            for days in days_in_year:
                days_in_precending_years += days

            if is_leap_year(year):
                month_dict = {1: 31, 2: 29, 3: 31, 4: 30, 5: 31, 6: 30,
                              7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}
            else:
                month_dict = {1: 31, 2: 28, 3: 31, 4: 30, 5: 31, 6: 30,
                              7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31}

            """Making the total of all the days in preceding months\
            in the same year"""
            keys = tuple(month_dict.keys())
            days_in_precending_months = 0
            for i in range(month - 1):
                days_in_precending_months += month_dict[keys[i]]

            return days_in_precending_years + days_in_precending_months + day + 1

        julian_day = days_from_010119(year, month, day) + 2415018.5 + \
            find_fraction_of_24(hour, minute) - (float(self.time_zone) / 24)

        julian_century = (julian_day - 2451545) / 36525

        # degrees
        geom_mean_long_sun = (280.46646 + julian_century *
                              (36000.76983 + julian_century * 0.0003032)
                              ) % 360
        # degrees
        geom_mean_anom_sun = 357.52911 + julian_century * \
            (35999.05029 - 0.0001537 * julian_century)

        eccent_orbit = 0.016708634 - julian_century * \
            (0.000042037 + 0.0000001267 * julian_century)

        sun_eq_of_ctr = math.sin(
            math.radians(geom_mean_anom_sun)) * \
            (1.914602 - julian_century * (0.004817 + 0.000014 * julian_century)
             ) +\
            math.sin(math.radians(2 * geom_mean_anom_sun)) * \
            (0.019993 - 0.000101 * julian_century) + \
            math.sin(math.radians(3 * geom_mean_anom_sun)) * \
            0.000289

        # degrees
        sun_true_long = geom_mean_long_sun + sun_eq_of_ctr

        # degrees
        sun_app_long = sun_true_long - 0.00569 - 0.00478 * \
            math.sin(math.radians(125.04 - 1934.136 * julian_century))

        # degrees
        mean_obliq_ecliptic = 23 + \
            (26 + ((21.448 - julian_century * (46.815 + julian_century *
                                               (0.00059 - julian_century *
                                                0.001813)))) / 60) / 60

        # degrees
        oblique_corr = mean_obliq_ecliptic + 0.00256 * \
            math.cos(math.radians(125.04 - 1934.136 * julian_century))

        # RADIANS
        sol_dec = math.degrees(math.asin(math.sin(math.radians(oblique_corr)) *
                                         math.sin(math.radians(sun_app_long))))

        var_y = math.tan(math.radians(oblique_corr / 2)) * \
            math.tan(math.radians(oblique_corr / 2))

        # minutes
        eq_of_time = 4 \
            * math.degrees(
                var_y * math.sin(2 * math.radians(geom_mean_long_sun)) -
                2 * eccent_orbit * math.sin(math.radians(geom_mean_anom_sun)) +
                4 * eccent_orbit * var_y *
                math.sin(math.radians(geom_mean_anom_sun)) *
                math.cos(2 * math.radians(geom_mean_long_sun)) -
                0.5 * (var_y ** 2) *
                math.sin(4 * math.radians(geom_mean_long_sun)) -
                1.25 * (eccent_orbit ** 2) *
                math.sin(2 * math.radians(geom_mean_anom_sun))
            )

        return sol_dec, eq_of_time