Skip to content

Commit

Permalink
obtaining DeprecationWarning and ndim warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jlnav committed Jul 3, 2023
1 parent 3fe2dcf commit e4703c1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libensemble/gen_funcs/persistent_fd_param_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def fd_param_finder(H, persis_info, gen_specs, libE_info):
for k in range(nf + 1):
if k != nf / 2:
logical_conds = (calc_in["x_ind"] == i, calc_in["f_ind"] == j, calc_in["n_ind"] == k)
Fhist0[i, j, k] = calc_in["f_val"][np.logical_and.reduce(logical_conds)]
Fhist0[i, j, k] = calc_in["f_val"][np.logical_and.reduce(logical_conds)][0]

# Compute noise for (i, j):
# [Fnoise(i, j), ~, inform(i, j)] = ECnoise(nf-1, Fhist0(i, j, 2:nf));
Expand Down
2 changes: 1 addition & 1 deletion libensemble/sim_funcs/borehole.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def borehole_func(x):
denom1 = 2 * L * Tu / (np.log(r / rw) * rw**2 * Kw)
denom2 = Tu / Tl

return (numer / (np.log(r / rw) * (1 + denom1 + denom2))).reshape(-1)
return ((numer / (np.log(r / rw) * (1 + denom1 + denom2))).reshape(-1))[0]


def gen_borehole_input(n):
Expand Down
2 changes: 1 addition & 1 deletion libensemble/sim_funcs/rosenbrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def EvaluateFunction(x, component):
x2 = x[2 * i + 1]
f = 100 * (x1**2 - x2) ** 2 + (x1 - 1) ** 2

return f
return f[0]


def EvaluateJacobian(x, component, const):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# TESTSUITE_COMMS: mpi local tcp
# TESTSUITE_NPROCS: 2 4

import warnings

import numpy as np

from libensemble.alloc_funcs.give_pregenerated_work import give_pregenerated_sim_work as alloc_f
Expand All @@ -24,6 +26,8 @@
from libensemble.sim_funcs.borehole import borehole_func, gen_borehole_input
from libensemble.tools import parse_args, save_libE_output

warnings.filterwarnings("ignore", category=DeprecationWarning)

# Main block is necessary only when using local comms with spawn start method (default on macOS and Windows).
if __name__ == "__main__":
nworkers, is_manager, libE_specs, _ = parse_args()
Expand Down
1 change: 1 addition & 0 deletions libensemble/tests/regression_tests/test_ytopt_heffte.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
warnings.filterwarnings("ignore", category=ImportWarning)
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.filterwarnings("ignore", category=RuntimeWarning)
warnings.filterwarnings("ignore", category=DeprecationWarning)

import os
import secrets
Expand Down

0 comments on commit e4703c1

Please sign in to comment.