Skip to content

Commit 487e393

Browse files
Merge pull request NREL#297 from softwareengineerprogrammer/main
Fix "Total Nonvertical Length" parameter name; HIP-RA-X unitless result field parsing
2 parents ee74e22 + 3ca3b25 commit 487e393

16 files changed

+165
-20
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.5.5
2+
current_version = 3.5.7
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.5.5
57+
version: 3.5.7
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ requirements.txt
1414
*.lock
1515
*.json
1616
all_messages_conf.log
17+
HDR.out
1718

1819
# C extensions
1920
*.so

README.rst

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

54-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.5.5.svg
54+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.5.7.svg
5555
:alt: Commits since latest release
56-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.5.5...main
56+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.5.7...main
5757

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

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
year = '2024'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.5.5'
21+
version = release = '3.5.7'
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.5.5',
16+
version='3.5.7',
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ def PrintOutputs(self, model: Model):
222222

223223
except BaseException as ex:
224224
tb = sys.exc_info()[2]
225+
msg = "Error: GEOPHIRES Failed to write the output file. Exiting....Line %i" % tb.tb_lineno
225226
print(str(ex))
226-
print("Error: GEOPHIRES Failed to write the output file. Exiting....Line %i" % tb.tb_lineno)
227+
print(msg)
227228
model.logger.critical(str(ex))
228-
model.logger.critical(
229-
"Error: GEOPHIRES Failed to write the output file. Exiting....Line %i" % tb.tb_lineno)
229+
model.logger.critical(msg)
230230
traceback.print_exc()
231-
sys.exit()
231+
raise RuntimeError(msg)
232232

233233
model.logger.info(f'Complete {str(__class__)}: {sys._getframe().f_code.co_name}')

src/geophires_x/Parameter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ def _parameter_with_currency_units_converted_back_to_preferred_units(param: Para
731731

732732
else:
733733
raise AttributeError(
734-
f'Unit/unit type ({param.CurrentUnits}/{param.UnitType} for {param.Name} '
734+
f'Unit/unit type ({param.CurrentUnits}/{param.UnitType}) for {param.Name} '
735735
f'is not a recognized currency unit'
736736
)
737737

src/geophires_x/WellBores.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,15 +1004,15 @@ def __init__(self, model: Model):
10041004

10051005
# Input data for subsurface condition
10061006
self.Nonvertical_length = self.ParameterDict[self.Nonvertical_length.Name] = floatParameter(
1007-
"Total Nonvertical Length",
1007+
"Nonvertical Length per Multilateral Section",
10081008
DefaultValue=1000.0,
10091009
Min=50.0,
10101010
Max=20000.0,
10111011
UnitType=Units.LENGTH,
10121012
PreferredUnits=LengthUnit.METERS,
10131013
CurrentUnits=LengthUnit.METERS,
10141014
Required=True,
1015-
ErrMessage="assume default Total nonvertical length (1000 m)"
1015+
ErrMessage="assume default Nonvertical Length per Multilateral Section (1000 m)"
10161016
)
10171017

10181018
self.nonverticalwellborediameter = self.ParameterDict[self.nonverticalwellborediameter.Name] = floatParameter(
@@ -1228,7 +1228,26 @@ def read_parameters(self, model: Model) -> None:
12281228
# and if you do, do it before or after you call you own version of this method. If you do, you can also choose
12291229
# to call this method from you class, which can modify all these superclass parameters in your class.
12301230

1231+
12311232
if len(model.InputParameters) > 0:
1233+
1234+
# See https://github.com/NREL/GEOPHIRES-X/issues/278?title=Total+Nonvertical+Length+is+actually+per+section
1235+
deprecated_nonvertical_length_param_name = 'Total Nonvertical Length'
1236+
if deprecated_nonvertical_length_param_name in model.InputParameters:
1237+
model.logger.warning(
1238+
f'"{deprecated_nonvertical_length_param_name}" parameter name is deprecated, '
1239+
f'use "{self.Nonvertical_length.Name}" instead')
1240+
1241+
if self.Nonvertical_length.Name not in model.InputParameters:
1242+
model.InputParameters[self.Nonvertical_length.Name] = model.InputParameters[
1243+
deprecated_nonvertical_length_param_name]
1244+
else:
1245+
model.logger.warning(
1246+
f'Ignoring value of "{deprecated_nonvertical_length_param_name}" '
1247+
f'because it is set by "{self.Nonvertical_length.Name}" instead')
1248+
1249+
del model.InputParameters[deprecated_nonvertical_length_param_name]
1250+
12321251
# loop through all the parameters that the user wishes to set, looking for parameters that match this object
12331252
for item in self.ParameterDict.items():
12341253
ParameterToModify = item[1]

src/geophires_x/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.5.5'
1+
__version__ = '3.5.7'

0 commit comments

Comments
 (0)