Skip to content

Commit

Permalink
Merge pull request #558 from bobmyhill/prod
Browse files Browse the repository at this point in the history
np.product->np.prod
  • Loading branch information
bobmyhill authored Nov 7, 2023
2 parents 6f0ad0f + e6de5df commit 33904c4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions burnman/optimize/eos_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def fit_PTp_data(
)

# Apply mle tolerances if they dont exist
if mle_tolerances == []:
if len(mle_tolerances) == 0:
mineral.set_state(1.0e5, 300.0)
mle_tolerance_factor = 1.0e-5
mle_tolerances = np.empty(len(flags))
Expand All @@ -200,7 +200,7 @@ def fit_PTp_data(
# If covariance matrix is not given, apply unit weighting to all pressures
# (with zero errors on T and p)
covariances_defined = True
if data_covariances == []:
if len(data_covariances) == 0:
covariances_defined = False
data_covariances = np.zeros((len(data[:, 0]), len(data[0]), len(data[0])))
for i in range(len(data_covariances)):
Expand Down Expand Up @@ -535,7 +535,7 @@ def fit_XPTp_data(
)

# Apply mle tolerances if they dont exist
if mle_tolerances == []:
if len(mle_tolerances) == 0:
solution.set_state(1.0e5, 300.0)
mle_tolerance_factor = 1.0e-5
mle_tolerances = np.empty(len(flags))
Expand All @@ -548,7 +548,7 @@ def fit_XPTp_data(
# If covariance matrix is not given, apply unit weighting to all pressures
# (with zero errors on T and property)
covariances_defined = True
if data_covariances == []:
if len(data_covariances) == 0:
covariances_defined = False
nX = solution.n_endmembers
data_covariances = np.zeros((len(data[:, 0]), len(data[0]), len(data[0])))
Expand Down
2 changes: 1 addition & 1 deletion burnman/tools/equilibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ def equilibrate(
updated_params = True

# Finally, make dimensions of sol_array equal the input dimensions
if np.product(sol_array.shape) > 1:
if np.prod(sol_array.shape) > 1:
sol_array = np.squeeze(sol_array)
else:
sol_array = sol_array.flatten()[0]
Expand Down
2 changes: 1 addition & 1 deletion burnman/utils/geotherm.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def adiabatic(pressures, T0, rock):
rock.set_state(pressures[0], T0)
S0 = rock.S

delta_S = lambda T, P, rock, S0: S0 - rock.evaluate(["S"], [P], [T])[0]
delta_S = lambda T, P, rock, S0: S0 - rock.evaluate(["S"], [P], [T])[0][0]

temperatures = np.empty_like(pressures)
temperatures[0] = T0
Expand Down
2 changes: 1 addition & 1 deletion burnman/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def attribute_function(m, attributes, powers=[]):
"""
if type(attributes) is str:
attributes = [attributes]
if powers == []:
if len(powers) == 0:
powers = [1.0 for a in attributes]

def f(x):
Expand Down

0 comments on commit 33904c4

Please sign in to comment.