Skip to content

Commit 5f4cad6

Browse files
committed
Use numpy exp() in sat()
math.exp() was causing a TypeError in Python 3.11 on Github CI
1 parent 71f2285 commit 5f4cad6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

t2thermo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
from collections.abc import Iterable # Python >= 3.3
5151
except ImportError:
5252
from collections import Iterable
53+
import numpy as np
5354

5455
def cowat(t, p, bounds = False):
5556
"""Density d and internal energy u of liquid water as a function of
@@ -273,7 +274,7 @@ def sat(t, bounds = False):
273274
SC = SC * X1 + a[2]
274275
SC = SC * X1 + a[1]
275276
SC = SC * X1
276-
PC = exp(SC / (TC * (1.0 + a[6] * X1 + a[7] * X2)) - \
277+
PC = np.exp(SC / (TC * (1.0 + a[6] * X1 + a[7] * X2)) - \
277278
X1 / (a[8] * X2 + a[9]))
278279
return PC * 2.212e7
279280
else: return None

0 commit comments

Comments
 (0)