Skip to content

Commit 10b80cc

Browse files
Merge pull request NREL#409 from softwareengineerprogrammer/main
numpy version fix/upgrade [v3.9.43]
2 parents 7233df0 + 4b6bc22 commit 10b80cc

File tree

9 files changed

+18
-19
lines changed

9 files changed

+18
-19
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.9.42
2+
current_version = 3.9.43
33
commit = True
44
tag = True
55

.cookiecutterrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ default_context:
5454
sphinx_doctest: "no"
5555
sphinx_theme: "sphinx-py3doc-enhanced-theme"
5656
test_matrix_separate_coverage: "no"
57-
version: 3.9.42
57+
version: 3.9.43
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Free software: `MIT license <LICENSE>`__
5858
:alt: Supported implementations
5959
:target: https://pypi.org/project/geophires-x
6060

61-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.42.svg
61+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.43.svg
6262
:alt: Commits since latest release
63-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.42...main
63+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.43...main
6464

6565
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
6666
:target: https://nrel.github.io/GEOPHIRES-X

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
year = '2025'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.9.42'
21+
version = release = '3.9.43'
2222

2323
pygments_style = 'trac'
2424
templates_path = ['./templates']

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def read(*names, **kwargs):
1313

1414
setup(
1515
name='geophires-x',
16-
version='3.9.42',
16+
version='3.9.43',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(
@@ -62,7 +62,7 @@ def read(*names, **kwargs):
6262
python_requires='>=3.8',
6363
install_requires=[
6464
'numpy==1.24; python_version == "3.8"', # Last version compatible with Python 3.8
65-
'numpy==1.26; python_version > "3.8"',
65+
'numpy; python_version > "3.8"',
6666
'numpy-financial',
6767
'pint',
6868
'forex_python',
@@ -74,7 +74,7 @@ def read(*names, **kwargs):
7474
'pandas',
7575
'matplotlib',
7676
# Used by Adv*/AGS extensions; may break tox pypy jobs if those are re-enabled
77-
'h5py==3.10.0', # TODO resolve apparent h5py==3.11.0 build compatibility issues on some platforms
77+
'h5py',
7878
'scipy',
7979
'iapws',
8080
'coolprop; python_version > "3.8"',

src/geophires_x/GeoPHIRESUtils.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595

9696

9797
def InsertImagesIntoHTML(html_path: str, short_names: set, full_names: set) -> None:
98-
9998
# Write a reference to the image(s) into the HTML file by inserting before the "</body>" tag
10099
# build the string to be inserted first
101100
insert_string = ''
@@ -144,7 +143,7 @@ def render_default(p: float, unit: str = '', fmt: str = '') -> str:
144143
:type fmt: str
145144
:return: the string representation of the float
146145
"""
147-
if not np.can_cast(p, float):
146+
if not is_float(p):
148147
raise ValueError(f'Parameter ({p}) must be a float or convertible to float.')
149148

150149
unit = UpgradeSymbologyOfUnits(unit)
@@ -176,7 +175,7 @@ def render_scientific(p: float, unit: str = '', fmt: str = '') -> str:
176175
:rtype: str
177176
"""
178177

179-
if not np.can_cast(p, float):
178+
if not is_float(p):
180179
raise ValueError(f'Parameter ({p}) must be a float or convertible to float.')
181180

182181
unit = UpgradeSymbologyOfUnits(unit)
@@ -197,7 +196,7 @@ def render_Parameter_default(p: Parameter, fmt: str = '') -> str:
197196
:type fmt: str
198197
:return: the string representation of the float
199198
"""
200-
if not np.can_cast(p.value, float):
199+
if not is_float(p.value):
201200
raise ValueError(f'Parameter ({p.value}) must be a float or convertible to float.')
202201

203202
return render_default(p.value, p.CurrentUnits.value)
@@ -214,7 +213,7 @@ def render_parameter_scientific(p: Parameter, fmt: str = '') -> str:
214213
:return: the string representation of the float
215214
"""
216215

217-
if not np.can_cast(p.value, float):
216+
if not is_float(p.value):
218217
raise ValueError(f'Parameter ({p.value}) must be a float or convertible to float.')
219218

220219
return render_scientific(p.value, p.CurrentUnits.value)
@@ -241,7 +240,7 @@ def density_water_kg_per_m3(Twater_degC: float, pressure: Optional[PlainQuantity
241240
Raises:
242241
ValueError: If Twater_degC is not a float or convertible to float.
243242
"""
244-
if not np.can_cast(Twater_degC, float):
243+
if not is_float(Twater_degC):
245244
raise ValueError(f'Twater_degC ({Twater_degC}) must be a float or convertible to float.')
246245

247246
try:
@@ -276,7 +275,7 @@ def celsius_to_kelvin(celsius: float) -> float:
276275

277276
@lru_cache
278277
def viscosity_water_Pa_sec(
279-
Twater_degC: float,
278+
Twater_degC: float,
280279
pressure: Optional[PlainQuantity] = None) -> float:
281280
"""
282281
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:
390389

391390
try:
392391
return (quantity(CP.PropsSI('P', 'T', celsius_to_kelvin(temperature_degC), 'Q', 0, 'Water'), 'Pa')
393-
.to('kPa').magnitude)
392+
.to('kPa').magnitude)
394393

395394
except (NotImplementedError, ValueError) as e:
396395
raise ValueError(f'Input temperature ({temperature_degC}C) is out of range or otherwise not implemented') from e

src/geophires_x/Model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sys
2-
from email.policy import default
32
from pathlib import Path
43
import logging
54
import time

src/geophires_x/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.9.42'
1+
__version__ = '3.9.43'

tests/test_geophires_x.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ def get_output_file_for_example(example_file: str):
212212
# Adding additional test cases that require this fallback should be avoided if possible.
213213
cases_to_allow_almost_equal = [
214214
'Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt',
215+
'Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt',
215216
'Wanju_Yuan_Closed-Loop_Geothermal_Energy_Recovery.txt',
216217
]
217218
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):
231232
self.assertDictAlmostEqual(
232233
expected_result.result,
233234
geophires_result.result,
234-
places=1,
235+
percent=0.01,
235236
msg=f'Example test: {example_file_path}',
236237
)
237238
regenerate_cmds.pop()

0 commit comments

Comments
 (0)