diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 73b23e8bd..0e2916d8b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.15.2 +current_version = 3.15.3 commit = True tag = True diff --git a/.cookiecutterrc b/.cookiecutterrc index 9a89ff585..033f8f968 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.15.2 + version: 3.15.3 version_manager: "bump2version" website: "https://github.com/NREL" year_from: "2023" diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fbe40213b..5e8fb1c0d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,8 @@ GEOPHIRES v3 (2023-2026) 3.15 ^^^^ +3.15.3: `Acre unit support (HIP-RA-X Reservoir Area) `__ | `release `__ + 3.15: `Calculate S-DAC carbon revenue (BICYCLE); Reservoir Stimulation Capital Cost per Fracture Surface Area `__ | `release `__ | **Changed:** S-DAC carbon revenue is now calculated. See `the tracking issue `__ for details. 3.14 diff --git a/README.rst b/README.rst index 584e4fe23..d2e8f954f 100644 --- a/README.rst +++ b/README.rst @@ -58,9 +58,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.15.2.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.15.3.svg :alt: Commits since latest release - :target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.15.2...main + :target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.15.3...main .. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat :target: https://softwareengineerprogrammer.github.io/GEOPHIRES diff --git a/docs/conf.py b/docs/conf.py index 89bf6c3b6..5513f6159 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ year = '2025' author = 'NREL' copyright = f'{year}, {author}' -version = release = '3.15.2' +version = release = '3.15.3' pygments_style = 'trac' templates_path = ['./templates'] diff --git a/setup.py b/setup.py index dcd6fa1f6..e6989a316 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(*names, **kwargs): setup( name='geophires-x', - version='3.15.2', + version='3.15.3', 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 c7f332737..632976c82 100644 --- a/src/geophires_x/Parameter.py +++ b/src/geophires_x/Parameter.py @@ -14,6 +14,7 @@ from abc import ABC +from pint import UndefinedUnitError from pint.facets.plain import PlainQuantity from geophires_x.OptionList import GeophiresInputEnum @@ -947,8 +948,13 @@ def LookupUnits(sUnitText: str): return item, uType # No match was found with the unit text string, so try with the canonical symbol (if different). - symbol = _ureg.get_symbol(sUnitText) - if symbol != sUnitText: return LookupUnits(symbol) + try: + symbol = _ureg.get_symbol(sUnitText) + if symbol != sUnitText: + return LookupUnits(symbol) + except UndefinedUnitError as _uue: + return sUnitText, uType + return None, None diff --git a/src/geophires_x/Units.py b/src/geophires_x/Units.py index 0ab73c338..11a0e8336 100644 --- a/src/geophires_x/Units.py +++ b/src/geophires_x/Units.py @@ -135,6 +135,7 @@ class AreaUnit(str, Enum): FEET2 = "ft**2" INCHES2 = "in**2" MILES2 = "mi**2" + ACRES = 'acre' class VolumeUnit(str, Enum): diff --git a/src/geophires_x/__init__.py b/src/geophires_x/__init__.py index 832ff3c2c..1394f3dcd 100644 --- a/src/geophires_x/__init__.py +++ b/src/geophires_x/__init__.py @@ -1 +1 @@ -__version__ = '3.15.2' +__version__ = '3.15.3' diff --git a/tests/hip_ra_x_tests/hip-ra-x-area-acres.txt b/tests/hip_ra_x_tests/hip-ra-x-area-acres.txt new file mode 100644 index 000000000..9703b736b --- /dev/null +++ b/tests/hip_ra_x_tests/hip-ra-x-area-acres.txt @@ -0,0 +1,6 @@ +Reservoir Temperature, 212.5 +Rejection Temperature, 60.0 +Reservoir Porosity, 10.0 +Reservoir Area, 109930 acre +Reservoir Thickness, 0.25 +Reservoir Life Cycle, 25 diff --git a/tests/hip_ra_x_tests/test_hip_ra_x.py b/tests/hip_ra_x_tests/test_hip_ra_x.py index 0ff983dc5..68a86e5da 100644 --- a/tests/hip_ra_x_tests/test_hip_ra_x.py +++ b/tests/hip_ra_x_tests/test_hip_ra_x.py @@ -474,7 +474,16 @@ def test_hip_ra_input_parameters_init(self): with self.assertRaises(ValueError): HipRaInputParameters(1) - def _new_hip_ra_test_instance(self, enable_hip_ra_logging_config=False, pre_re_stash_runner=None) -> HIP_RA_X: + def test_area_acre(self): + result: HipRaResult = HipRaXClient().get_hip_ra_x_result( + HipRaInputParameters(self._get_test_file_path('hip-ra-x-area-acres.txt')) + ) + + self.assertEqual('km**2', result.result['SUMMARY OF INPUTS']['Reservoir Area']['unit']) + self.assertAlmostEqual(444.9, result.result['SUMMARY OF INPUTS']['Reservoir Area']['value'], places=1) + + @staticmethod + def _new_hip_ra_test_instance(enable_hip_ra_logging_config=False, pre_re_stash_runner=None) -> HIP_RA_X: stash_cwd = Path.cwd() stash_sys_argv = sys.argv