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..6924cd03 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 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'