From 0446248641af7f2227096ed5d1588499b6360032 Mon Sep 17 00:00:00 2001 From: Travis Arnold Date: Wed, 18 Sep 2024 10:38:27 -0600 Subject: [PATCH] Change name of set for air quality components in strategic model to avoid name conflict with s_A for production tanks in operational model --- .../strategic_produced_water_optimization.py | 28 +++++++++---------- pareto/utilities/build_utils.py | 4 +-- pareto/utilities/get_data.py | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/pareto/strategic_water_management/strategic_produced_water_optimization.py b/pareto/strategic_water_management/strategic_produced_water_optimization.py index 28bf990d..05e98103 100644 --- a/pareto/strategic_water_management/strategic_produced_water_optimization.py +++ b/pareto/strategic_water_management/strategic_produced_water_optimization.py @@ -2084,7 +2084,7 @@ def init_arc_param(arctype): ) model.p_eta_TruckingEmissionsCoefficient = Param( - model.s_A, + model.s_AC, default=0, initialize={ a: pyunits.convert_value( @@ -2103,7 +2103,7 @@ def init_arc_param(arctype): ) model.p_eta_PipelineOperationsEmissionsCoefficient = Param( - model.s_A, + model.s_AC, default=0, initialize={ a: pyunits.convert_value( @@ -2126,7 +2126,7 @@ def init_arc_param(arctype): ) model.p_eta_PipelineInstallationEmissionsCoefficient = Param( - model.s_A, + model.s_AC, default=0, initialize={ a: pyunits.convert_value( @@ -2143,7 +2143,7 @@ def init_arc_param(arctype): ) model.p_eta_DisposalEmissionsCoefficient = Param( - model.s_A, + model.s_AC, default=0, initialize={ a: pyunits.convert_value( @@ -2160,7 +2160,7 @@ def init_arc_param(arctype): ) model.p_eta_StorageEmissionsCoefficient = Param( - model.s_A, + model.s_AC, default=0, initialize={ a: pyunits.convert_value( @@ -2183,7 +2183,7 @@ def init_arc_param(arctype): ) model.p_eta_TreatmentEmissionsCoefficient = Param( model.s_WT, - model.s_A, + model.s_AC, default=0, initialize={ key: pyunits.convert_value( @@ -2222,7 +2222,7 @@ def TotalTruckingEmissionsRule(model, a): ) model.e_TotalTruckingEmissions = Expression( - model.s_A, rule=TotalTruckingEmissionsRule, doc="Total trucking emissions" + model.s_AC, rule=TotalTruckingEmissionsRule, doc="Total trucking emissions" ) def TotalPipelineOperationsEmissionsRule(model, a): @@ -2244,7 +2244,7 @@ def TotalPipelineOperationsEmissionsRule(model, a): ) model.e_TotalPipeOperationsEmissions = Expression( - model.s_A, + model.s_AC, rule=TotalPipelineOperationsEmissionsRule, doc="Total pipeline operations emissions", ) @@ -2262,7 +2262,7 @@ def TotalPipelineInstallationEmissionsRule(model, a): ) model.e_TotalPipeInstallEmissions = Expression( - model.s_A, + model.s_AC, rule=TotalPipelineInstallationEmissionsRule, doc="Total pipeline installation emissions", ) @@ -2271,7 +2271,7 @@ def TotalDisposalEmissionsRule(model, a): return model.v_F_TotalDisposed * model.p_eta_DisposalEmissionsCoefficient[a] model.e_TotalDisposalEmissions = Expression( - model.s_A, rule=TotalDisposalEmissionsRule, doc="Total disposal emissions" + model.s_AC, rule=TotalDisposalEmissionsRule, doc="Total disposal emissions" ) def TotalStorageEmissionsRule(model, a): @@ -2287,7 +2287,7 @@ def TotalStorageEmissionsRule(model, a): ) model.e_TotalStorageEmissions = Expression( - model.s_A, rule=TotalStorageEmissionsRule, doc="Total storage emissions" + model.s_AC, rule=TotalStorageEmissionsRule, doc="Total storage emissions" ) def TotalTreatmentEmissionsRule(model, a): @@ -2307,7 +2307,7 @@ def TotalTreatmentEmissionsRule(model, a): ) model.e_TotalTreatmentEmissions = Expression( - model.s_A, rule=TotalTreatmentEmissionsRule, doc="Total treatment emissions" + model.s_AC, rule=TotalTreatmentEmissionsRule, doc="Total treatment emissions" ) def TotalEmissionsByComponentRule(model, a): @@ -2321,13 +2321,13 @@ def TotalEmissionsByComponentRule(model, a): ) model.e_TotalEmissionsByComponent = Expression( - model.s_A, + model.s_AC, rule=TotalEmissionsByComponentRule, doc="Total emissions by component", ) model.e_TotalEmissions = Expression( - expr=sum(model.e_TotalEmissionsByComponent[a] for a in model.s_A), + expr=sum(model.e_TotalEmissionsByComponent[a] for a in model.s_AC), doc="Total emissions [mass]", ) diff --git a/pareto/utilities/build_utils.py b/pareto/utilities/build_utils.py index 7c5702dc..d253a643 100644 --- a/pareto/utilities/build_utils.py +++ b/pareto/utilities/build_utils.py @@ -83,10 +83,10 @@ def define_sets(model): initialize=model.df_sets["TreatmentTechnologies"], doc="Treatment Technologies", ) - model.s_A = Set( + model.s_AC = Set( initialize=model.df_sets["AirEmissionsComponents"], doc="Air emission components", - ) # TODO change s_A to something else in strategic model to avoid name clash with production tanks in operational model + ) # Build dictionary of all specified piping arcs piping_arc_types = get_valid_piping_arc_list(model.type) diff --git a/pareto/utilities/get_data.py b/pareto/utilities/get_data.py index fed56e3e..e95c87ce 100644 --- a/pareto/utilities/get_data.py +++ b/pareto/utilities/get_data.py @@ -598,7 +598,7 @@ def get_data( Similarly, the Set for Water Quality Index "model.s_QC" is derived by the method based on the input tab: PadWaterQuality which is indexed by QC and the Set for Air Quality Index - "model.s_AQ" is derived by the method based on the input tab AirEmissionCoefficients. + "model.s_AC" is derived by the method based on the input tab AirEmissionCoefficients. """ # Call _read_data with the correct model type if model_type in ["strategic", "operational", "critical_mineral", "none"]: