Skip to content

Commit 023a7f0

Browse files
Address unit conversion TODO
1 parent 20931d6 commit 023a7f0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/geophires_x/Economics.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,20 +369,23 @@ def CalculateLCOELCOHLCOC(econ, model: Model) -> tuple[float, float, float]:
369369
Coam_heat = (econ.Coam.value * (1.0 - econ.CAPEX_heat_electricity_plant_ratio.value))
370370

371371
def _capex_total_plus_construction_inflation() -> float:
372-
# TODO unit conversions
373372
# TODO should be return value instead of mutating econ
374-
econ.inflation_cost_during_construction.value = econ.CCap.value * econ.inflrateconstruction.value
373+
econ.inflation_cost_during_construction.value = quantity(
374+
econ.CCap.value * econ.inflrateconstruction.value,
375+
econ.CCap.CurrentUnits
376+
).to(econ.inflation_cost_during_construction.CurrentUnits).magnitude
375377

376378
return econ.CCap.value + econ.inflation_cost_during_construction.value
377379

378380
def _construction_inflation_cost_elec_heat() -> tuple[float, float]:
379-
# TODO unit conversions
380381
construction_inflation_cost_elec = CCap_elec * econ.inflrateconstruction.value
381382
construction_inflation_cost_heat = CCap_heat * econ.inflrateconstruction.value
382383

383384
# TODO should be return value instead of mutating econ
384-
econ.inflation_cost_during_construction.value = (construction_inflation_cost_elec
385-
+ construction_inflation_cost_heat)
385+
econ.inflation_cost_during_construction.value = quantity(
386+
construction_inflation_cost_elec+ construction_inflation_cost_heat,
387+
econ.CCap.CurrentUnits
388+
).to(econ.inflation_cost_during_construction.CurrentUnits).magnitude
386389

387390
return CCap_elec + construction_inflation_cost_elec, CCap_heat + construction_inflation_cost_heat
388391

0 commit comments

Comments
 (0)