Skip to content

numpy version fix/upgrade [v3.9.43] #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.9.42
current_version = 3.9.43
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion .cookiecutterrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ Free software: `MIT license <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
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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',
Expand All @@ -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"',
Expand Down
15 changes: 7 additions & 8 deletions src/geophires_x/GeoPHIRESUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "</body>" tag
# build the string to be inserted first
insert_string = ''
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.9.42'
__version__ = '3.9.43'
3 changes: 2 additions & 1 deletion tests/test_geophires_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
Loading