diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0f0ace4e..c1ce4bc1 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.9.42 +current_version = 3.9.43 commit = True tag = True diff --git a/.cookiecutterrc b/.cookiecutterrc index 2a854e86..d4a01198 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.9.42 + version: 3.9.43 version_manager: "bump2version" website: "https://github.com/NREL" year_from: "2023" diff --git a/README.rst b/README.rst index 992a2ac4..a0ea909a 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.9.42.svg +.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.43.svg :alt: Commits since latest release - :target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.42...main + :target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.43...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 1480d28b..8dbb519f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ year = '2025' author = 'NREL' copyright = f'{year}, {author}' -version = release = '3.9.42' +version = release = '3.9.43' pygments_style = 'trac' templates_path = ['./templates'] diff --git a/setup.py b/setup.py index 4b30a95c..ed100cc3 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read(*names, **kwargs): setup( name='geophires-x', - version='3.9.42', + version='3.9.43', license='MIT', description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.', long_description='{}\n{}'.format( @@ -62,7 +62,7 @@ def read(*names, **kwargs): python_requires='>=3.8', install_requires=[ 'numpy==1.24; python_version == "3.8"', # Last version compatible with Python 3.8 - 'numpy==1.26; python_version > "3.8"', + 'numpy; python_version > "3.8"', 'numpy-financial', 'pint', 'forex_python', @@ -74,7 +74,7 @@ def read(*names, **kwargs): 'pandas', 'matplotlib', # Used by Adv*/AGS extensions; may break tox pypy jobs if those are re-enabled - 'h5py==3.10.0', # TODO resolve apparent h5py==3.11.0 build compatibility issues on some platforms + 'h5py', 'scipy', 'iapws', 'coolprop; python_version > "3.8"', diff --git a/src/geophires_x/GeoPHIRESUtils.py b/src/geophires_x/GeoPHIRESUtils.py index 1a7594aa..acd77e65 100644 --- a/src/geophires_x/GeoPHIRESUtils.py +++ b/src/geophires_x/GeoPHIRESUtils.py @@ -95,7 +95,6 @@ def InsertImagesIntoHTML(html_path: str, short_names: set, full_names: set) -> None: - # Write a reference to the image(s) into the HTML file by inserting before the "" tag # build the string to be inserted first insert_string = '' @@ -144,7 +143,7 @@ def render_default(p: float, unit: str = '', fmt: str = '') -> str: :type fmt: str :return: the string representation of the float """ - if not np.can_cast(p, float): + if not is_float(p): raise ValueError(f'Parameter ({p}) must be a float or convertible to float.') unit = UpgradeSymbologyOfUnits(unit) @@ -176,7 +175,7 @@ def render_scientific(p: float, unit: str = '', fmt: str = '') -> str: :rtype: str """ - if not np.can_cast(p, float): + if not is_float(p): raise ValueError(f'Parameter ({p}) must be a float or convertible to float.') unit = UpgradeSymbologyOfUnits(unit) @@ -197,7 +196,7 @@ def render_Parameter_default(p: Parameter, fmt: str = '') -> str: :type fmt: str :return: the string representation of the float """ - if not np.can_cast(p.value, float): + if not is_float(p.value): raise ValueError(f'Parameter ({p.value}) must be a float or convertible to float.') return render_default(p.value, p.CurrentUnits.value) @@ -214,7 +213,7 @@ def render_parameter_scientific(p: Parameter, fmt: str = '') -> str: :return: the string representation of the float """ - if not np.can_cast(p.value, float): + if not is_float(p.value): raise ValueError(f'Parameter ({p.value}) must be a float or convertible to float.') return render_scientific(p.value, p.CurrentUnits.value) @@ -241,7 +240,7 @@ def density_water_kg_per_m3(Twater_degC: float, pressure: Optional[PlainQuantity Raises: ValueError: If Twater_degC is not a float or convertible to float. """ - if not np.can_cast(Twater_degC, float): + if not is_float(Twater_degC): raise ValueError(f'Twater_degC ({Twater_degC}) must be a float or convertible to float.') try: @@ -276,7 +275,7 @@ def celsius_to_kelvin(celsius: float) -> float: @lru_cache def viscosity_water_Pa_sec( - Twater_degC: float, + Twater_degC: float, pressure: Optional[PlainQuantity] = None) -> float: """ Calculate the dynamic viscosity of water as a function of temperature and pressure. @@ -390,7 +389,7 @@ def vapor_pressure_water_kPa(temperature_degC: float) -> float: try: return (quantity(CP.PropsSI('P', 'T', celsius_to_kelvin(temperature_degC), 'Q', 0, 'Water'), 'Pa') - .to('kPa').magnitude) + .to('kPa').magnitude) except (NotImplementedError, ValueError) as e: raise ValueError(f'Input temperature ({temperature_degC}C) is out of range or otherwise not implemented') from e diff --git a/src/geophires_x/__init__.py b/src/geophires_x/__init__.py index 94ed322a..2037d6cd 100644 --- a/src/geophires_x/__init__.py +++ b/src/geophires_x/__init__.py @@ -1 +1 @@ -__version__ = '3.9.42' +__version__ = '3.9.43' diff --git a/tests/test_geophires_x.py b/tests/test_geophires_x.py index 2bb56169..d64e67c4 100644 --- a/tests/test_geophires_x.py +++ b/tests/test_geophires_x.py @@ -212,6 +212,7 @@ def get_output_file_for_example(example_file: str): # Adding additional test cases that require this fallback should be avoided if possible. cases_to_allow_almost_equal = [ 'Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt', + 'Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt', 'Wanju_Yuan_Closed-Loop_Geothermal_Energy_Recovery.txt', ] allow_almost_equal = example_file_path in cases_to_allow_almost_equal @@ -231,7 +232,7 @@ def get_output_file_for_example(example_file: str): self.assertDictAlmostEqual( expected_result.result, geophires_result.result, - places=1, + percent=0.01, msg=f'Example test: {example_file_path}', ) regenerate_cmds.pop()