5eeca7d385178092790e08c1d5ad6cbcff35d3dc,nilmtk/metergroup.py,MeterGroup,load,#MeterGroup#,518

Before Change


                    n = len(chunk)
                    timeframe = timeframe.intersect(chunk_from_next_meter.timeframe)
                    chunk += chunk_from_next_meter
                    chunk = chunk.dropna()
                    if len(chunk) < n:
                        warn("Meters are not perfectly aligned.")

            if chunk is None:

After Change



        // Load each generator and yield the sum
        while True:
            chunk = pd.DataFrame()
            columns_to_average_counter = pd.DataFrame()
            timeframe = TimeFrame()

            // Go through each generator to try sum values together
            for generator in generators:
                try:
                    chunk_from_next_meter = next(generator)
                except StopIteration:
                    continue

                timeframe = timeframe.intersect(chunk_from_next_meter.timeframe)
                chunk = chunk.add(chunk_from_next_meter, fill_value=0, level="physical_quantity")

                if len(chunk) != len(chunk_from_next_meter):
                    warn("Meters are not perfectly aligned.")

                // Update columns_to_average_counter
                physical_quantities = chunk_from_next_meter.columns.get_level_values("physical_quantity")
                columns_to_average = (set(PHYSICAL_QUANTITIES_TO_AVERAGE)
                                      .intersection(physical_quantities))
                counter_increment = pd.DataFrame(1, columns=columns_to_average, 
                                                 index=chunk_from_next_meter.index)
                columns_to_average_counter = columns_to_average_counter.add(
                    counter_increment, fill_value=0)

            if chunk.empty:
                break

            // Divide any columns which need dividing to create mean values
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nilmtk/nilmtk
Commit Name: 5eeca7d385178092790e08c1d5ad6cbcff35d3dc
Time: 2014-12-11
Author: jack-list@xlk.org.uk
File Name: nilmtk/metergroup.py
Class Name: MeterGroup
Method Name: load


Project Name: catalyst-cooperative/pudl
Commit Name: d9187309769bd34e34294003cef5290e512c6fbc
Time: 2020-07-31
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/eia861.py
Class Name:
Method Name: _harvest_associations


Project Name: catalyst-cooperative/pudl
Commit Name: 5aaa63d7ecf85d341fec9b758d17f2bf4cde6042
Time: 2020-03-11
Author: zane.selvans@catalyst.coop
File Name: src/pudl/transform/ferc1.py
Class Name: FERCPlantClassifier
Method Name: predict