Skip to content

Commit 5b5e346

Browse files
Merge pull request NREL#244 from softwareengineerprogrammer/main
MIscellaneous minor fixes/improvements [v3.4.38]
2 parents 012bec4 + df7febe commit 5b5e346

24 files changed

+187
-103
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.4.36
2+
current_version = 3.4.38
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.4.36
57+
version: 3.4.38
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Free software: `MIT license <LICENSE>`__
4747
:alt: Supported implementations
4848
:target: https://pypi.org/project/geophires-x
4949

50-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.4.36.svg
50+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.4.38.svg
5151
:alt: Commits since latest release
52-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.36...main
52+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.38...main
5353

5454
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
5555
:target: https://nrel.github.io/GEOPHIRES-X

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
source_suffix = ['.rst', '.md']
1616
master_doc = 'index'
1717
project = 'geophires-x'
18-
year = '2023'
18+
year = '2024'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.4.36'
21+
version = release = '3.4.38'
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.4.36',
16+
version='3.4.38',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(

src/geophires_x/AGSOutputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def PrintOutputs(self, model: Model):
6161
f = scipy.interpolate.interp1d(np.arange(0, len(model.wellbores.PumpingPower.value)),
6262
model.wellbores.PumpingPower.value, fill_value="extrapolate")
6363
model.wellbores.PumpingPower.value = f(np.arange(0, len(model.wellbores.ProducedTemperature.value), 1.0))
64-
if model.surfaceplant.enduse_option.value != EndUseOptions.HEAT:
64+
if model.surfaceplant.enduse_option.value is not EndUseOptions.HEAT:
6565
if len(model.wellbores.PumpingPower.value) != len(model.wellbores.ProducedTemperature.value):
6666
f = scipy.interpolate.interp1d(np.arange(0, len(model.wellbores.PumpingPower.value)),
6767
model.wellbores.PumpingPower.value, fill_value="extrapolate")

src/geophires_x/Economics.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -994,23 +994,7 @@ def __init__(self, model: Model):
994994
UnitType=Units.NONE,
995995
ErrMessage="assume default well drilling cost correlation (10)",
996996
ToolTipText="Select the built-in well drilling and completion cost correlation: " +
997-
"1. vertical small diameter, baseline; " +
998-
"2. deviated small diameter, baseline; " +
999-
"3. vertical large diameter, baseline; " +
1000-
"4. deviated large diameter, baseline; " +
1001-
"5. Simple; " +
1002-
"6. vertical small diameter, intermediate1; " +
1003-
"7. vertical small diameter, intermediate2; " +
1004-
"8. deviated small diameter, intermediate1; " +
1005-
"9. deviated small diameter, intermediate2; " +
1006-
"10. vertical large diameter, intermediate1; " +
1007-
"11. vertical large diameter, intermediate2; " +
1008-
"12. deviated large diameter, intermediate1; " +
1009-
"13. deviated large diameter, intermediate2; " +
1010-
"14. vertical open-hole, small diameter, ideal; " +
1011-
"15. deviated liner, small diameter, ideal; " +
1012-
"16. vertical open-hole, large diameter, ideal; " +
1013-
"17. deviated liner, large diameter, ideal"
997+
'; '.join([f'{it.numerical_input_value}: {it.value}' for it in WellDrillingCostCorrelation])
1014998
)
1015999

10161000
self.DoAddOnCalculations = self.ParameterDict[self.DoAddOnCalculations.Name] = boolParameter(

src/geophires_x/EconomicsAddOns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ def Calculate(self, model: Model) -> None:
279279
# so we need to update them here so when they get used in the final economic calculation (below),
280280
# the new values reflect the addition of the AddOns
281281
for i in range(0, model.surfaceplant.plant_lifetime.value):
282-
if model.surfaceplant.enduse_option.value != EndUseOptions.HEAT: # all these end-use options have an electricity generation component
282+
if model.surfaceplant.enduse_option.value is not EndUseOptions.HEAT: # all these end-use options have an electricity generation component
283283
model.surfaceplant.TotalkWhProduced.value[i] = model.surfaceplant.TotalkWhProduced.value[i] + self.AddOnElecGainedTotalPerYear.value
284284
model.surfaceplant.NetkWhProduced.value[i] = model.surfaceplant.NetkWhProduced.value[i] + self.AddOnElecGainedTotalPerYear.value
285-
if model.surfaceplant.enduse_option.value != EndUseOptions.ELECTRICITY:
285+
if model.surfaceplant.enduse_option.value is not EndUseOptions.ELECTRICITY:
286286
model.surfaceplant.HeatkWhProduced.value[i] = model.surfaceplant.HeatkWhProduced.value[i] + self.AddOnHeatGainedTotalPerYear.value
287287
else:
288288
# all the end-use option of direct-use only components have a heat generation component

src/geophires_x/EconomicsS_DAC_GT.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,13 @@ def Calculate(self, model: Model) -> None:
654654
# some (all) of it to do the capture, so when they get used in the final economic calculation (below),
655655
# the new values reflect the impact of S-DAC-GT
656656
for i in range(0, model.surfaceplant.plant_lifetime.value):
657-
if model.surfaceplant.enduse_option.value != EndUseOptions.HEAT:
657+
if model.surfaceplant.enduse_option.value is not EndUseOptions.HEAT:
658658
# all these end-use options have an electricity generation component
659659
model.surfaceplant.TotalkWhProduced.value[i] = model.surfaceplant.TotalkWhProduced.value[i] - (
660660
self.CarbonExtractedAnnually.value[i] * self.elec.value)
661661
model.surfaceplant.NetkWhProduced.value[i] = model.surfaceplant.NetkWhProduced.value[i] - (
662662
self.CarbonExtractedAnnually.value[i] * self.elec.value)
663-
if model.surfaceplant.enduse_option.value != EndUseOptions.ELECTRICITY:
663+
if model.surfaceplant.enduse_option.value is not EndUseOptions.ELECTRICITY:
664664
model.surfaceplant.HeatkWhProduced.value[i] = model.surfaceplant.HeatkWhProduced.value[i] - (
665665
self.CarbonExtractedAnnually.value[i] * self.therm.value)
666666
else:

src/geophires_x/GEOPHIRESv3.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import logging.config
66
import os
77
import sys
8+
from pathlib import Path
9+
810
import geophires_x.Model as Model
911
import geophires_x.OptionList as OptionList
1012

@@ -61,9 +63,9 @@ def main(enable_geophires_logging_config=True):
6163

6264
json_outputfile = 'HDR.json'
6365
if len(sys.argv) > 2:
64-
json_outputfile = str(sys.argv[2])
65-
segs = json_outputfile.split('.')
66-
json_outputfile = segs[0] + '.json'
66+
output_arg = str(sys.argv[2])
67+
output_arg_path = Path(output_arg)
68+
json_outputfile = output_arg.replace(output_arg_path.name, f'{output_arg_path.stem}.json')
6769
with open(json_outputfile, 'w', encoding='UTF-8') as f:
6870
f.write(json.dumps(json_merged))
6971

0 commit comments

Comments
 (0)