Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit207a059

Browse files
committed
ease test tolerance on timeseries
1 parent5ab0a1c commit207a059

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎control/tests/flatsys_test.py

Lines changed: 3 additions & 2 deletions
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
withpytest.raises(TypeError,match="unrecognized keyword"):

‎control/tests/timeresp_test.py

Lines changed: 2 additions & 1 deletion
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
deftest_forced_response_invalid_c(self,tsystem):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp