Title: Flaky test failure in TestFlatSys with current slycot · Issue #820 · python-control/python-control · GitHub
Open Graph Title: Flaky test failure in TestFlatSys with current slycot · Issue #820 · python-control/python-control
X Title: Flaky test failure in TestFlatSys with current slycot · Issue #820 · python-control/python-control
Description: From the Slycot CI on a few runs of the test matrix, but not all: 2022-12-21T09:54:30.8524100Z =================================== FAILURES =================================== 2022-12-21T09:54:30.8524781Z ______ TestFlatSys.test_kinemati...
Open Graph Description: From the Slycot CI on a few runs of the test matrix, but not all: 2022-12-21T09:54:30.8524100Z =================================== FAILURES =================================== 2022-12-21T09:54:30.8...
X Description: From the Slycot CI on a few runs of the test matrix, but not all: 2022-12-21T09:54:30.8524100Z =================================== FAILURES =================================== 2022-12-21T09:54:30.8...
Opengraph URL: https://github.com/python-control/python-control/issues/820
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Flaky test failure in TestFlatSys with current slycot","articleBody":"From the Slycot CI on a few runs of the test matrix, but not all:\r\n\r\n```python\r\n2022-12-21T09:54:30.8524100Z =================================== FAILURES ===================================\r\n2022-12-21T09:54:30.8524781Z ______ TestFlatSys.test_kinematic_car_ocp[basis6-None-constraints6-None] _______\r\n2022-12-21T09:54:30.8525337Z \r\n2022-12-21T09:54:30.8525622Z self = \u003ccontrol.tests.flatsys_test.TestFlatSys object at 0x7ffa1993a430\u003e\r\n2022-12-21T09:54:30.8526148Z vehicle_flat = \u003cFlatSystem:sys[3472]:['v', 'delta']-\u003e['x', 'y', 'theta']\u003e\r\n2022-12-21T09:54:30.8526560Z basis = \u003cBSplineFamily: nvars=None, degree=[8], smoothness=[7]\u003e, guess = None\r\n2022-12-21T09:54:30.8527014Z constraints = ([8, -0.1], [12, 0.1]), method = None\r\n2022-12-21T09:54:30.8527252Z \r\n2022-12-21T09:54:30.8527434Z @pytest.mark.parametrize(\r\n2022-12-21T09:54:30.8527773Z \"basis, guess, constraints, method\", [\r\n2022-12-21T09:54:30.8528179Z (fs.PolyFamily(8, T=10), 'prev', None, None),\r\n2022-12-21T09:54:30.8528603Z (fs.BezierFamily(8, T=10), 'linear', None, None),\r\n2022-12-21T09:54:30.8528964Z (fs.BSplineFamily([0, 10], 8), None, None, None),\r\n2022-12-21T09:54:30.8529417Z (fs.BSplineFamily([0, 10], 8), 'prev', None, 'trust-constr'),\r\n2022-12-21T09:54:30.8529871Z (fs.BSplineFamily([0, 10], [6, 8], vars=2), 'prev', None, None),\r\n2022-12-21T09:54:30.8530326Z (fs.BSplineFamily([0, 5, 10], 5), 'linear', None, 'slsqp'),\r\n2022-12-21T09:54:30.8530807Z (fs.BSplineFamily([0, 10], 8), None, ([8, -0.1], [12, 0.1]), None),\r\n2022-12-21T09:54:30.8531174Z (fs.BSplineFamily([0, 5, 10], 5, 3), None, None, None),\r\n2022-12-21T09:54:30.8531474Z ])\r\n2022-12-21T09:54:30.8531750Z def test_kinematic_car_ocp(\r\n2022-12-21T09:54:30.8532108Z self, vehicle_flat, basis, guess, constraints, method):\r\n2022-12-21T09:54:30.8532410Z \r\n2022-12-21T09:54:30.8532709Z # Define the endpoints of the trajectory\r\n2022-12-21T09:54:30.8533084Z x0 = [0., -2., 0.]; u0 = [10., 0.]\r\n2022-12-21T09:54:30.8533434Z xf = [40., 2., 0.]; uf = [10., 0.]\r\n2022-12-21T09:54:30.8534029Z Tf = 4\r\n2022-12-21T09:54:30.8534671Z timepts = np.linspace(0, Tf, 10)\r\n2022-12-21T09:54:30.8535730Z \r\n2022-12-21T09:54:30.8535966Z # Find trajectory between initial and final conditions\r\n2022-12-21T09:54:30.8536225Z traj_p2p = fs.point_to_point(\r\n2022-12-21T09:54:30.8536495Z vehicle_flat, Tf, x0, u0, xf, uf, basis=basis)\r\n2022-12-21T09:54:30.8536704Z \r\n2022-12-21T09:54:30.8537049Z # Verify that the trajectory computation is correct\r\n2022-12-21T09:54:30.8537317Z x, u = traj_p2p.eval(timepts)\r\n2022-12-21T09:54:30.8537589Z np.testing.assert_array_almost_equal(x0, x[:, 0])\r\n2022-12-21T09:54:30.8537872Z np.testing.assert_array_almost_equal(u0, u[:, 0])\r\n2022-12-21T09:54:30.8538226Z np.testing.assert_array_almost_equal(xf, x[:, -1])\r\n2022-12-21T09:54:30.8538573Z np.testing.assert_array_almost_equal(uf, u[:, -1])\r\n2022-12-21T09:54:30.8538780Z \r\n2022-12-21T09:54:30.8538940Z #\r\n2022-12-21T09:54:30.8539210Z # Re-solve as optimal control problem\r\n2022-12-21T09:54:30.8539414Z #\r\n2022-12-21T09:54:30.8539569Z \r\n2022-12-21T09:54:30.8539811Z # Define the cost function (mainly penalize steering angle)\r\n2022-12-21T09:54:30.8540092Z traj_cost = opt.quadratic_cost(\r\n2022-12-21T09:54:30.8540358Z vehicle_flat, None, np.diag([0.1, 10]), x0=xf, u0=uf)\r\n2022-12-21T09:54:30.8540576Z \r\n2022-12-21T09:54:30.8540794Z # Set terminal cost to bring us close to xf\r\n2022-12-21T09:54:30.8541051Z terminal_cost = opt.quadratic_cost(\r\n2022-12-21T09:54:30.8541320Z vehicle_flat, 1e3 * np.eye(3), None, x0=xf)\r\n2022-12-21T09:54:30.8541535Z \r\n2022-12-21T09:54:30.8541749Z # Implement terminal constraints if specified\r\n2022-12-21T09:54:30.8541990Z if constraints:\r\n2022-12-21T09:54:30.8542241Z input_constraints = opt.input_range_constraint(\r\n2022-12-21T09:54:30.8542498Z vehicle_flat, *constraints)\r\n2022-12-21T09:54:30.8542706Z else:\r\n2022-12-21T09:54:30.8542905Z input_constraints = None\r\n2022-12-21T09:54:30.8543093Z \r\n2022-12-21T09:54:30.8543331Z # Use a straight line as an initial guess for the trajectory\r\n2022-12-21T09:54:30.8543624Z if guess == 'prev':\r\n2022-12-21T09:54:30.8543934Z initial_guess = traj_p2p.eval(timepts)[0][0:2]\r\n2022-12-21T09:54:30.8544221Z elif guess == 'linear':\r\n2022-12-21T09:54:30.8544450Z initial_guess = np.array(\r\n2022-12-21T09:54:30.8544774Z [x0[i] + (xf[i] - x0[i]) * timepts/Tf for i in (0, 1)])\r\n2022-12-21T09:54:30.8545004Z else:\r\n2022-12-21T09:54:30.8545194Z initial_guess = None\r\n2022-12-21T09:54:30.8545381Z \r\n2022-12-21T09:54:30.8545564Z # Solve the optimal trajectory\r\n2022-12-21T09:54:30.8545801Z traj_ocp = fs.solve_flat_ocp(\r\n2022-12-21T09:54:30.8546040Z vehicle_flat, timepts, x0, u0,\r\n2022-12-21T09:54:30.8546301Z cost=traj_cost, constraints=input_constraints,\r\n2022-12-21T09:54:30.8546584Z terminal_cost=terminal_cost, basis=basis,\r\n2022-12-21T09:54:30.8546840Z initial_guess=initial_guess,\r\n2022-12-21T09:54:30.8547137Z minimize_kwargs={'method': method},\r\n2022-12-21T09:54:30.8547353Z )\r\n2022-12-21T09:54:30.8547556Z xd, ud = traj_ocp.eval(timepts)\r\n2022-12-21T09:54:30.8547779Z if not traj_ocp.success:\r\n2022-12-21T09:54:30.8548067Z # If unsuccessful, make sure the error is just about precision\r\n2022-12-21T09:54:30.8548428Z \u003e assert re.match(\".*precision loss.*\", traj_ocp.message) is not None\r\n2022-12-21T09:54:30.8548730Z E AssertionError: assert None is not None\r\n2022-12-21T09:54:30.8549178Z E + where None = \u003cfunction match at 0x7ffa22446dc0\u003e('.*precision loss.*', 'Iteration limit reached')\r\n2022-12-21T09:54:30.8549525Z E + where \u003cfunction match at 0x7ffa22446dc0\u003e = re.match\r\n2022-12-21T09:54:30.8550032Z E + and 'Iteration limit reached' = \u003ccontrol.flatsys.systraj.SystemTrajectory object at 0x7ffa1894ee80\u003e.message\r\n2022-12-21T09:54:30.8550299Z \r\n2022-12-21T09:54:30.8550420Z control/tests/flatsys_test.py:206: AssertionError\r\n```","author":{"url":"https://github.com/bnavigator","@type":"Person","name":"bnavigator"},"datePublished":"2022-12-21T10:31:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/820/python-control/issues/820"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dbe6beb2-4cb5-eb88-72bd-d0b1672e7afc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CCBE:2B276C:2BA8ACB:3B4DEDB:6979B8C4 |
| html-safe-nonce | a94193938d87ef560423f13fca81a765a9e5e42c7056c6a199cdb52ab4129836 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0JFOjJCMjc2QzoyQkE4QUNCOjNCNERFREI6Njk3OUI4QzQiLCJ2aXNpdG9yX2lkIjoiNjQ0NDI1OTYzMzgwNzM0MTc2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7c510da3187070a0d699ff5bea0b65ace4a444ed1d7be368bcff9b554f75606a |
| hovercard-subject-tag | issue:1506076946 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-control/python-control/820/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2abd11890eebc493c0a1c78dea8a138b644be82761321a7ea27ee9496fbad6cd/python-control/python-control/issues/820 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2abd11890eebc493c0a1c78dea8a138b644be82761321a7ea27ee9496fbad6cd/python-control/python-control/issues/820 |
| og:image:alt | From the Slycot CI on a few runs of the test matrix, but not all: 2022-12-21T09:54:30.8524100Z =================================== FAILURES =================================== 2022-12-21T09:54:30.8... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bnavigator |
| hostname | github.com |
| expected-hostname | github.com |
| None | c049b65ec7e54cbf2521f5a560b6527714c612b0bd169188e2ea6e16f83bd5f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-control/python-control git https://github.com/python-control/python-control.git |
| octolytics-dimension-user_id | 2285872 |
| octolytics-dimension-user_login | python-control |
| octolytics-dimension-repository_id | 22791752 |
| octolytics-dimension-repository_nwo | python-control/python-control |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 22791752 |
| octolytics-dimension-repository_network_root_nwo | python-control/python-control |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 87b137883e35e2766c3d0f6a257c4044f6390b83 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width