diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4e5cf9df..d9e91924 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.6.1 +current_version = 3.6.2 commit = True tag = True diff --git a/.cookiecutterrc b/.cookiecutterrc index b5bb0c1a..e6cb3326 100644 --- a/.cookiecutterrc +++ b/.cookiecutterrc @@ -54,7 +54,7 @@ default_context: sphinx_doctest: "no" sphinx_theme: "sphinx-py3doc-enhanced-theme" test_matrix_separate_coverage: "no" - version: 3.6.1 + version: 3.6.2 version_manager: "bump2version" website: "https://github.com/NREL" year_from: "2023" diff --git a/README.rst b/README.rst index 56d7dd04..2dc95c7a 100644 --- a/README.rst +++ b/README.rst @@ -51,9 +51,9 @@ Free software: `MIT license `__ :alt: Supported implementations :target: https://pypi.org/project/geophires-x -.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.6.1.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.6.2.svg :alt: Commits since latest release - :target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.6.1...main + :target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.6.2...main .. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat :target: https://nrel.github.io/GEOPHIRES-X @@ -357,6 +357,14 @@ Example-specific web interface deeplinks are listed in the Link column. - `Fervo_Project_Cape.txt `__ - `.out `__ - `link `__ + * - Fervo Project Cape 2 + - `Fervo_Project_Cape-2.txt `__ + - `.out `__ + - `link `__ + * - Fervo Project Cape 3 + - `Fervo_Project_Cape-3.txt `__ + - `.out `__ + - `link `__ * - Superhot Rock (SHR) Example 1 - `example_SHR-1.txt `__ - `.out `__ diff --git a/docs/conf.py b/docs/conf.py index a756f774..d3e9b7ae 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ year = '2024' author = 'NREL' copyright = f'{year}, {author}' -version = release = '3.6.1' +version = release = '3.6.2' pygments_style = 'trac' templates_path = ['./templates'] diff --git a/setup.py b/setup.py index ef77bb37..434bc54f 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(*names, **kwargs): setup( name='geophires-x', - version='3.6.1', + version='3.6.2', license='MIT', description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.', long_description='{}\n{}'.format( diff --git a/src/geophires_x/Parameter.py b/src/geophires_x/Parameter.py index f986c870..fd78b1ec 100644 --- a/src/geophires_x/Parameter.py +++ b/src/geophires_x/Parameter.py @@ -19,6 +19,7 @@ from geophires_x.Units import * _ureg = get_unit_registry() +_DISABLE_FOREX_API = True # See https://github.com/NREL/GEOPHIRES-X/issues/236#issuecomment-2414681434 class HasQuantity(ABC): @@ -500,15 +501,19 @@ def ConvertUnits(ParamToModify, strUnit: str, model) -> str: try: # if we come here, we have a currency conversion to do (USD->EUR, etc.). + + if _DISABLE_FOREX_API: + raise RuntimeError('Forex API disabled') + cr = CurrencyRates() conv_rate = cr.get_rate(currShort, prefShort) except BaseException as ex: print(str(ex)) msg = ( - f'Error: GEOPHIRES failed to convert your currency for {ParamToModify.Name} to something it ' - f'understands. You gave {strUnit} - Are these currency units defined for forex-python? or perhaps the ' - f'currency server is down? Please change your units to {ParamToModify.PreferredUnits.value} to ' - f'continue. Cannot continue unless you do. Exiting.' + f'Error: GEOPHIRES failed to convert your currency for {ParamToModify.Name} to something it understands. ' + f'You gave {strUnit} - conversion may be affected by https://github.com/NREL/GEOPHIRES-X/issues/236. ' + f'Please change your units to {ParamToModify.PreferredUnits.value} ' + f'to continue. Cannot continue unless you do. Exiting.' ) print(msg) model.logger.critical(str(ex)) @@ -710,6 +715,9 @@ def _parameter_with_currency_units_converted_back_to_preferred_units(param: Para # start the currency conversion process cc = CurrencyCodes() try: + if _DISABLE_FOREX_API: + raise RuntimeError('Forex API disabled') + cr = CurrencyRates() conv_rate = cr.get_rate(currType, prefType) except BaseException as ex: @@ -966,6 +974,9 @@ def ConvertOutputUnits(oparam: OutputParameter, newUnit: Units, model): raise RuntimeError(msg) try: + if _DISABLE_FOREX_API: + raise RuntimeError('Forex API disabled') + cr = CurrencyRates() conv_rate = cr.get_rate(prefShort, currShort) except BaseException as ex: diff --git a/src/geophires_x/__init__.py b/src/geophires_x/__init__.py index bce59824..575236d7 100644 --- a/src/geophires_x/__init__.py +++ b/src/geophires_x/__init__.py @@ -1 +1 @@ -__version__ = '3.6.1' +__version__ = '3.6.2' diff --git a/tests/examples/example10_HP.out b/tests/examples/example10_HP.out index 05484c4e..3089c326 100644 --- a/tests/examples/example10_HP.out +++ b/tests/examples/example10_HP.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.6.0 + GEOPHIRES Version: 3.6.2 Simulation Date: 2024-10-15 - Simulation Time: 13:08 - Calculation Time: 0.104 sec + Simulation Time: 15:20 + Calculation Time: 0.100 sec ***SUMMARY OF RESULTS*** @@ -29,9 +29,9 @@ Simulation Metadata Accrued financing during construction: 5.00 Project lifetime: 30 yr Capacity factor: 90.0 % - Project NPV: 3.32 MUSD + Project NPV: 11.28 MUSD Project IRR: 8.07 % - Project VIR=PI=PIR: 1.11 + Project VIR=PI=PIR: 1.36 Project MOIC: 1.01 Project Payback Period: 11.96 yr diff --git a/tests/examples/example10_HP.txt b/tests/examples/example10_HP.txt index d1e7c5ee..deb8ffb7 100644 --- a/tests/examples/example10_HP.txt +++ b/tests/examples/example10_HP.txt @@ -51,6 +51,7 @@ Heat Pump COP, 2.8, --- [-] Plant Lifetime,30, ---[years] Economic Model,2, ---BICYCLE Levelized Cost Model Discount Rate, 0.05, --- [-] Required if Standard LCOE/LCOH model is selected. See manual for details. +Fixed Internal Rate, 5, -- matches Discount Rate Inflation Rate During Construction,0.05, ---[-] # ***Capital and O&M Cost Parameters*** diff --git a/tests/examples/example11_AC.out b/tests/examples/example11_AC.out index 4129d7f2..9c205398 100644 --- a/tests/examples/example11_AC.out +++ b/tests/examples/example11_AC.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.6.0 + GEOPHIRES Version: 3.6.2 Simulation Date: 2024-10-15 - Simulation Time: 13:07 - Calculation Time: 0.104 sec + Simulation Time: 15:20 + Calculation Time: 0.099 sec ***SUMMARY OF RESULTS*** @@ -30,9 +30,9 @@ Simulation Metadata Accrued financing during construction: 5.00 Project lifetime: 30 yr Capacity factor: 90.0 % - Project NPV: -0.53 MUSD + Project NPV: 6.22 MUSD Project IRR: 6.82 % - Project VIR=PI=PIR: 0.98 + Project VIR=PI=PIR: 1.21 Project MOIC: 0.83 Project Payback Period: 13.36 yr diff --git a/tests/examples/example11_AC.txt b/tests/examples/example11_AC.txt index ceb9d1cd..434458b6 100644 --- a/tests/examples/example11_AC.txt +++ b/tests/examples/example11_AC.txt @@ -46,6 +46,7 @@ Absorption Chiller COP, 0.72, --- [-] Plant Lifetime,30, ---[years] Economic Model,2, ---BICYCLE Levelized Cost Model Discount Rate, 0.05, --- [-] Required if Standard LCOE/LCOH model is selected. See manual for details. +Fixed Internal Rate, 5, -- matches Discount Rate Inflation Rate During Construction,0.05, ---[-] # ***Capital and O&M Cost Parameters*** diff --git a/tests/examples/example13.out b/tests/examples/example13.out index 93f31ba9..94488015 100644 --- a/tests/examples/example13.out +++ b/tests/examples/example13.out @@ -4,9 +4,9 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.6.0 + GEOPHIRES Version: 3.6.2 Simulation Date: 2024-10-15 - Simulation Time: 13:07 + Simulation Time: 15:20 Calculation Time: 0.035 sec ***SUMMARY OF RESULTS*** @@ -30,9 +30,9 @@ Simulation Metadata Accrued financing during construction: 0.00 Project lifetime: 30 yr Capacity factor: 80.0 % - Project NPV: -45.14 MUSD + Project NPV: -43.00 MUSD Project IRR: -5.99 % - Project VIR=PI=PIR: 0.20 + Project VIR=PI=PIR: 0.24 Project MOIC: -0.22 Project Payback Period: N/A CHP: Percent cost allocation for electrical plant: 60.28 % diff --git a/tests/examples/example13.txt b/tests/examples/example13.txt index bb4e8730..7a027d01 100644 --- a/tests/examples/example13.txt +++ b/tests/examples/example13.txt @@ -53,6 +53,7 @@ District Heating Road Length,3, ---[km] supersedes model option 2 if any val Plant Lifetime,30, --- [years] Economic Model,2, --- Should be 1 (FCR model), 2 (Standard LCOE/LCOH model), or 3 (Bicycle model). Discount Rate,0.05, +Fixed Internal Rate,5, -- matches Discount Rate Inflation Rate During Construction,0, --- [-] Well Drilling and Completion Capital Cost Adjustment Factor,1, --- [-] Use built-in well cost correlation as is Well Drilling Cost Correlation,1, --- [-] Use built-in well drilling cost correlation #1 diff --git a/tests/examples/example2.out b/tests/examples/example2.out index 1b899424..96547626 100644 --- a/tests/examples/example2.out +++ b/tests/examples/example2.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.6.0 + GEOPHIRES Version: 3.6.2 Simulation Date: 2024-10-15 - Simulation Time: 13:07 - Calculation Time: 0.208 sec + Simulation Time: 15:20 + Calculation Time: 0.209 sec ***SUMMARY OF RESULTS*** @@ -28,9 +28,9 @@ Simulation Metadata Accrued financing during construction: 0.00 Project lifetime: 25 yr Capacity factor: 90.0 % - Project NPV: -3.54 MUSD + Project NPV: 3.83 MUSD Project IRR: 5.97 % - Project VIR=PI=PIR: 0.91 + Project VIR=PI=PIR: 1.09 Project MOIC: 0.52 Project Payback Period: 13.21 yr diff --git a/tests/examples/example2.txt b/tests/examples/example2.txt index 2d338951..644ba199 100644 --- a/tests/examples/example2.txt +++ b/tests/examples/example2.txt @@ -43,6 +43,7 @@ Surface Temperature,15, ---[deg.C] Plant Lifetime,25, ---[years] Economic Model,2, ---Standard Levelized Cost Model Discount Rate,.05, ---[-] +Fixed Internal Rate,5, -- matches Discount Rate Inflation Rate During Construction,0, ---[-] # ***Capital and O&M Cost Parameters*** diff --git a/tests/examples/example_SHR-2.out b/tests/examples/example_SHR-2.out index 6cfa3b2d..4ac2011d 100644 --- a/tests/examples/example_SHR-2.out +++ b/tests/examples/example_SHR-2.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.6.0 + GEOPHIRES Version: 3.6.2 Simulation Date: 2024-10-15 - Simulation Time: 13:08 - Calculation Time: 0.528 sec + Simulation Time: 15:20 + Calculation Time: 0.530 sec ***SUMMARY OF RESULTS*** @@ -29,9 +29,9 @@ Simulation Metadata Accrued financing during construction: 0.00 Project lifetime: 20 yr Capacity factor: 95.0 % - Project NPV: 334.92 MUSD + Project NPV: 402.91 MUSD Project IRR: 15.06 % - Project VIR=PI=PIR: 1.80 + Project VIR=PI=PIR: 1.97 Project MOIC: 2.00 Project Payback Period: 7.61 yr Estimated Jobs Created: 221 diff --git a/tests/examples/example_SHR-2.txt b/tests/examples/example_SHR-2.txt index 7da28a52..150b2b08 100644 --- a/tests/examples/example_SHR-2.txt +++ b/tests/examples/example_SHR-2.txt @@ -47,6 +47,7 @@ Tax Relief Per Year, 2.212 Do Carbon Price Calculations, True Time steps per year, 6 Discount Rate, 0.06 +Fixed Internal Rate, 6, -- matches Discount Rate Reservoir Stimulation Capital Cost, 18 Well Drilling and Completion Capital Cost Adjustment Factor, 2 Injection Well Drilling and Completion Capital Cost Adjustment Factor, 2