Skip to content

Commit 9076e2f

Browse files
authored
Merge branch 'NREL:main' into main
2 parents 3ead530 + 95e2122 commit 9076e2f

Some content is hidden

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

45 files changed

+1491
-1312
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.38
2+
current_version = 3.5.2
33
commit = True
44
tag = True
55

.cookiecutterrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ default_context:
5454
sphinx_doctest: "no"
5555
sphinx_theme: "sphinx-py3doc-enhanced-theme"
5656
test_matrix_separate_coverage: "no"
57-
version: 3.4.38
57+
version: 3.5.2
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"
61-
year_to: "2023"
61+
year_to: "2024"

.github/workflows/github-actions.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,37 @@ jobs:
122122
run: >
123123
tox -e ${{ matrix.tox_env }} -v
124124
125+
coveralls:
126+
name: Upload coverage to Coveralls
127+
if: github.ref == 'refs/heads/main' # Prevent from running on PRs, tags
128+
needs: test
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
with:
133+
fetch-depth: 0
134+
- uses: actions/setup-python@v5
135+
with:
136+
python-version: '3.11'
137+
architecture: 'x64'
138+
- name: install dependencies
139+
run: |
140+
python -mpip install --upgrade pip
141+
python -mpip install --progress-bar=off -r ci/requirements.txt
142+
virtualenv --version
143+
pip --version
144+
tox --version
145+
pip list --format=freeze
146+
- name: generate coverage report
147+
env:
148+
TOXPYTHON: '3.11'
149+
run: |
150+
tox -e py311
151+
152+
- name: Coveralls GitHub Action
153+
uses: coverallsapp/[email protected]
154+
155+
125156
deploy_docs:
126157
name: Deploy docs to GitHub Pages
127158
if: github.ref == 'refs/heads/main' # Prevent from running on PRs, tags

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ Changelog
55
GEOPHIRES-X (2023-2024)
66
------------------------
77

8+
3.5
9+
^^^
10+
11+
`release <https://github.com/NREL/GEOPHIRES-X/releases/tag/v3.5.0>`__ | `diff <https://github.com/NREL/GEOPHIRES-X/compare/v3.4.0...v3.5.0>`__
12+
13+
Milestone version for case studies, SHR temperatures, and other changes since 3.0.
14+
815
3.4
916
^^^
1017

README.rst

Lines changed: 145 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ Free software: `MIT license <LICENSE>`__
2020

2121
* - tests
2222
- | |github-actions|
23+
| |coverage|
2324
* - package
2425
- | |commits-since|
26+
| |code-style|
27+
| |license|
28+
2529
.. TODO add the following to package badge list once PyPy distribution enabled: |version| |wheel| |supported-versions| |supported-implementations|
2630
.. * - docs
2731
.. - | |docs|
@@ -47,15 +51,25 @@ Free software: `MIT license <LICENSE>`__
4751
:alt: Supported implementations
4852
:target: https://pypi.org/project/geophires-x
4953

50-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.4.38.svg
54+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.5.2.svg
5155
:alt: Commits since latest release
52-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.38...main
56+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.5.2...main
5357

5458
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
5559
:target: https://nrel.github.io/GEOPHIRES-X
5660
:alt: Documentation Status
5761

58-
.. TODO coverage badge https://github.com/NREL/GEOPHIRES-Xx/issues/22
62+
.. |coverage| image:: https://coveralls.io/repos/github/NREL/GEOPHIRES-X/badge.svg?branch=main
63+
:target: https://coveralls.io/github/NREL/GEOPHIRES-X?branch=main
64+
:alt: Coverage Status
65+
66+
.. |code-style| image:: https://img.shields.io/badge/code%20style-black-000000.svg
67+
:target: https://github.com/NREL/GEOPHIRES-X/blob/main/.pre-commit-config.yaml
68+
:alt: Code Style: black
69+
70+
.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg
71+
:target: https://github.com/NREL/GEOPHIRES-X/blob/main/LICENSE
72+
:alt: MIT license
5973

6074
.. end-badges
6175
@@ -65,18 +79,29 @@ Getting Started
6579
Web Interface
6680
-------------
6781

68-
A web interface is available at `scientificwebservices.com/tools/geophires <https://scientificwebservices.com/tools/geophires>`__.
82+
A web interface is available at `gtp.scientificwebservices.com/geophires <https://gtp.scientificwebservices.com/geophires>`__.
6983

70-
The short URL `bit.ly/GEOPHIRES <https://bit.ly/GEOPHIRES>`__ redirects to the same location.
84+
The short URL `bit.ly/geophires <https://bit.ly/geophires>`__ redirects to the same location.
7185

7286
Installation
7387
------------
7488

89+
Pip Package
90+
^^^^^^^^^^^
91+
92+
If you do not need to view or edit GEOPHIRES-X source code, you can consume GEOPHIRES-X as a regular, non-editable python package::
93+
94+
pip3 install https://github.com/NREL/GEOPHIRES-X/archive/main.zip
95+
96+
97+
.. (Eventually package will be published to PyPi, enabling ``pip install geophires-x``)
98+
99+
75100
Editable Installation (Recommended)
76101
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77102

78103
An editable installation is recommended for most users. It will allow you to run GEOPHIRES-X locally,
79-
view its python files in an IDE or text editor,
104+
view its Python files in an IDE or text editor,
80105
and create your own extensions as described in `How to extend GEOPHIRES-X <docs/How-to-extend-GEOPHIRES-X.md#how-to-extend-geophires-x>`__.
81106

82107
Prerequisites:
@@ -128,15 +153,6 @@ To update the editable installation with the latest GEOPHIRES version::
128153
# resolve merge conflicts, if any
129154
pip install -e .
130155

131-
Pip Package
132-
^^^^^^^^^^^
133-
134-
If you do not need to view or edit GEOPHIRES-X source code, you can consume GEOPHIRES-X as a regular, non-editable python package::
135-
136-
pip3 install https://github.com/NREL/GEOPHIRES-X/archive/main.zip
137-
138-
139-
.. (Eventually package will be published to PyPi, enabling ``pip install geophires-x``)
140156

141157

142158
Usage
@@ -155,52 +171,10 @@ Example usage in Python:
155171
client = GeophiresXClient()
156172
result = client.get_geophires_result(
157173
GeophiresInputParameters({
158-
"Reservoir Model": 1,
159-
"Reservoir Depth": 3,
160-
"Number of Segments": 1,
161-
"Gradient 1": 50,
162-
"Number of Production Wells": 2,
163-
"Number of Injection Wells": 2,
164-
"Production Well Diameter": 7,
165-
"Injection Well Diameter": 7,
166-
"Ramey Production Wellbore Model": 1,
167-
"Production Wellbore Temperature Drop": .5,
168-
"Injection Wellbore Temperature Gain": 0,
169-
"Production Flow Rate per Well": 55,
170-
"Fracture Shape": 3,
171-
"Fracture Height": 900,
172-
"Reservoir Volume Option": 3,
173-
"Number of Fractures": 20,
174-
"Reservoir Volume": 1000000000,
175-
"Water Loss Fraction": .02,
176-
"Productivity Index": 5,
177-
"Injectivity Index": 5,
178-
"Injection Temperature": 50,
179-
"Maximum Drawdown": 1,
180-
"Reservoir Heat Capacity": 1000,
181-
"Reservoir Density": 2700,
182-
"Reservoir Thermal Conductivity": 2.7,
183-
"End-Use Option": 1,
184-
"Power Plant Type": 2,
185-
"Circulation Pump Efficiency": .8,
186-
"Utilization Factor": .9,
187-
"Surface Temperature": 20,
188-
"Ambient Temperature": 20,
189-
"Plant Lifetime": 30,
190-
"Economic Model": 1,
191-
"Fixed Charge Rate": .05,
192-
"Inflation Rate During Construction": 0,
193-
"Well Drilling and Completion Capital Cost Adjustment Factor": 1,
194-
"Well Drilling Cost Correlation": 1,
195-
"Reservoir Stimulation Capital Cost Adjustment Factor": 1,
196-
"Surface Plant Capital Cost Adjustment Factor": 1,
197-
"Field Gathering System Capital Cost Adjustment Factor": 1,
198-
"Exploration Capital Cost Adjustment Factor": 1,
199-
"Wellfield O&M Cost Adjustment Factor": 1,
200-
"Surface Plant O&M Cost Adjustment Factor": 1,
201-
"Water Cost Adjustment Factor": 1,
202-
"Print Output to Console": 1,
203-
"Time steps per year": 6
174+
"Gradient 1": "69",
175+
"Reservoir Depth": "5",
176+
"End-Use Option": "1",
177+
"Power Plant Type": "4"
204178
})
205179
)
206180
@@ -211,6 +185,32 @@ If you followed the editable installation example above, put this code in ``my-g
211185

212186
python main.py
213187

188+
You will then see output including a case report::
189+
190+
(venv) ➜ my-geophires-project python main.py
191+
No valid plant outlet pressure provided. GEOPHIRES will assume default plant outlet pressure (100 kPa)
192+
No valid plant outlet pressure provided. GEOPHIRES will assume default plant outlet pressure (100 kPa)
193+
194+
*****************
195+
***CASE REPORT***
196+
*****************
197+
198+
Simulation Metadata
199+
----------------------
200+
GEOPHIRES Version: 3.4.42
201+
Simulation Date: 2024-07-08
202+
Simulation Time: 10:07
203+
Calculation Time: 0.047 sec
204+
205+
***SUMMARY OF RESULTS***
206+
207+
End-Use Option: Electricity
208+
Average Net Electricity Production: 23.94 MW
209+
Electricity breakeven price: 5.04 cents/kWh
210+
211+
[...]
212+
213+
214214
You may also pass parameters as a text file:
215215

216216
.. code:: python
@@ -254,28 +254,88 @@ Documentation
254254
Examples
255255
--------
256256

257-
A variety of example input ``.txt`` files are available in the `tests/examples directory of the repository <tests/examples>`__:
258-
259-
- `example1.txt <tests/examples/example1.txt>`__
260-
- `example1_addons.txt <tests/examples/example1_addons.txt>`__
261-
- `example2.txt <tests/examples/example2.txt>`__
262-
- `example3.txt <tests/examples/example3.txt>`__
263-
- `example4.txt <tests/examples/example4.txt>`__
264-
- `example5.txt <tests/examples/example5.txt>`__
265-
- `example8.txt <tests/examples/example8.txt>`__
266-
- `example9.txt <tests/examples/example9.txt>`__
267-
- `example10_HP.txt <tests/examples/example10_HP.txt>`__
268-
- `example11_AC.txt <tests/examples/example11_AC.txt>`__
269-
- `example12_DH.txt <tests/examples/example12_DH.txt>`__
270-
- `example13.txt <tests/examples/example13.txt>`__
271-
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt>`__
272-
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt>`__
273-
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt>`__
274-
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt>`__
275-
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt>`__
276-
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt>`__
277-
- `SUTRAExample1.txt <tests/examples/SUTRAExample1.txt>`__
278-
- `example_multiple_gradients.txt <tests/examples/example_multiple_gradients.txt>`__
257+
A variety of example input ``.txt`` files and corresponding case report ``.out`` files are available in the `tests/examples directory of the repository <tests/examples>`__:
258+
259+
260+
.. list-table::
261+
:widths: 50 40 10
262+
:header-rows: 1
263+
264+
* - Example
265+
- Input file
266+
- Case report file
267+
* - Example 1
268+
- `example1.txt <tests/examples/example1.txt>`__
269+
- `example1.out <tests/examples/example1.out>`__
270+
* - Example 1 with Addons
271+
- `example1_addons.txt <tests/examples/example1_addons.txt>`__
272+
- `example1_addons.out <tests/examples/example1_addons.out>`__
273+
* - Example 2
274+
- `example2.txt <tests/examples/example2.txt>`__
275+
- `example2.out <tests/examples/example2.out>`__
276+
* - Example 3
277+
- `example3.txt <tests/examples/example3.txt>`__
278+
- `example3.out <tests/examples/example3.out>`__
279+
* - Example 4
280+
- `example4.txt <tests/examples/example4.txt>`__
281+
- `example4.out <tests/examples/example4.out>`__
282+
* - Example 5
283+
- `example5.txt <tests/examples/example5.txt>`__
284+
- `example5.out <tests/examples/example5.out>`__
285+
* - Example 8
286+
- `example8.txt <tests/examples/example8.txt>`__
287+
- `example8.out <tests/examples/example8.out>`__
288+
* - Example 9
289+
- `example9.txt <tests/examples/example9.txt>`__
290+
- `example9.out <tests/examples/example9.out>`__
291+
* - Example 10: Heat Pump
292+
- `example10_HP.txt <tests/examples/example10_HP.txt>`__
293+
- `example10_HP.out <tests/examples/example10_HP.out>`__
294+
* - Example 11: Absorption Chiller
295+
- `example11_AC.txt <tests/examples/example11_AC.txt>`__
296+
- `example11_AC.out <tests/examples/example11_AC.out>`__
297+
* - Example 12: District Heating
298+
- `example12_DH.txt <tests/examples/example12_DH.txt>`__
299+
- `example12_DH.out <tests/examples/example12_DH.out>`__
300+
* - Example 13
301+
- `example13.txt <tests/examples/example13.txt>`__
302+
- `example13.out <tests/examples/example13.out>`__
303+
* - AGS: Coaxial sCO2: Heat (Beckers et. al 2023)
304+
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt>`__
305+
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out>`__
306+
* - AGS: Coaxial Water: Heat (Beckers et. al 2023)
307+
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt>`__
308+
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out>`__
309+
* - AGS: Uloop sCO2: Electricity (Beckers et. al 2023)
310+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt>`__
311+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out>`__
312+
* - AGS: Uloop sCO2: Heat (Beckers et. al 2023)
313+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt>`__
314+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out>`__
315+
* - AGS: Uloop Water: Electricity (Beckers et. al 2023)
316+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt>`__
317+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out>`__
318+
* - CLGS: Uloop Water: Heat (Beckers et. al 2023)
319+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt>`__
320+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out>`__
321+
* - SUTRA Example 1
322+
- `SUTRAExample1.txt <tests/examples/SUTRAExample1.txt>`__
323+
- `SUTRAExample1.out <tests/examples/SUTRAExample1.out>`__
324+
* - Multiple Gradients
325+
- `example_multiple_gradients.txt <tests/examples/example_multiple_gradients.txt>`__
326+
- `example_multiple_gradients.out <tests/examples/example_multiple_gradients.out>`__
327+
* - Fervo Energy Whitepaper (Norbeck J.H. and Latimer T.M. 2023.)
328+
- `Fervo_Norbeck_Latimer_2023.txt <tests/examples/Fervo_Norbeck_Latimer_2023.txt>`__
329+
- `Fervo_Norbeck_Latimer_2023.out <tests/examples/Fervo_Norbeck_Latimer_2023.out>`__
330+
* - Superhot Rock (SHR) Example 1
331+
- `example_SHR-1.txt <tests/examples/example_SHR-1.txt>`__
332+
- `example_SHR-1.out <tests/examples/example_SHR-1.out>`__
333+
* - Superhot Rock (SHR) Example 2
334+
- `example_SHR-2.txt <tests/examples/example_SHR-2.txt>`__
335+
- `example_SHR-2.out <tests/examples/example_SHR-2.out>`__
336+
337+
338+
An interactive table of examples is available at `gtp.scientificwebservices.com/geophires <https://gtp.scientificwebservices.com/geophires>`__, under the Examples tab.
279339

280340
Parameters
281341
----------
@@ -294,8 +354,8 @@ Monte Carlo
294354

295355
`Monte Carlo User Guide <https://softwareengineerprogrammer.github.io/GEOPHIRES-X/Monte-Carlo-User-Guide.html>`__
296356

297-
Other Documentation:
298-
--------------------
357+
Additional Documentation
358+
------------------------
299359
The `GEOPHIRES v2.0 (previous version's) user manual <References/GEOPHIRES%20v2.0%20User%20Manual.pdf>`__ describes GEOPHIRES's high-level software architecture.
300360

301361
Theoretical basis for GEOPHIRES: `GEOPHIRES v2.0: updated geothermal techno‐economic simulation tool <References/Beckers%202019%20GEOPHIRES%20v2.pdf>`__

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.4.38'
21+
version = release = '3.5.2'
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.38',
16+
version='3.5.2',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(

src/geophires_x/AGSEconomics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def Calculate(self, model: Model) -> None:
183183
"""
184184
model.logger.info(f'Init {__class__!s}: {sys._getframe().f_code.co_name}')
185185

186-
if self.econmodel.value != EconomicModel.CLGS: # do a classical econ calculation
186+
if self.econmodel.value is not EconomicModel.CLGS: # do a classical econ calculation
187187
super().Calculate(model)
188188
else:
189189
# use the CLGS-Style economic calculations

0 commit comments

Comments
 (0)