Skip to content

Commit

Permalink
Address deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnectedSystems committed Jul 14, 2024
1 parent a1981af commit ebec5a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SALib/analyze/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def calc_delta(Y, Ygrid, X, m):
else:
fy_ = np.abs(fy)

d_hat += (nm / (2 * N)) * np.trapz(fy_, Ygrid)
d_hat += (nm / (2 * N)) * np.trapezoid(fy_, Ygrid)

return d_hat

Expand Down
6 changes: 3 additions & 3 deletions src/SALib/test_functions/Sobol_G.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def evaluate(values, a=None, delta=None, alpha=None):
mod_x = shift_of_x - integral
temp_y = np.abs(2 * mod_x - 1) ** alpha
y_elements = ((1 + alpha) * temp_y + a) / (1 + a)
Y[i] = np.prod(y_elements)
Y[i] = y_elements.prod()

return Y

Expand All @@ -103,7 +103,7 @@ def _total_variance(a=None, alpha=None):
alpha = np.ones_like(a)

a = np.array(a)
return np.add(-1, np.product(1 + _partial_first_order_variance(a, alpha), axis=0))
return np.add(-1, np.prod(1 + _partial_first_order_variance(a, alpha), axis=0))


def sensitivity_index(a, alpha=None):
Expand All @@ -116,6 +116,6 @@ def total_sensitivity_index(a, alpha=None):

pv = _partial_first_order_variance(a, alpha)
tv = _total_variance(a, alpha)
product_pv = np.product(1 + pv, axis=0)
product_pv = np.prod(1 + pv, axis=0)

return np.divide(pv * np.divide(product_pv, 1 + pv.T), tv)
2 changes: 1 addition & 1 deletion src/SALib/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def compute_groups_matrix(groups: List):
groups and a list of unique group names
"""
num_vars = len(groups)
unique_group_names = pd.unique(groups)
unique_group_names = pd.unique(np.array(groups))
number_of_groups = len(unique_group_names)

indices = dict([(x, i) for (i, x) in enumerate(unique_group_names)])
Expand Down

0 comments on commit ebec5a6

Please sign in to comment.