Skip to content

Commit 696e8c5

Browse files
committed
DOC: Fix docstring example
1 parent e91aa40 commit 696e8c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sambo/_shgo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ def shgo(
128128
129129
Examples
130130
--------
131-
>>> from sambo import shgo
131+
>>> from sambo import minimize
132132
>>> def objective_func(x):
133133
... return sum(x**2)
134-
>>> result = shgo(fun=objective_func, bounds=[(-5, 5), (-5, 5)])
134+
>>> result = minimize(objective_func, bounds=[(-5, 5), (-5, 5)], method='shgo')
135135
"""
136136
bounds, x0, y0 = _check_bounds(bounds, x0, y0)
137137
rng = _check_random_state(rng)

sambo/_util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,5 +305,6 @@ def recompute_kde(X, y):
305305
w = np.max(y) - y
306306
w /= np.sum(w)
307307
w **= 3
308+
assert not np.isnan(w).any(), (w, y)
308309
kde = gaussian_kde(X.T, bw_method='silverman', weights=w)
309310
return kde

0 commit comments

Comments
 (0)