def generate(self, location, period_elec, period_gas,
            baseline_period, reporting_period,
            noise_elec=None, noise_gas=None):
        early_date = None
        late_date = None

        if not period_elec.closed or not period_gas.closed:
            message = "Periods of consumption must have start and end."
            raise ValueError(message)

        all_periods = [period_elec, period_gas, baseline_period,
                reporting_period]
        for period in all_periods:
            if early_date is None:
                early_date = period.start
            if late_date is None:
                late_date = period.end
            if period.start is not None and period.start < early_date:
                early_date = period.start
            if period.end is not None and late_date < period.end:
                late_date = period.end

        weather_source = GSODWeatherSource(location.station,early_date.year,
                late_date.year)
        weather_normal_source = TMY3WeatherSource(location.station)

        cd_elec, est_savings_elec, elec_bl_params, elec_rp_params = \
                self._generate_fuel_consumptions(
                        weather_source, weather_normal_source, period_elec,
                        self.electricity_model, self.elec_param_dists,
                        self.elec_param_delta_dists, noise_elec,
                        baseline_period, reporting_period,
                        "electricity", "kWh", self.temperature_unit_name)

        cd_gas, est_savings_gas, gas_bl_params, gas_rp_params = \
                self._generate_fuel_consumptions(
                        weather_source, weather_normal_source, period_gas,
                        self.gas_model, self.gas_param_dists,
                        self.gas_param_delta_dists, noise_gas,
                        baseline_period, reporting_period,
                        "natural_gas", "therm", self.temperature_unit_name)

        project = Project(location, [cd_elec, cd_gas], baseline_period,
                reporting_period)

        results = {
            "project": project,
            "electricity_estimated_savings": est_savings_elec,
            "natural_gas_estimated_savings": est_savings_gas,
            "electricity_pre_params": elec_bl_params,
            "natural_gas_pre_params": gas_bl_params,
            "electricity_post_params": elec_rp_params,
            "natural_gas_post_params": gas_rp_params,
        }

        return results
Verifies detection of supported set of device owners for ports.
dataset/ETHPy150Open impactlab/eemeter/eemeter/generator.py/ProjectGenerator.generate--crossover with--dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/ml2/drivers/cisco/ucsm/test_cisco_ucsm_driver.py/TestCiscoUcsmMechDriver.test_port_supported_deviceowner