Skip to content

Commit 207a059

Browse files
committed
ease test tolerance on timeseries
1 parent 5ab0a1c commit 207a059

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

control/tests/flatsys_test.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,9 @@ def test_point_to_point_errors(self):
339339
traj_kwarg = fs.point_to_point(
340340
flat_sys, timepts, x0, u0, xf, uf, cost=cost_fcn,
341341
basis=fs.PolyFamily(8), minimize_kwargs={'method': 'slsqp'})
342-
np.testing.assert_almost_equal(
343-
traj_method.eval(timepts)[0], traj_kwarg.eval(timepts)[0])
342+
np.testing.assert_allclose(
343+
traj_method.eval(timepts)[0], traj_kwarg.eval(timepts)[0],
344+
atol=1e-5)
344345

345346
# Unrecognized keywords
346347
with pytest.raises(TypeError, match="unrecognized keyword"):

control/tests/timeresp_test.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,8 @@ def test_forced_response_T_U(self, tsystem, fr_kwargs, refattr):
681681
fr_kwargs['X0'] = tsystem.X0
682682
t, y = forced_response(tsystem.sys, **fr_kwargs)
683683
np.testing.assert_allclose(t, tsystem.t)
684-
np.testing.assert_allclose(y, getattr(tsystem, refattr), rtol=1e-3)
684+
np.testing.assert_allclose(y, getattr(tsystem, refattr),
685+
rtol=1e-3, atol=1e-5)
685686

686687
@pytest.mark.parametrize("tsystem", ["siso_ss1"], indirect=True)
687688
def test_forced_response_invalid_c(self, tsystem):

0 commit comments

Comments
 (0)