48e7f2a47b2f2a109e70718e2e3b290d3084481f,scipy/integrate/tests/test_ivp.py,,test_integration,#,44
Before Change
atol = 1e-6
y0 = [1/3, 2/9]
for method in ["RK23", "RK45", "Radau", "BDF"]:
for t_span in ([5, 9], [5, 1]):
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol,
atol=atol, method=method, dense_output=True)
assert_equal(res.t[0], t_span[0])
After Change
atol = 1e-6
y0 = [1/3, 2/9]
with warnings.catch_warnings():
warnings.simplefilter("ignore")
for method, t_span, jac in product(
["RK23", "RK45", "Radau", "BDF"],
[[5, 9], [5, 1]],
[None, jac_rational, jac_rational_sparse]):
res = solve_ivp(fun_rational, t_span, y0, rtol=rtol,
atol=atol, method=method, dense_output=True,
jac=jac)
assert_equal(res.t[0], t_span[0])
assert_(res.t_events is None)
assert_(res.success)
assert_equal(res.status, 0)
assert_(res.nfev < 40)
if method in ["RK23", "RK45"]:
assert_equal(res.njev, 0)
assert_equal(res.nlu, 0)
else:
assert_(0 < res.njev < 3)
assert_(0 < res.nlu < 10)
y_true = sol_rational(res.t)
e = compute_error(res.y, y_true, rtol, atol)
assert_(np.all(e < 5))
tc = np.linspace(*t_span)
yc_true = sol_rational(tc)
yc = res.sol(tc)
e = compute_error(yc, yc_true, rtol, atol)
assert_(np.all(e < 5))
assert_allclose(res.sol(res.t), res.y, rtol=1e-15, atol=1e-15)
def test_events():
event_rational_3.terminal = True
for method in ["RK23", "RK45", "Radau", "BDF"]:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: scipy/scipy
Commit Name: 48e7f2a47b2f2a109e70718e2e3b290d3084481f
Time: 2017-04-20
Author: nikolay.mayorov@zoho.com
File Name: scipy/integrate/tests/test_ivp.py
Class Name:
Method Name: test_integration
Project Name: dask/dask-ml
Commit Name: e6fd1b533326c5f42fb45cac57d5e95f919a8955
Time: 2020-05-05
Author: TomAugspurger@users.noreply.github.com
File Name: dask_ml/model_selection/_normalize.py
Class Name:
Method Name: normalize_estimator
Project Name: scipy/scipy
Commit Name: 0131d72f0f7a5c13f00961aea054094b2b78f071
Time: 2016-10-12
Author: evgeny.burovskiy@gmail.com
File Name: scipy/interpolate/tests/test_bsplines.py
Class Name: TestInterop
Method Name: test_splev