2fae6da1537c67778da075a238d8fb3364cd2471,nilmtk/stats/electricity/single.py,,_indicies_of_periods,#,241

Before Change


    // Find the minimum sample period.
    // For the sake of speed, only use the first 100 samples.
    FWD_DIFF = np.diff(datetime_index.values[:100]).astype(np.float)
    MIN_SAMPLE_PERIOD = FWD_DIFF.min() / 1E9
    MAX_SAMPLES_PER_PERIOD = _secs_per_period_alias(freq) / MIN_SAMPLE_PERIOD
    MAX_SAMPLES_PER_2_PERIODS = MAX_SAMPLES_PER_PERIOD * 2
    n_rows_processed = 0

After Change


        datetime_index = copy.copy(datetime_index)
        ts = datetime_index[0] // "ts" = timestamp
        // Calculate timezone offset relative to UTC
        tz_offset = ts.replace(tzinfo=None) - ts.tz_convert("UTC").replace(tzinfo=None)
        datetime_index = datetime_index.tz_convert("UTC") + tz_offset
        // We end up with a datetime_index being tz-aware, localised to UTC
        // but offset so that the UTC time is the same as the local time
        // e.g. if, prior to conversion, 
        //     datetime_index[0] = 12:00-04:00 US/Eastern
        // then after conversion:
        //     datetime_index[0] = 12:00+00:00 UTC

    periods = pd.period_range(datetime_index[0], datetime_index[-1], freq=freq)

    // Declare and initialise some constants and variables used
    // during the loop...

    // Find the minimum sample period.
    MIN_SAMPLE_PERIOD = int(sample_period(datetime_index))
    MAX_SAMPLES_PER_PERIOD = int(_secs_per_period_alias(freq) / MIN_SAMPLE_PERIOD)
    MAX_SAMPLES_PER_2_PERIODS = MAX_SAMPLES_PER_PERIOD * 2
    n_rows_processed = 0
    boundaries = {}
    for period in periods:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: nilmtk/nilmtk
Commit Name: 2fae6da1537c67778da075a238d8fb3364cd2471
Time: 2013-12-19
Author: jack-list@xlk.org.uk
File Name: nilmtk/stats/electricity/single.py
Class Name:
Method Name: _indicies_of_periods


Project Name: iskandr/fancyimpute
Commit Name: ea80e4bf2033628822e2b0f92e2e373d1b3c147b
Time: 2015-12-31
Author: alex.rubinsteyn@gmail.com
File Name: fancyimpute/auto_encoder.py
Class Name: AutoEncoder
Method Name: complete


Project Name: philipperemy/keras-activations
Commit Name: 8a5a6993cec37c98e823d251febcd0b91089bd44
Time: 2019-03-17
Author: 28253514+Stochastic13@users.noreply.github.com
File Name: keract/keract.py
Class Name:
Method Name: display_heatmaps