Skip to content

Commit 2b7b816

Browse files
Merge pull request NREL#203 from softwareengineerprogrammer/main
Fervo case study initial parameters & result; new bit.ly interface URL
2 parents a35eecf + d746b50 commit 2b7b816

File tree

13 files changed

+352
-15
lines changed

13 files changed

+352
-15
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.27
2+
current_version = 3.4.28
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.27
57+
version: 3.4.28
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
@@ -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.27.svg
50+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.4.28.svg
5151
:alt: Commits since latest release
52-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.27...main
52+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.28...main
5353

5454
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
5555
:target: https://nrel.github.io/GEOPHIRES-X
@@ -65,7 +65,7 @@ Getting Started
6565
Web Interface
6666
-------------
6767

68-
A web interface is available at `tinyurl.com/geophires <https://tinyurl.com/geophires>`__
68+
A web interface is available at `bit.ly/GEOPHIRES <https://bit.ly/GEOPHIRES>`__
6969

7070
Installation
7171
------------

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
year = '2023'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.4.27'
21+
version = release = '3.4.28'
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.27',
16+
version='3.4.28',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(

src/geophires_monte_carlo/MC_GeoPHIRES3.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,14 @@ def work_package(pass_list: list):
218218
shutil.copyfile(result.output_file_path, tmp_output_file)
219219
elif args.Code_File.endswith('HIP_RA.py'):
220220
hip_ra_client: HipRaClient = HipRaClient()
221-
result: HipRaResult = hip_ra_client.get_hip_ra_result(HipRaInputParameters(from_file_path=Path(tmp_input_file)))
221+
result: HipRaResult = hip_ra_client.get_hip_ra_result(
222+
HipRaInputParameters(file_path_or_params_dict=Path(tmp_input_file))
223+
)
222224
shutil.copyfile(result.output_file_path, tmp_output_file)
223225
elif args.Code_File.endswith('hip_ra_x.py'):
224226
hip_ra_x_client: HipRaXClient = HipRaXClient()
225227
result: HipRaResult = hip_ra_x_client.get_hip_ra_result(
226-
HipRaInputParameters(from_file_path=Path(tmp_input_file))
228+
HipRaInputParameters(file_path_or_params_dict=Path(tmp_input_file))
227229
)
228230
shutil.copyfile(result.output_file_path, tmp_output_file)
229231
else:

src/geophires_x/Reservoir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def __init__(self, model: Model):
286286
self.fracnumb = self.ParameterDict[self.fracnumb.Name] = intParameter(
287287
"Number of Fractures",
288288
DefaultValue=10,
289-
AllowableRange=list(range(1, 21, 1)),
289+
AllowableRange=list(range(1, 150, 1)),
290290
UnitType=Units.NONE,
291291
ErrMessage="assume default number of fractures (10)",
292292
ToolTipText="Number of identical parallel fractures in EGS fracture-based reservoir model."

src/geophires_x/__init__.py

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

src/hip_ra/__init__.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@
44
import tempfile
55
import uuid
66
from pathlib import Path
7+
from typing import Any
78

89
from geophires_x_client.common import _get_logger
910
from hip_ra import HIP_RA
1011

1112

1213
class HipRaInputParameters:
13-
def __init__(self, from_file_path: str):
14-
self._input_file_path = Path(from_file_path)
14+
15+
def __init__(self, file_path_or_params_dict: Any):
16+
if isinstance(file_path_or_params_dict, dict):
17+
tmp_file_path = Path(tempfile.gettempdir(), f'hip-ra-params_{uuid.uuid1()}.txt')
18+
with open(tmp_file_path, 'w') as f:
19+
f.writelines(
20+
[', '.join([str(p) for p in param_item]) + '\n' for param_item in file_path_or_params_dict.items()]
21+
)
22+
file_path_or_params_dict = str(tmp_file_path)
23+
elif not isinstance(file_path_or_params_dict, (str, Path)):
24+
raise ValueError('Provide either file path (as Path or string) or parameters as dict')
25+
26+
self._input_file_path = Path(file_path_or_params_dict)
1527
self._output_file_path = Path(
1628
tempfile.gettempdir(), f'hip-ra-result_{self._input_file_path.stem}_{uuid.uuid1()!s}.out'
1729
)

0 commit comments

Comments
 (0)