Skip to content

Commit

Permalink
empty list to zero comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed Nov 7, 2023
1 parent 700193f commit daabccb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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/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 daabccb

Please sign in to comment.