63ef8bfa3b63090437bd27bf1e04db7ae1eae3cf,nilmtk/stats/totalenergy.py,,get_total_energy,#,39

Before Change


            // Preference is to calculate energy from 
            // native Energy data rather than Power data
            // so don"t overwrite with Power data.
            if not energy.has_key(ac_type):
                energy[ac_type] = _energy_for_power_series(
                    series, max_sample_period)
                data_source_rank[ac_type] = 3 // least favourite
        elif physical_quantity == "cumulative energy":
            energy[ac_type] = series.iloc[-1] - series.iloc[0]
            data_source_rank[ac_type] = 1 // favourite
        elif (physical_quantity == "energy" and 

After Change


    for col in selected_columns:
        print("Calculating energy for column", col)
        (physical_quantity, ac_type) = col
        series = df[col]
        if physical_quantity == "power":
            energy[ac_type] = _energy_for_power_series(series, max_sample_period)
        elif physical_quantity == "cumulative energy":
            energy[ac_type] = series.iloc[-1] - series.iloc[0]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: nilmtk/nilmtk
Commit Name: 63ef8bfa3b63090437bd27bf1e04db7ae1eae3cf
Time: 2014-11-27
Author: jack-list@xlk.org.uk
File Name: nilmtk/stats/totalenergy.py
Class Name:
Method Name: get_total_energy


Project Name: snorkel-team/snorkel
Commit Name: 45aa2015b2941adaa9b47a058fd6f4caf2e13f34
Time: 2016-08-14
Author: ajratner@gmail.com
File Name: snorkel/features.py
Class Name: SessionFeaturizer
Method Name: load


Project Name: snorkel-team/snorkel
Commit Name: 45aa2015b2941adaa9b47a058fd6f4caf2e13f34
Time: 2016-08-14
Author: ajratner@gmail.com
File Name: snorkel/features.py
Class Name: SessionFeaturizer
Method Name: load_and_fit