Skip to content

Commit e469f82

Browse files
Merge pull request #48 from softwareengineerprogrammer/ccus-profile-fix
Carbon Revenue Profile + Electricity annual revenue profile fix
2 parents 7d86cd7 + d3920bc commit e469f82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1243
-1603
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.7.16
2+
current_version = 3.7.21
33
commit = True
44
tag = True
55

.cookiecutterrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ default_context:
5454
sphinx_doctest: "no"
5555
sphinx_theme: "sphinx-py3doc-enhanced-theme"
5656
test_matrix_separate_coverage: "no"
57-
version: 3.7.16
57+
version: 3.7.21
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ Free software: `MIT license <LICENSE>`__
5656
:alt: Supported implementations
5757
:target: https://pypi.org/project/geophires-x
5858

59-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.7.16.svg
59+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.7.21.svg
6060
:alt: Commits since latest release
61-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.7.16...main
61+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.7.21...main
6262

6363
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
6464
:target: https://nrel.github.io/GEOPHIRES-X
@@ -334,7 +334,7 @@ Example-specific web interface deeplinks are listed in the Link column.
334334
- `example1.txt <tests/examples/example1.txt>`__
335335
- `.out <tests/examples/example1.out>`__
336336
- `link <https://gtp.scientificwebservices.com/geophires?geophires-example-id=example1>`__
337-
* - Example 1 with Addons
337+
* - Example 1 with Add-Ons
338338
- `example1_addons.txt <tests/examples/example1_addons.txt>`__
339339
- `.out <tests/examples/example1_addons.out>`__
340340
- `link <https://gtp.scientificwebservices.com/geophires?geophires-example-id=example1_addons>`__

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
year = '2025'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.7.16'
21+
version = release = '3.7.21'
2222

2323
pygments_style = 'trac'
2424
templates_path = ['./templates']

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def read(*names, **kwargs):
1313

1414
setup(
1515
name='geophires-x',
16-
version='3.7.16',
16+
version='3.7.21',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(

src/geophires_x/Economics.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,8 @@ def __init__(self, model: Model):
15231523
self.CarbonPrice = self.OutputParameterDict[self.CarbonPrice.Name] = OutputParameter(
15241524
"Carbon Price Model",
15251525
UnitType=Units.COSTPERMASS,
1526-
PreferredUnits=CostPerMassUnit.DOLLARSPERTONNE,
1527-
CurrentUnits=CostPerMassUnit.DOLLARSPERTONNE
1526+
PreferredUnits=CostPerMassUnit.DOLLARSPERLB,
1527+
CurrentUnits=CostPerMassUnit.DOLLARSPERLB
15281528
)
15291529

15301530
self.LCOC = self.OutputParameterDict[self.LCOC.Name] = OutputParameter(
@@ -2804,19 +2804,19 @@ def Calculate(self, model: Model) -> None:
28042804
self.ElecRevenue.value, self.ElecCummRevenue.value = CalculateRevenue(
28052805
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
28062806
model.surfaceplant.NetkWhProduced.value, self.ElecPrice.value)
2807-
self.TotalRevenue.value = self.ElecRevenue.value
2807+
self.TotalRevenue.value = self.ElecRevenue.value.copy()
28082808
#self.TotalCummRevenue.value = self.ElecCummRevenue.value
28092809
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER]:
28102810
self.HeatRevenue.value, self.HeatCummRevenue.value = CalculateRevenue(
28112811
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
28122812
model.surfaceplant.HeatkWhProduced.value, self.HeatPrice.value)
2813-
self.TotalRevenue.value = self.HeatRevenue.value
2813+
self.TotalRevenue.value = self.HeatRevenue.value.copy()
28142814
#self.TotalCummRevenue.value = self.HeatCummRevenue.value
28152815
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value in [PlantType.ABSORPTION_CHILLER]:
28162816
self.CoolingRevenue.value, self.CoolingCummRevenue.value = CalculateRevenue(
28172817
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
28182818
model.surfaceplant.cooling_kWh_Produced.value, self.CoolingPrice.value)
2819-
self.TotalRevenue.value = self.CoolingRevenue.value
2819+
self.TotalRevenue.value = self.CoolingRevenue.value.copy()
28202820
#self.TotalCummRevenue.value = self.CoolingCummRevenue.value
28212821
elif model.surfaceplant.enduse_option.value in [EndUseOptions.COGENERATION_TOPPING_EXTRA_HEAT,
28222822
EndUseOptions.COGENERATION_TOPPING_EXTRA_ELECTRICITY,

src/geophires_x/EconomicsAddOns.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,51 +46,62 @@ def __init__(self, model: Model):
4646
self.MyClass = sclass.replace("\'>", "")
4747
self.MyPath = os.path.abspath(__file__)
4848

49+
def multi_addon_tooltip_text(param_name: str) -> str:
50+
return (f'If using multiple add-ons: either (1) specify this value as an array or '
51+
f'(2) use multiple parameters suffixed with a number '
52+
f'e.g. \'{param_name} 1\', \'{param_name} 2\', etc.')
53+
4954
self.AddOnNickname = self.ParameterDict[self.AddOnNickname.Name] = listParameter(
5055
"AddOn Nickname",
5156
UnitType=Units.NONE,
5257
Min=0.0,
53-
Max=1000.0
58+
Max=1000.0,
59+
ToolTipText=multi_addon_tooltip_text("AddOn Nickname")
5460
)
5561
self.AddOnCAPEX = self.ParameterDict[self.AddOnCAPEX.Name] = listParameter(
5662
"AddOn CAPEX",
5763
Min=0.0,
5864
Max=1000.0,
5965
UnitType=Units.CURRENCY,
6066
PreferredUnits=CurrencyUnit.MDOLLARS,
61-
CurrentUnits=CurrencyUnit.MDOLLARS
67+
CurrentUnits=CurrencyUnit.MDOLLARS,
68+
ToolTipText=multi_addon_tooltip_text("AddOn CAPEX")
6269
)
6370
self.AddOnOPEXPerYear = self.ParameterDict[self.AddOnOPEXPerYear.Name] = listParameter(
6471
"AddOn OPEX",
6572
Min=0.0,
6673
Max=1000.0,
6774
UnitType=Units.CURRENCYFREQUENCY,
6875
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
69-
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR
76+
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
77+
ToolTipText=f'Annual operating cost. {multi_addon_tooltip_text("AddOn OPEX")}'
7078
)
7179
self.AddOnElecGainedPerYear = self.ParameterDict[self.AddOnElecGainedPerYear.Name] = listParameter(
7280
"AddOn Electricity Gained",
7381
Min=0.0,
7482
Max=1000.0,
7583
UnitType=Units.ENERGYFREQUENCY,
7684
PreferredUnits=EnergyFrequencyUnit.KWPERYEAR,
77-
CurrentUnits=EnergyFrequencyUnit.KWPERYEAR
85+
CurrentUnits=EnergyFrequencyUnit.KWPERYEAR,
86+
ToolTipText=f'Annual electricity gained. {multi_addon_tooltip_text("AddOn Electricity Gained")}'
7887
)
7988
self.AddOnHeatGainedPerYear = self.ParameterDict[self.AddOnHeatGainedPerYear.Name] = listParameter(
8089
"AddOn Heat Gained",
8190
Min=0.0,
8291
Max=1000.0,
8392
UnitType=Units.ENERGYFREQUENCY,
8493
PreferredUnits=EnergyFrequencyUnit.KWPERYEAR,
85-
CurrentUnits=EnergyFrequencyUnit.KWPERYEAR
94+
CurrentUnits=EnergyFrequencyUnit.KWPERYEAR,
95+
ToolTipText=f'Annual heat gained. {multi_addon_tooltip_text("AddOn Heat Gained")}'
8696
)
8797
self.AddOnProfitGainedPerYear = self.ParameterDict[self.AddOnProfitGainedPerYear.Name] = listParameter(
8898
"AddOn Profit Gained",
8999
Min=0.0,
90100
Max=1000.0,
91101
UnitType=Units.CURRENCYFREQUENCY,
92102
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
93-
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR
103+
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
104+
ToolTipText=f'Annual profit gained. {multi_addon_tooltip_text("AddOn Profit Gained")}'
94105
)
95106

96107
# local variables that need initialization
@@ -99,7 +110,7 @@ def __init__(self, model: Model):
99110
"AddOn CAPEX Total",
100111
UnitType=Units.CURRENCY,
101112
PreferredUnits=CurrencyUnit.MDOLLARS,
102-
CurrentUnits=CurrencyUnit.MDOLLARS
113+
CurrentUnits=CurrencyUnit.MDOLLARS,
103114
)
104115
self.AddOnOPEXTotalPerYear = self.OutputParameterDict[self.AddOnOPEXTotalPerYear.Name] = OutputParameter(
105116
"AddOn OPEX Total Per Year",
@@ -242,7 +253,7 @@ def read_parameters(self, model: Model) -> None:
242253
if key.startswith("AddOn Profit Gained"):
243254
val = float(model.InputParameters[key].sValue)
244255
self.AddOnProfitGainedPerYear.value.append(val) # this assumes they put the values in the file in consecutive fashion
245-
model.logger.info("complete " + str(__class__) + ": " + sys._getframe().f_code.co_name)
256+
model.logger.info(f"complete {__class__!s}: {sys._getframe().f_code.co_name}")
246257

247258
def Calculate(self, model: Model) -> None:
248259
"""

0 commit comments

Comments
 (0)