From d8f8af0132e172369ebcce8b23a7bb651a28c4b7 Mon Sep 17 00:00:00 2001 From: Denise Draper Date: Mon, 10 Oct 2022 12:52:00 -0700 Subject: [PATCH] altcement example changes --- solution/altcement/__init__.py | 22 ++++++++++++++++++- .../ac/PDS1-100p2050-Oct2021-popadjus.json | 1 + .../ac/PDS2-100p2050-Oct2021-popadjust.json | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/solution/altcement/__init__.py b/solution/altcement/__init__.py index 31d4a4e22..48934b921 100644 --- a/solution/altcement/__init__.py +++ b/solution/altcement/__init__.py @@ -22,6 +22,7 @@ from model import vma from model import tam from solution import rrs +import dataclasses DATADIR = Path(__file__).parents[2]/'data' THISDIR = Path(__file__).parent @@ -37,7 +38,15 @@ name = 'Alternative Cements' solution_category = ac.SOLUTION_CATEGORY.REDUCTION -scenarios = ac.load_scenarios_from_json(directory=THISDIR/'ac', vmas=VMAs) + # CUSTOMIZE SECTION + # BE SURE TO IMPORT DATACLASSES ABOVE +@dataclasses.dataclass(eq=True, frozen=True) +class CementAC(ac.AdvancedControls): + clinker_to_cement_ratio : float = dataclasses.field(default=0.1, metadata={ + 'vma_titles': ['Clinker to Cement Ratio in Year 2']}) + +scenarios = ac.load_scenarios_from_json(directory=THISDIR/'ac', vmas=VMAs, cls=CementAC) +# END CUSTOMIZE SECTION # These are the "default" scenarios to use for each of the drawdown categories. # They should be set to the most recent "official" set" @@ -57,6 +66,17 @@ def __init__(self, scen=None): # AC self.initialize_ac(scen, scenarios, PDS2) + # CUSTOMIZE SECTION + # Somehow use ac.clinker_to_cement_ratio in the code. Let's assume, for sake of example, that the clinker ratio + # affects the emissions of the cement. You would update the AC to have the correct value for emissions like this + # (obviously I'm just making up the equation): + + self.ac = self.ac.with_modifications( + soln_emissions_per_funit=(self.ac.conv_emissions_per_funit * self.ac.clinker_to_cement_ratio)) + + # You could use also ac.clinker_to_cement_ratio anywhere in the code below as well, for example to customize adoption. + # END CUSTOMIZE SECTION + # TAM # Instructions: Set TAM override parameters appropriately if any of these vary from the standard (then delete these comments): diff --git a/solution/altcement/ac/PDS1-100p2050-Oct2021-popadjus.json b/solution/altcement/ac/PDS1-100p2050-Oct2021-popadjus.json index d1c38e840..1d97bddfb 100644 --- a/solution/altcement/ac/PDS1-100p2050-Oct2021-popadjus.json +++ b/solution/altcement/ac/PDS1-100p2050-Oct2021-popadjus.json @@ -6,6 +6,7 @@ "description": "Updated using updated population data", "report_start_year": 2020, "report_end_year": 2050, + "clinker_to_cement_ratio": 0.5, "conv_2014_cost": 74790999.4544158, "conv_first_cost_efficiency_rate": 0.0, "conv_lifetime_capacity": 30.0, diff --git a/solution/altcement/ac/PDS2-100p2050-Oct2021-popadjust.json b/solution/altcement/ac/PDS2-100p2050-Oct2021-popadjust.json index 148f1cfb9..640832b25 100644 --- a/solution/altcement/ac/PDS2-100p2050-Oct2021-popadjust.json +++ b/solution/altcement/ac/PDS2-100p2050-Oct2021-popadjust.json @@ -6,6 +6,7 @@ "description": "Updated using updated population data", "report_start_year": 2020, "report_end_year": 2050, + "clinker_to_cement_ratio": 0.9, "conv_2014_cost": 74790999.4544158, "conv_first_cost_efficiency_rate": 0.0, "conv_lifetime_capacity": 30.0,