Skip to content

Commit 785b960

Browse files
Merge pull request NREL#253 from softwareengineerprogrammer/main
Coverage Badge using Coveralls; license & code style badges; README updates
2 parents 21bc007 + de55da1 commit 785b960

File tree

9 files changed

+141
-409
lines changed

9 files changed

+141
-409
lines changed

.cookiecutterrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ default_context:
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

README.rst

Lines changed: 86 additions & 81 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|
@@ -55,7 +59,17 @@ Free software: `MIT license <LICENSE>`__
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/softwareengineerprogrammer/GEOPHIRES-X/badge.svg?branch=main
63+
:target: https://coveralls.io/github/softwareengineerprogrammer/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
@@ -72,11 +86,22 @@ The short URL `bit.ly/GEOPHIRES <https://bit.ly/GEOPHIRES>`__ redirects to the s
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,33 @@ 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`` and corresponding ``.out`` files are available in the `tests/examples directory of the repository <tests/examples>`__:
258+
259+
- `example1.txt <tests/examples/example1.txt>`__ / `example1.out <tests/examples/example1.out>`__
260+
- `example1_addons.txt <tests/examples/example1_addons.txt>`__ / `example1_addons.out <tests/examples/example1_addons.out>`__
261+
- `example2.txt <tests/examples/example2.txt>`__ / `example2.out <tests/examples/example2.out>`__
262+
- `example3.txt <tests/examples/example3.txt>`__ / `example3.out <tests/examples/example3.out>`__
263+
- `example4.txt <tests/examples/example4.txt>`__ / `example4.out <tests/examples/example4.out>`__
264+
- `example5.txt <tests/examples/example5.txt>`__ / `example5.out <tests/examples/example5.out>`__
265+
- `example8.txt <tests/examples/example8.txt>`__ / `example8.out <tests/examples/example8.out>`__
266+
- `example9.txt <tests/examples/example9.txt>`__ / `example9.out <tests/examples/example9.out>`__
267+
- `example10_HP.txt <tests/examples/example10_HP.txt>`__ / `example10_HP.out <tests/examples/example10_HP.out>`__
268+
- `example11_AC.txt <tests/examples/example11_AC.txt>`__ / `example11_AC.out <tests/examples/example11_AC.out>`__
269+
- `example12_DH.txt <tests/examples/example12_DH.txt>`__ / `example12_DH.out <tests/examples/example12_DH.out>`__
270+
- `example13.txt <tests/examples/example13.txt>`__ / `example13.out <tests/examples/example13.out>`__
271+
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt>`__ / `Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out>`__
272+
- `Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt>`__ / `Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out>`__
273+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt>`__ / `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out>`__
274+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt>`__ / `Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out>`__
275+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt>`__ / `Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out>`__
276+
- `Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt>`__ / `Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out <tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out>`__
277+
- `SUTRAExample1.txt <tests/examples/SUTRAExample1.txt>`__ / `SUTRAExample1.out <tests/examples/SUTRAExample1.out>`__
278+
- `example_multiple_gradients.txt <tests/examples/example_multiple_gradients.txt>`__ / `example_multiple_gradients.out <tests/examples/example_multiple_gradients.out>`__
279+
- `Fervo_Norbeck_Latimer_2023.txt <tests/examples/Fervo_Norbeck_Latimer_2023.txt>`__ / `Fervo_Norbeck_Latimer_2023.out <tests/examples/Fervo_Norbeck_Latimer_2023.out>`__
280+
- `example_SHR-1.txt <tests/examples/example_SHR-1.txt>`__ / `example_SHR-1.out <tests/examples/example_SHR-1.out>`__
281+
- `example_SHR-2.txt <tests/examples/example_SHR-2.txt>`__ / `example_SHR-2.out <tests/examples/example_SHR-2.out>`__
282+
283+
An interactive table of examples is available at `gtp.scientificwebservices.com/geophires <https://gtp.scientificwebservices.com/geophires>`__, under the Examples tab.
279284

280285
Parameters
281286
----------
@@ -294,8 +299,8 @@ Monte Carlo
294299

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

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

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

src/geophires_x/Economics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def __init__(self, model: Model):
614614
ValuesEnum=EconomicModel,
615615
Required=True,
616616
ErrMessage="assume default economic model (2)",
617-
ToolTipText="Specify the economic model to calculate the levelized cost of energy." +
617+
ToolTipText="Specify the economic model to calculate the levelized cost of energy. " +
618618
'; '.join([f'{it.int_value}: {it.value}' for it in EconomicModel])
619619
)
620620
self.ccstimfixed = self.ParameterDict[self.ccstimfixed.Name] = floatParameter(

0 commit comments

Comments
 (0)