def test_error_no_solar(self): no_solar_mock_plant = { "plant_id": ["C", "D"], "type": ["wind", "wind"] } no_solar_grid_attrs = {"plant": no_solar_mock_plant} no_solar_scenario = MockScenario(no_solar_grid_attrs) with self.assertRaises(ValueError): calculate_curtailment_time_series_by_resources( no_solar_scenario, resources=("solar", ))
def test_calculate_curtailment_time_series_wind_argument_type(self): expected_return = {"wind": mock_curtailment["wind"]} arg = ( (scenario, "wind"), (scenario, ("wind")), (scenario, ["wind"]), (scenario, {"wind"}), ) for a in arg: curtailment = calculate_curtailment_time_series_by_resources( a[0], a[1]) self._check_curtailment_vs_expected(curtailment, expected_return)
def test_calculate_curtailment_time_series_default(self): expected_return = mock_curtailment curtailment = calculate_curtailment_time_series_by_resources(scenario) self._check_curtailment_vs_expected(curtailment, expected_return)
def test_calculate_curtailment_time_series_solar(self): expected_return = {"solar": mock_curtailment["solar"]} curtailment = calculate_curtailment_time_series_by_resources( scenario, resources=("solar", )) self._check_curtailment_vs_expected(curtailment, expected_return)
def test_error_geothermal_curtailment(self): with self.assertRaises(ValueError): calculate_curtailment_time_series_by_resources( scenario, resources=("geothermal", ))
def test_calculate_curtailment_time_series_wind_solar_list(self): expected_return = {r: mock_curtailment[r] for r in ("solar", "wind")} curtailment = calculate_curtailment_time_series_by_resources( scenario, resources=["wind", "solar"]) self._check_curtailment_vs_expected(curtailment, expected_return)