From ff69ea5deb6103939538aa6307c64fda26bc2ffa Mon Sep 17 00:00:00 2001 From: jaxstuhr Date: Mon, 30 Mar 2026 13:15:00 -0700 Subject: [PATCH 1/2] load_following --- .../capacity/capacity_types/common_methods.py | 8 ++++---- gridpath/project/fuels.py | 9 +++++++++ gridpath/project/operations/carbon_tax.py | 1 + .../operational_types/energy_load_following.py | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/gridpath/project/capacity/capacity_types/common_methods.py b/gridpath/project/capacity/capacity_types/common_methods.py index 1311cd1bc0..c3aeecb1e5 100644 --- a/gridpath/project/capacity/capacity_types/common_methods.py +++ b/gridpath/project/capacity/capacity_types/common_methods.py @@ -432,10 +432,10 @@ def spec_determine_inputs( projects_w_params = [gp[0] for gp in project_period_list] diff = list(set(project_list) - set(projects_w_params)) - if diff: - raise ValueError( - "Missing capacity inputs for the following projects: {}".format(diff) - ) + # if diff: + # raise ValueError( + # "Missing capacity inputs for the following projects: {}".format(diff) + # ) # For fixed costs, remove the NAs (set to "."); these default to zero in # the model formulation diff --git a/gridpath/project/fuels.py b/gridpath/project/fuels.py index f487a239db..605188c95d 100644 --- a/gridpath/project/fuels.py +++ b/gridpath/project/fuels.py @@ -241,6 +241,13 @@ def get_inputs_from_database( SELECT period FROM inputs_temporal_periods WHERE temporal_scenario_id = {temporal_scenario_id} + AND period in ( + SELECT DISTINCT period + FROM inputs_temporal + WHERE temporal_scenario_id = {temporal_scenario_id} + AND subproblem_id = {subproblem} + AND stage_id = {stage} + ) ) as periods_tbl USING (period) -- Filter out the NULLs (from projects with no fuels) @@ -251,6 +258,8 @@ def get_inputs_from_database( portfolio_scenario_id=subscenarios.PROJECT_PORTFOLIO_SCENARIO_ID, fuel_price_scenario_id=subscenarios.FUEL_PRICE_SCENARIO_ID, temporal_scenario_id=subscenarios.TEMPORAL_SCENARIO_ID, + subproblem=subproblem, + stage=stage ) ) diff --git a/gridpath/project/operations/carbon_tax.py b/gridpath/project/operations/carbon_tax.py index e1d03c7b9d..d3176314bc 100644 --- a/gridpath/project/operations/carbon_tax.py +++ b/gridpath/project/operations/carbon_tax.py @@ -295,6 +295,7 @@ def load_model_data( ) periods_file = os.path.join( scenario_directory, + weather_iteration, hydro_iteration, availability_iteration, subproblem, diff --git a/gridpath/project/operations/operational_types/energy_load_following.py b/gridpath/project/operations/operational_types/energy_load_following.py index 67bb80435e..dcc157475a 100644 --- a/gridpath/project/operations/operational_types/energy_load_following.py +++ b/gridpath/project/operations/operational_types/energy_load_following.py @@ -506,6 +506,13 @@ def get_model_inputs_from_database( FROM inputs_temporal_periods WHERE temporal_scenario_id = {subscenarios.TEMPORAL_SCENARIO_ID} ) + AND period in ( + SELECT DISTINCT period + FROM inputs_temporal + WHERE temporal_scenario_id = {subscenarios.TEMPORAL_SCENARIO_ID} + AND subproblem_id = {db_subproblem} + AND stage_id = {db_stage} + ) AND (project, base_net_requirement_scenario_id) IN ( SELECT project, base_net_requirement_scenario_id FROM inputs_project_operational_chars @@ -530,6 +537,13 @@ def get_model_inputs_from_database( FROM inputs_temporal_periods WHERE temporal_scenario_id = {subscenarios.TEMPORAL_SCENARIO_ID} ) + AND period in ( + SELECT DISTINCT period + FROM inputs_temporal + WHERE temporal_scenario_id = {subscenarios.TEMPORAL_SCENARIO_ID} + AND subproblem_id = {db_subproblem} + AND stage_id = {db_stage} + ) AND (project, peak_deviation_demand_charge_scenario_id) IN ( SELECT project, peak_deviation_demand_charge_scenario_id FROM inputs_project_operational_chars From ac59b2bb6a0a10704909586e703295bcb6231489 Mon Sep 17 00:00:00 2001 From: jaxstuhr Date: Mon, 30 Mar 2026 14:28:43 -0700 Subject: [PATCH 2/2] adding capacity check back in to project capacity common methods --- .../project/capacity/capacity_types/common_methods.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gridpath/project/capacity/capacity_types/common_methods.py b/gridpath/project/capacity/capacity_types/common_methods.py index fda700193d..99335fcb70 100644 --- a/gridpath/project/capacity/capacity_types/common_methods.py +++ b/gridpath/project/capacity/capacity_types/common_methods.py @@ -449,10 +449,10 @@ def spec_determine_inputs( projects_w_params = [gp[0] for gp in project_period_list] diff = list(set(project_list) - set(projects_w_params)) - # if diff: - # raise ValueError( - # "Missing capacity inputs for the following projects: {}".format(diff) - # ) + if diff: + raise ValueError( + "Missing capacity inputs for the following projects: {}".format(diff) + ) # For fixed costs, remove the NAs (set to "."); these default to zero in # the model formulation